Skip to content

Commit

Permalink
update tests to use new creator
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Apr 15, 2024
1 parent b0fd4d4 commit d732e06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 6 additions & 5 deletions contracts/utils/IERC20Creator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ struct TokenConfiguration {

interface IERC20Creator {
function createToken(
address partyAddress,
string calldata name,
string calldata symbol,
TokenConfiguration calldata config,
address recipientAddress
address party,
address lpFeeRecipient,
string memory name,
string memory symbol,
TokenConfiguration memory config,
address tokenRecipientAddress
) external payable returns (ERC20 token);
}
8 changes: 7 additions & 1 deletion test/crowdfund/ERC20LaunchCrowdfundForked.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ contract ERC20LaunchCrowdfundForkedTest is SetupPartyHelper {

feeCollector = new FeeCollector(
INonfungiblePositionManager(0xC36442b4a4522E871399CD717aBDD847Ab11FE88),
ITokenDistributor(address(tokenDistributor)),
globalDaoWalletAddress,
5e3,
IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
);

Expand Down Expand Up @@ -73,6 +73,7 @@ contract ERC20LaunchCrowdfundForkedTest is SetupPartyHelper {
tokenOpts.numTokensForDistribution = 5e4 ether;
tokenOpts.numTokensForRecipient = 5e4 ether;
tokenOpts.numTokensForLP = 9e5 ether;
tokenOpts.lpFeeRecipient = launchCrowdfundImpl.PARTY_ADDRESS_KEY();

ERC20LaunchCrowdfund launchCrowdfund = crowdfundFactory.createERC20LaunchCrowdfund(
launchCrowdfundImpl,
Expand Down Expand Up @@ -150,6 +151,7 @@ contract ERC20LaunchCrowdfundForkedTest is SetupPartyHelper {
tokenOpts.numTokensForDistribution = 5e4 ether + 1; // Add 1 to make it invalid
tokenOpts.numTokensForRecipient = 5e4 ether;
tokenOpts.numTokensForLP = 9e5 ether;
tokenOpts.lpFeeRecipient = launchCrowdfundImpl.PARTY_ADDRESS_KEY();

vm.expectRevert(ERC20LaunchCrowdfund.InvalidTokenDistribution.selector);
ERC20LaunchCrowdfund launchCrowdfund = crowdfundFactory.createERC20LaunchCrowdfund(
Expand Down Expand Up @@ -192,6 +194,7 @@ contract ERC20LaunchCrowdfundForkedTest is SetupPartyHelper {
tokenOpts.numTokensForDistribution = 5e4 ether;
tokenOpts.numTokensForRecipient = 5e4 ether;
tokenOpts.numTokensForLP = 1e4 - 1; // Too low
tokenOpts.lpFeeRecipient = launchCrowdfundImpl.PARTY_ADDRESS_KEY();

vm.expectRevert(ERC20LaunchCrowdfund.InvalidTokenDistribution.selector);
ERC20LaunchCrowdfund launchCrowdfund = crowdfundFactory.createERC20LaunchCrowdfund(
Expand Down Expand Up @@ -234,6 +237,7 @@ contract ERC20LaunchCrowdfundForkedTest is SetupPartyHelper {
tokenOpts.numTokensForDistribution = 5e4 ether;
tokenOpts.numTokensForRecipient = 5e4 ether;
tokenOpts.numTokensForLP = 9e5 ether;
tokenOpts.lpFeeRecipient = launchCrowdfundImpl.PARTY_ADDRESS_KEY();

vm.expectRevert(ERC20LaunchCrowdfund.InvalidTokenDistribution.selector);
ERC20LaunchCrowdfund launchCrowdfund = crowdfundFactory.createERC20LaunchCrowdfund(
Expand Down Expand Up @@ -276,6 +280,7 @@ contract ERC20LaunchCrowdfundForkedTest is SetupPartyHelper {
tokenOpts.numTokensForDistribution = 5e4 ether;
tokenOpts.numTokensForRecipient = 5e4 ether;
tokenOpts.numTokensForLP = 9e5 ether;
tokenOpts.lpFeeRecipient = launchCrowdfundImpl.PARTY_ADDRESS_KEY();

ERC20LaunchCrowdfund launchCrowdfund = crowdfundFactory.createERC20LaunchCrowdfund(
launchCrowdfundImpl,
Expand Down Expand Up @@ -364,6 +369,7 @@ contract ERC20LaunchCrowdfundForkedTest is SetupPartyHelper {
tokenOpts.numTokensForDistribution = 5e4 ether;
tokenOpts.numTokensForRecipient = 5e4 ether;
tokenOpts.numTokensForLP = 9e5 ether;
tokenOpts.lpFeeRecipient = launchCrowdfundImpl.PARTY_ADDRESS_KEY();

ERC20LaunchCrowdfund launchCrowdfund = crowdfundFactory.createERC20LaunchCrowdfund(
launchCrowdfundImpl,
Expand Down

0 comments on commit d732e06

Please sign in to comment.