From 0735bdf62a83f0959f12d5614663b9423cce62f6 Mon Sep 17 00:00:00 2001 From: Richerd Chan Date: Mon, 19 Feb 2024 23:12:06 -0800 Subject: [PATCH 1/7] Add mint fees as config parameters to lazyclaim --- .../contracts/lazyclaim/ERC1155LazyPayableClaim.sol | 3 +-- .../contracts/lazyclaim/ERC721LazyPayableClaim.sol | 2 +- .../manifold/contracts/lazyclaim/LazyPayableClaim.sol | 10 +++++----- packages/manifold/script/ERC1155LazyPayableClaim.s.sol | 7 +++++-- packages/manifold/script/ERC721LazyPayableClaim.s.sol | 7 +++++-- .../test/lazyclaim/ERC1155LazyPayableClaim.t.sol | 9 +++++++-- .../test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol | 5 ++++- .../ERC1155LazyPayableClaimSignatureMinting.t.sol | 5 ++++- .../test/lazyclaim/ERC721LazyPayableClaim.t.sol | 9 +++++++-- .../test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol | 5 ++++- .../ERC721LazyPayableClaimSignatureMinting.t.sol | 5 ++++- 11 files changed, 47 insertions(+), 20 deletions(-) diff --git a/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol b/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol index b40d320c..5862de60 100644 --- a/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol +++ b/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol @@ -33,8 +33,7 @@ contract ERC1155LazyPayableClaim is IERC165, IERC1155LazyPayableClaim, ICreatorE interfaceId == type(IERC165).interfaceId; } - constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2) LazyPayableClaim(initialOwner, delegationRegistry, delegationRegistryV2) {} - + constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2, uint256 mintFee, uint256 mintFeeMerkle) LazyPayableClaim(initialOwner, delegationRegistry, delegationRegistryV2, mintFee, mintFeeMerkle) {} /** * See {IERC1155LazyClaim-initializeClaim}. */ diff --git a/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol b/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol index 0fc14067..35ddd999 100644 --- a/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol +++ b/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol @@ -47,7 +47,7 @@ contract ERC721LazyPayableClaim is IERC165, IERC721LazyPayableClaim, ICreatorExt interfaceId == type(IERC165).interfaceId; } - constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2) LazyPayableClaim(initialOwner, delegationRegistry, delegationRegistryV2) {} + constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2, uint256 mintFee, uint256 mintFeeMerkle) LazyPayableClaim(initialOwner, delegationRegistry, delegationRegistryV2, mintFee, mintFeeMerkle) {} /** * See {IERC721LazyClaim-initializeClaim}. diff --git a/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol b/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol index dd897081..5d98df05 100644 --- a/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol +++ b/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol @@ -39,9 +39,8 @@ abstract contract LazyPayableClaim is ILazyPayableClaim, AdminControl { // solhint-disable-next-line address public immutable DELEGATION_REGISTRY_V2; - uint256 public constant MINT_FEE = 500000000000000; - uint256 public constant MINT_FEE_MERKLE = 690000000000000; - // solhint-disable-next-line + uint256 public immutable MINT_FEE; + uint256 public immutable MINT_FEE_MERKLE; address public MEMBERSHIP_ADDRESS; uint256 internal constant MAX_UINT_24 = 0xffffff; @@ -72,12 +71,13 @@ abstract contract LazyPayableClaim is ILazyPayableClaim, AdminControl { _; } - constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2) { + constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2, uint256 mintFee, uint256 mintFeeMerkle) { _transferOwnership(initialOwner); DELEGATION_REGISTRY = delegationRegistry; DELEGATION_REGISTRY_V2 = delegationRegistryV2; + MINT_FEE = mintFee; + MINT_FEE_MERKLE = mintFeeMerkle; } - /** * See {ILazyPayableClaim-withdraw}. */ diff --git a/packages/manifold/script/ERC1155LazyPayableClaim.s.sol b/packages/manifold/script/ERC1155LazyPayableClaim.s.sol index d6ad1edc..a3a56247 100644 --- a/packages/manifold/script/ERC1155LazyPayableClaim.s.sol +++ b/packages/manifold/script/ERC1155LazyPayableClaim.s.sol @@ -20,6 +20,9 @@ import "../contracts/lazyclaim/ERC1155LazyPayableClaim.sol"; address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + function run() external { // address initialOwner = ; // uncomment this and put in your wallet on goerli address initialOwner = vm.envAddress("INITIAL_OWNER"); // comment this out on goerli @@ -34,8 +37,8 @@ import "../contracts/lazyclaim/ERC1155LazyPayableClaim.sol"; uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); // comment this out when testing on goerli vm.startBroadcast(deployerPrivateKey); // forge script scripts/ERC1155LazyPayableClaim.s.sol --optimizer-runs 1000 --rpc-url --broadcast - // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC1155LazyPayableClaim.sol:ERC1155LazyPayableClaim --constructor-args $(cast abi-encode "constructor(address,address,address)" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493") --watch - new ERC1155LazyPayableClaim{salt: 0x455243313135354c617a7950617961626c65436c61696d455243313135354c61}(initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2); + // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC1155LazyPayableClaim.sol:ERC1155LazyPayableClaim --constructor-args $(cast abi-encode "constructor(address,address,address,uint256,uint256)" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493" "500000000000000" "690000000000000") --watch + new ERC1155LazyPayableClaim{salt: 0x455243313135354c617a7950617961626c65436c61696d455243313135354c61}(initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2, MINT_FEE, MINT_FEE_MERKLE); vm.stopBroadcast(); } } \ No newline at end of file diff --git a/packages/manifold/script/ERC721LazyPayableClaim.s.sol b/packages/manifold/script/ERC721LazyPayableClaim.s.sol index 16737437..58e63a31 100644 --- a/packages/manifold/script/ERC721LazyPayableClaim.s.sol +++ b/packages/manifold/script/ERC721LazyPayableClaim.s.sol @@ -20,6 +20,9 @@ contract DeployERC721LazyPayableClaim is Script { address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + function run() external { // address initialOwner = ; // uncomment this and put in your wallet on goerli address initialOwner = vm.envAddress("INITIAL_OWNER"); // comment this out on goerli @@ -34,8 +37,8 @@ contract DeployERC721LazyPayableClaim is Script { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); // comment this out when testing on goerli vm.startBroadcast(deployerPrivateKey); // forge script scripts/ERC721LazyPayableClaim.s.sol --optimizer-runs 1000 --rpc-url --broadcast - // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC721LazyPayableClaim.sol:ERC721LazyPayableClaim --constructor-args $(cast abi-encode "constructor(address,address,address)" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493") --watch - new ERC721LazyPayableClaim{salt: 0x4552433732314c617a7950617961626c65436c61696d4552433732314c617a79}(initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2); + // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC721LazyPayableClaim.sol:ERC721LazyPayableClaim --constructor-args $(cast abi-encode "constructor(address,address,address)" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493" "500000000000000" "690000000000000") --watch + new ERC721LazyPayableClaim{salt: 0x4552433732314c617a7950617961626c65436c61696d4552433732314c617a79}(initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2, MINT_FEE, MINT_FEE_MERKLE); vm.stopBroadcast(); } } \ No newline at end of file diff --git a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol index ab5792ab..0b04e320 100644 --- a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol +++ b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol @@ -23,6 +23,9 @@ contract ERC1155LazyPayableClaimTest is Test { address public other2 = 0x80AAC46bbd3C2FcE33681541a52CacBEd14bF425; address public other3 = 0x5174cD462b60c536eb51D4ceC1D561D3Ea31004F; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + address public zeroAddress = address(0); function setUp() public { @@ -30,7 +33,7 @@ contract ERC1155LazyPayableClaimTest is Test { creatorCore = new ERC1155Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2)); + example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); @@ -941,7 +944,9 @@ contract ERC1155LazyPayableClaimTest is Test { ERC1155LazyPayableClaim claim = new ERC1155LazyPayableClaim( address(creatorCore), address(0x00000000000076A84feF008CDAbe6409d2FE638B), - address(0x00000000000000447e69651d841bD8D104Bed493) + address(0x00000000000000447e69651d841bD8D104Bed493), + MINT_FEE, + MINT_FEE_MERKLE ); address onChainAddress = claim.DELEGATION_REGISTRY(); assertEq(0x00000000000076A84feF008CDAbe6409d2FE638B, onChainAddress); diff --git a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol index 01a64149..c6e0bc43 100644 --- a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol +++ b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol @@ -24,6 +24,9 @@ contract ERC1155LazyPayableClaimERC20Test is Test { address public other2 = 0x80AAC46bbd3C2FcE33681541a52CacBEd14bF425; address public other3 = 0x5174cD462b60c536eb51D4ceC1D561D3Ea31004F; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + address public zeroAddress = address(0); function setUp() public { @@ -31,7 +34,7 @@ contract ERC1155LazyPayableClaimERC20Test is Test { creatorCore = new ERC1155Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2)); + example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); diff --git a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol index 25303b92..e6850b0f 100644 --- a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol +++ b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol @@ -27,6 +27,9 @@ contract ERC1155LazyPayableClaimSignatureMintingTest is Test { address public other2 = 0x80AAC46bbd3C2FcE33681541a52CacBEd14bF425; address public other3 = 0x5174cD462b60c536eb51D4ceC1D561D3Ea31004F; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + address public signingAddress; uint256 privateKey = 0x1010101010101010101010101010101010101010101010101010101010101010; @@ -40,7 +43,7 @@ contract ERC1155LazyPayableClaimSignatureMintingTest is Test { delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); example = new ERC1155LazyPayableClaim( - owner, address(delegationRegistry), address(delegationRegistryV2) + owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE ); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); diff --git a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol index c2b38a30..5b570f8c 100644 --- a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol +++ b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol @@ -23,6 +23,9 @@ contract ERC721LazyPayableClaimTest is Test { address public other2 = 0x80AAC46bbd3C2FcE33681541a52CacBEd14bF425; address public other3 = 0x5174cD462b60c536eb51D4ceC1D561D3Ea31004F; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + address public zeroAddress = address(0); function setUp() public { @@ -30,7 +33,7 @@ contract ERC721LazyPayableClaimTest is Test { creatorCore = new ERC721Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2)); + example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); @@ -959,7 +962,9 @@ contract ERC721LazyPayableClaimTest is Test { ERC721LazyPayableClaim claim = new ERC721LazyPayableClaim( address(creatorCore), address(0x00000000000076A84feF008CDAbe6409d2FE638B), - address(0x00000000000000447e69651d841bD8D104Bed493) + address(0x00000000000000447e69651d841bD8D104Bed493), + MINT_FEE, + MINT_FEE_MERKLE ); address onChainAddress = claim.DELEGATION_REGISTRY(); assertEq(0x00000000000076A84feF008CDAbe6409d2FE638B, onChainAddress); diff --git a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol index 28c025c8..229ca8ee 100644 --- a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol +++ b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol @@ -24,6 +24,9 @@ contract ERC721LazyPayableClaimERC20Test is Test { address public other2 = 0x80AAC46bbd3C2FcE33681541a52CacBEd14bF425; address public other3 = 0x5174cD462b60c536eb51D4ceC1D561D3Ea31004F; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + address public zeroAddress = address(0); function setUp() public { @@ -31,7 +34,7 @@ contract ERC721LazyPayableClaimERC20Test is Test { creatorCore = new ERC721Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2)); + example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); diff --git a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol index 27940875..7123ee62 100644 --- a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol +++ b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol @@ -27,6 +27,9 @@ contract ERC721LazyPayableClaimSignatureMintingTest is Test { address public other2 = 0x80AAC46bbd3C2FcE33681541a52CacBEd14bF425; address public other3 = 0x5174cD462b60c536eb51D4ceC1D561D3Ea31004F; + uint256 MINT_FEE = 500000000000000; + uint256 MINT_FEE_MERKLE = 690000000000000; + address public signingAddress; uint256 privateKey = 0x1010101010101010101010101010101010101010101010101010101010101010; @@ -40,7 +43,7 @@ contract ERC721LazyPayableClaimSignatureMintingTest is Test { delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); example = new ERC721LazyPayableClaim( - owner, address(delegationRegistry), address(delegationRegistryV2) + owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE ); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); From c9bda344c573edd433a5b46e1f4142082719059b Mon Sep 17 00:00:00 2001 From: Richerd Chan Date: Mon, 19 Feb 2024 23:24:36 -0800 Subject: [PATCH 2/7] updated ci node version from 16 to 18 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8c8ee59..bb2556a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,10 +20,10 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Set Node to v16 + - name: Set Node to v18 uses: actions/setup-node@v2 with: - node-version: "16" + node-version: "18" - name: Install truffle run: | From 829297bfaebb4bce69dc21cfb6306f20fd8ef0f2 Mon Sep 17 00:00:00 2001 From: Richerd Chan Date: Mon, 19 Feb 2024 23:30:14 -0800 Subject: [PATCH 3/7] update node version to 18 for build-forge in ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb2556a6..284eb85c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,10 +71,10 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Set Node to v16 + - name: Set Node to v18 uses: actions/setup-node@v2 with: - node-version: "16" + node-version: "18" - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 From f643cbd447e0a54e305c37c1d8c517f8c3f647a3 Mon Sep 17 00:00:00 2001 From: Richerd Chan Date: Mon, 19 Feb 2024 23:33:27 -0800 Subject: [PATCH 4/7] add back in sol-hint disable to LazyPayableClaim --- packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol b/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol index 5d98df05..10b42926 100644 --- a/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol +++ b/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol @@ -41,6 +41,7 @@ abstract contract LazyPayableClaim is ILazyPayableClaim, AdminControl { uint256 public immutable MINT_FEE; uint256 public immutable MINT_FEE_MERKLE; + // solhint-disable-next-line address public MEMBERSHIP_ADDRESS; uint256 internal constant MAX_UINT_24 = 0xffffff; From b7b303b0da76d3be0c7b81c4d7d4d70662a087cb Mon Sep 17 00:00:00 2001 From: Richerd Chan Date: Tue, 20 Feb 2024 07:54:48 -0800 Subject: [PATCH 5/7] moved mint fee params to first params to follow convention of static variables first --- .../contracts/lazyclaim/ERC1155LazyPayableClaim.sol | 2 +- .../contracts/lazyclaim/ERC721LazyPayableClaim.sol | 2 +- .../manifold/contracts/lazyclaim/LazyPayableClaim.sol | 6 +++--- packages/manifold/script/ERC1155LazyPayableClaim.s.sol | 10 +++++----- packages/manifold/script/ERC721LazyPayableClaim.s.sol | 10 +++++----- .../test/lazyclaim/ERC1155LazyPayableClaim.t.sol | 8 ++++---- .../test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol | 2 +- .../ERC1155LazyPayableClaimSignatureMinting.t.sol | 2 +- .../test/lazyclaim/ERC721LazyPayableClaim.t.sol | 8 ++++---- .../test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol | 2 +- .../ERC721LazyPayableClaimSignatureMinting.t.sol | 2 +- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol b/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol index 5862de60..5469106b 100644 --- a/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol +++ b/packages/manifold/contracts/lazyclaim/ERC1155LazyPayableClaim.sol @@ -33,7 +33,7 @@ contract ERC1155LazyPayableClaim is IERC165, IERC1155LazyPayableClaim, ICreatorE interfaceId == type(IERC165).interfaceId; } - constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2, uint256 mintFee, uint256 mintFeeMerkle) LazyPayableClaim(initialOwner, delegationRegistry, delegationRegistryV2, mintFee, mintFeeMerkle) {} + constructor(uint256 mintFee, uint256 mintFeeMerkle, address initialOwner, address delegationRegistry, address delegationRegistryV2) LazyPayableClaim(mintFee, mintFeeMerkle, initialOwner, delegationRegistry, delegationRegistryV2) {} /** * See {IERC1155LazyClaim-initializeClaim}. */ diff --git a/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol b/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol index 35ddd999..fda636e0 100644 --- a/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol +++ b/packages/manifold/contracts/lazyclaim/ERC721LazyPayableClaim.sol @@ -47,7 +47,7 @@ contract ERC721LazyPayableClaim is IERC165, IERC721LazyPayableClaim, ICreatorExt interfaceId == type(IERC165).interfaceId; } - constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2, uint256 mintFee, uint256 mintFeeMerkle) LazyPayableClaim(initialOwner, delegationRegistry, delegationRegistryV2, mintFee, mintFeeMerkle) {} + constructor(uint256 mintFee, uint256 mintFeeMerkle, address initialOwner, address delegationRegistry, address delegationRegistryV2) LazyPayableClaim(mintFee, mintFeeMerkle, initialOwner, delegationRegistry, delegationRegistryV2) {} /** * See {IERC721LazyClaim-initializeClaim}. diff --git a/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol b/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol index 10b42926..5b6e9a23 100644 --- a/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol +++ b/packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol @@ -72,12 +72,12 @@ abstract contract LazyPayableClaim is ILazyPayableClaim, AdminControl { _; } - constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2, uint256 mintFee, uint256 mintFeeMerkle) { + constructor(uint256 mintFee, uint256 mintFeeMerkle, address initialOwner, address delegationRegistry, address delegationRegistryV2) { + MINT_FEE = mintFee; + MINT_FEE_MERKLE = mintFeeMerkle; _transferOwnership(initialOwner); DELEGATION_REGISTRY = delegationRegistry; DELEGATION_REGISTRY_V2 = delegationRegistryV2; - MINT_FEE = mintFee; - MINT_FEE_MERKLE = mintFeeMerkle; } /** * See {ILazyPayableClaim-withdraw}. diff --git a/packages/manifold/script/ERC1155LazyPayableClaim.s.sol b/packages/manifold/script/ERC1155LazyPayableClaim.s.sol index a3a56247..d97d0eb5 100644 --- a/packages/manifold/script/ERC1155LazyPayableClaim.s.sol +++ b/packages/manifold/script/ERC1155LazyPayableClaim.s.sol @@ -17,12 +17,12 @@ import "../contracts/lazyclaim/ERC1155LazyPayableClaim.sol"; to expose your personal pk to your mac's environment variable or anything. */ contract DeployERC1155LazyPayableClaim is Script { - address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; - address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; - uint256 MINT_FEE = 500000000000000; uint256 MINT_FEE_MERKLE = 690000000000000; + address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; + address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; + function run() external { // address initialOwner = ; // uncomment this and put in your wallet on goerli address initialOwner = vm.envAddress("INITIAL_OWNER"); // comment this out on goerli @@ -37,8 +37,8 @@ import "../contracts/lazyclaim/ERC1155LazyPayableClaim.sol"; uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); // comment this out when testing on goerli vm.startBroadcast(deployerPrivateKey); // forge script scripts/ERC1155LazyPayableClaim.s.sol --optimizer-runs 1000 --rpc-url --broadcast - // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC1155LazyPayableClaim.sol:ERC1155LazyPayableClaim --constructor-args $(cast abi-encode "constructor(address,address,address,uint256,uint256)" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493" "500000000000000" "690000000000000") --watch - new ERC1155LazyPayableClaim{salt: 0x455243313135354c617a7950617961626c65436c61696d455243313135354c61}(initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2, MINT_FEE, MINT_FEE_MERKLE); + // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC1155LazyPayableClaim.sol:ERC1155LazyPayableClaim --constructor-args $(cast abi-encode "constructor(uint256,uint256,address,address,address,)" "500000000000000" "690000000000000" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493") --watch + new ERC1155LazyPayableClaim{salt: 0x455243313135354c617a7950617961626c65436c61696d455243313135354c61}(MINT_FEE, MINT_FEE_MERKLE, initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2); vm.stopBroadcast(); } } \ No newline at end of file diff --git a/packages/manifold/script/ERC721LazyPayableClaim.s.sol b/packages/manifold/script/ERC721LazyPayableClaim.s.sol index 58e63a31..a80afdc6 100644 --- a/packages/manifold/script/ERC721LazyPayableClaim.s.sol +++ b/packages/manifold/script/ERC721LazyPayableClaim.s.sol @@ -17,11 +17,11 @@ import "../contracts/lazyclaim/ERC721LazyPayableClaim.sol"; to expose your personal pk to your mac's environment variable or anything. */ contract DeployERC721LazyPayableClaim is Script { - address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; - address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; - uint256 MINT_FEE = 500000000000000; uint256 MINT_FEE_MERKLE = 690000000000000; + + address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; + address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; function run() external { // address initialOwner = ; // uncomment this and put in your wallet on goerli @@ -37,8 +37,8 @@ contract DeployERC721LazyPayableClaim is Script { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); // comment this out when testing on goerli vm.startBroadcast(deployerPrivateKey); // forge script scripts/ERC721LazyPayableClaim.s.sol --optimizer-runs 1000 --rpc-url --broadcast - // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC721LazyPayableClaim.sol:ERC721LazyPayableClaim --constructor-args $(cast abi-encode "constructor(address,address,address)" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493" "500000000000000" "690000000000000") --watch - new ERC721LazyPayableClaim{salt: 0x4552433732314c617a7950617961626c65436c61696d4552433732314c617a79}(initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2, MINT_FEE, MINT_FEE_MERKLE); + // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC721LazyPayableClaim.sol:ERC721LazyPayableClaim --constructor-args $(cast abi-encode "constructor(uint256, uint256, address,address,address)" "500000000000000" "690000000000000", "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493") --watch + new ERC721LazyPayableClaim{salt: 0x4552433732314c617a7950617961626c65436c61696d4552433732314c617a79}(MINT_FEE, MINT_FEE_MERKLE, initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2); vm.stopBroadcast(); } } \ No newline at end of file diff --git a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol index 0b04e320..5d3dbc16 100644 --- a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol +++ b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaim.t.sol @@ -33,7 +33,7 @@ contract ERC1155LazyPayableClaimTest is Test { creatorCore = new ERC1155Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); + example = new ERC1155LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2)); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); @@ -942,11 +942,11 @@ contract ERC1155LazyPayableClaimTest is Test { vm.startPrank(owner); ERC1155LazyPayableClaim claim = new ERC1155LazyPayableClaim( + MINT_FEE, + MINT_FEE_MERKLE, address(creatorCore), address(0x00000000000076A84feF008CDAbe6409d2FE638B), - address(0x00000000000000447e69651d841bD8D104Bed493), - MINT_FEE, - MINT_FEE_MERKLE + address(0x00000000000000447e69651d841bD8D104Bed493) ); address onChainAddress = claim.DELEGATION_REGISTRY(); assertEq(0x00000000000076A84feF008CDAbe6409d2FE638B, onChainAddress); diff --git a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol index c6e0bc43..5a110324 100644 --- a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol +++ b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimERC20.t.sol @@ -34,7 +34,7 @@ contract ERC1155LazyPayableClaimERC20Test is Test { creatorCore = new ERC1155Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); + example = new ERC1155LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2)); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); diff --git a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol index e6850b0f..c6fd6fde 100644 --- a/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol +++ b/packages/manifold/test/lazyclaim/ERC1155LazyPayableClaimSignatureMinting.t.sol @@ -43,7 +43,7 @@ contract ERC1155LazyPayableClaimSignatureMintingTest is Test { delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); example = new ERC1155LazyPayableClaim( - owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE + MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2) ); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); diff --git a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol index 5b570f8c..d6b653cc 100644 --- a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol +++ b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaim.t.sol @@ -33,7 +33,7 @@ contract ERC721LazyPayableClaimTest is Test { creatorCore = new ERC721Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); + example = new ERC721LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2)); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); @@ -960,11 +960,11 @@ contract ERC721LazyPayableClaimTest is Test { vm.startPrank(owner); ERC721LazyPayableClaim claim = new ERC721LazyPayableClaim( + MINT_FEE, + MINT_FEE_MERKLE, address(creatorCore), address(0x00000000000076A84feF008CDAbe6409d2FE638B), - address(0x00000000000000447e69651d841bD8D104Bed493), - MINT_FEE, - MINT_FEE_MERKLE + address(0x00000000000000447e69651d841bD8D104Bed493) ); address onChainAddress = claim.DELEGATION_REGISTRY(); assertEq(0x00000000000076A84feF008CDAbe6409d2FE638B, onChainAddress); diff --git a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol index 229ca8ee..a1167090 100644 --- a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol +++ b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimERC20.t.sol @@ -34,7 +34,7 @@ contract ERC721LazyPayableClaimERC20Test is Test { creatorCore = new ERC721Creator("Token", "NFT"); delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); - example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE); + example = new ERC721LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2)); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); diff --git a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol index 7123ee62..86b73bd0 100644 --- a/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol +++ b/packages/manifold/test/lazyclaim/ERC721LazyPayableClaimSignatureMinting.t.sol @@ -43,7 +43,7 @@ contract ERC721LazyPayableClaimSignatureMintingTest is Test { delegationRegistry = new DelegationRegistry(); delegationRegistryV2 = new DelegationRegistryV2(); example = new ERC721LazyPayableClaim( - owner, address(delegationRegistry), address(delegationRegistryV2), MINT_FEE, MINT_FEE_MERKLE + MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2) ); manifoldMembership = new MockManifoldMembership(); example.setMembershipAddress(address(manifoldMembership)); From b3fd18402ebd5fc1be9b04d27c4e7f118f3734ce Mon Sep 17 00:00:00 2001 From: Richerd Chan Date: Tue, 20 Feb 2024 08:20:20 -0800 Subject: [PATCH 6/7] updated deployscripts for lazy payable claim to hardcode fees based on network deploy --- .../manifold/script/ERC1155LazyPayableClaim.s.sol | 9 +++++++++ .../manifold/script/ERC721LazyPayableClaim.s.sol | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/manifold/script/ERC1155LazyPayableClaim.s.sol b/packages/manifold/script/ERC1155LazyPayableClaim.s.sol index d97d0eb5..21ae5fc9 100644 --- a/packages/manifold/script/ERC1155LazyPayableClaim.s.sol +++ b/packages/manifold/script/ERC1155LazyPayableClaim.s.sol @@ -20,10 +20,19 @@ import "../contracts/lazyclaim/ERC1155LazyPayableClaim.sol"; uint256 MINT_FEE = 500000000000000; uint256 MINT_FEE_MERKLE = 690000000000000; + uint256 MATIC_MINT_FEE = 1000000000000000000; + uint256 MATIC_MINT_FEE_MERKLE = 1100000000000000000; + address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; function run() external { + uint256 networkId = vm.envUint("NETWORK_ID"); + if (networkId == 137) { // Polygon network + MINT_FEE = MATIC_MINT_FEE; + MINT_FEE_MERKLE = MATIC_MINT_FEE_MERKLE; + } + // address initialOwner = ; // uncomment this and put in your wallet on goerli address initialOwner = vm.envAddress("INITIAL_OWNER"); // comment this out on goerli diff --git a/packages/manifold/script/ERC721LazyPayableClaim.s.sol b/packages/manifold/script/ERC721LazyPayableClaim.s.sol index a80afdc6..cc78d662 100644 --- a/packages/manifold/script/ERC721LazyPayableClaim.s.sol +++ b/packages/manifold/script/ERC721LazyPayableClaim.s.sol @@ -20,10 +20,19 @@ contract DeployERC721LazyPayableClaim is Script { uint256 MINT_FEE = 500000000000000; uint256 MINT_FEE_MERKLE = 690000000000000; + uint256 MATIC_MINT_FEE = 1000000000000000000; + uint256 MATIC_MINT_FEE_MERKLE = 1100000000000000000; + address DELEGATION_REGISTRY = 0x00000000000076A84feF008CDAbe6409d2FE638B; address DELEGATION_REGISTRY_V2 = 0x00000000000000447e69651d841bD8D104Bed493; - + function run() external { + uint256 networkId = vm.envUint("NETWORK_ID"); + if (networkId == 137) { // Polygon network + MINT_FEE = MATIC_MINT_FEE; + MINT_FEE_MERKLE = MATIC_MINT_FEE_MERKLE; + } + // address initialOwner = ; // uncomment this and put in your wallet on goerli address initialOwner = vm.envAddress("INITIAL_OWNER"); // comment this out on goerli @@ -37,8 +46,8 @@ contract DeployERC721LazyPayableClaim is Script { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); // comment this out when testing on goerli vm.startBroadcast(deployerPrivateKey); // forge script scripts/ERC721LazyPayableClaim.s.sol --optimizer-runs 1000 --rpc-url --broadcast - // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC721LazyPayableClaim.sol:ERC721LazyPayableClaim --constructor-args $(cast abi-encode "constructor(uint256, uint256, address,address,address)" "500000000000000" "690000000000000", "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493") --watch + // forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli contracts/lazyclaim/ERC721LazyPayableClaim.sol:ERC721LazyPayableClaim --constructor-args $(cast abi-encode "constructor(uint256,uint256,address,address,address)" "500000000000000" "690000000000000" "${INITIAL_OWNER}" "0x00000000000076A84feF008CDAbe6409d2FE638B" "0x00000000000000447e69651d841bD8D104Bed493") --watch new ERC721LazyPayableClaim{salt: 0x4552433732314c617a7950617961626c65436c61696d4552433732314c617a79}(MINT_FEE, MINT_FEE_MERKLE, initialOwner, DELEGATION_REGISTRY, DELEGATION_REGISTRY_V2); vm.stopBroadcast(); } -} \ No newline at end of file +} From 79c34cc4512debc1132c14bbffb702a7eb61bd6d Mon Sep 17 00:00:00 2001 From: Richerd Chan Date: Tue, 20 Feb 2024 10:40:44 -0800 Subject: [PATCH 7/7] bump node version for ci to 20 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 284eb85c..5f0140e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,10 +20,10 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Set Node to v18 + - name: Set Node to v20 uses: actions/setup-node@v2 with: - node-version: "18" + node-version: "20" - name: Install truffle run: | @@ -71,10 +71,10 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Set Node to v18 + - name: Set Node to v20 uses: actions/setup-node@v2 with: - node-version: "18" + node-version: "20" - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1