Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mint Fees as config param to claims #81

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 v20
uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "20"

- name: Install truffle
run: |
Expand Down Expand Up @@ -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 v20
uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "20"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(uint256 mintFee, uint256 mintFeeMerkle, address initialOwner, address delegationRegistry, address delegationRegistryV2) LazyPayableClaim(mintFee, mintFeeMerkle, initialOwner, delegationRegistry, delegationRegistryV2) {}
/**
* See {IERC1155LazyClaim-initializeClaim}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(uint256 mintFee, uint256 mintFeeMerkle, address initialOwner, address delegationRegistry, address delegationRegistryV2) LazyPayableClaim(mintFee, mintFeeMerkle, initialOwner, delegationRegistry, delegationRegistryV2) {}

/**
* See {IERC721LazyClaim-initializeClaim}.
Expand Down
9 changes: 5 additions & 4 deletions packages/manifold/contracts/lazyclaim/LazyPayableClaim.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +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;
uint256 public immutable MINT_FEE;
uint256 public immutable MINT_FEE_MERKLE;
// solhint-disable-next-line
address public MEMBERSHIP_ADDRESS;

Expand Down Expand Up @@ -72,12 +72,13 @@ abstract contract LazyPayableClaim is ILazyPayableClaim, AdminControl {
_;
}

constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2) {
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;
}

/**
* See {ILazyPayableClaim-withdraw}.
*/
Expand Down
16 changes: 14 additions & 2 deletions packages/manifold/script/ERC1155LazyPayableClaim.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ import "../contracts/lazyclaim/ERC1155LazyPayableClaim.sol";
to expose your personal pk to your mac's environment variable or anything.
*/
contract DeployERC1155LazyPayableClaim 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 = <your wallet address>; // uncomment this and put in your wallet on goerli
address initialOwner = vm.envAddress("INITIAL_OWNER"); // comment this out on goerli

Expand All @@ -34,8 +46,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 <YOUR_NODE> --broadcast
// forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli <DEPLOYED_ADDRESS> 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 <DEPLOYED_ADDRESS> 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();
}
}
18 changes: 15 additions & 3 deletions packages/manifold/script/ERC721LazyPayableClaim.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ import "../contracts/lazyclaim/ERC721LazyPayableClaim.sol";
to expose your personal pk to your mac's environment variable or anything.
*/
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 = <your wallet address>; // uncomment this and put in your wallet on goerli
address initialOwner = vm.envAddress("INITIAL_OWNER"); // comment this out on goerli

Expand All @@ -34,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 <YOUR_NODE> --broadcast
// forge verify-contract --compiler-version 0.8.17 --optimizer-runs 1000 --chain goerli <DEPLOYED_ADDRESS> 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 <DEPLOYED_ADDRESS> 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();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ 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 {
vm.startPrank(owner);
creatorCore = new ERC1155Creator("Token", "NFT");
delegationRegistry = new DelegationRegistry();
delegationRegistryV2 = new DelegationRegistryV2();
example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2));
example = new ERC1155LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2));
manifoldMembership = new MockManifoldMembership();
example.setMembershipAddress(address(manifoldMembership));

Expand Down Expand Up @@ -939,6 +942,8 @@ contract ERC1155LazyPayableClaimTest is Test {
vm.startPrank(owner);

ERC1155LazyPayableClaim claim = new ERC1155LazyPayableClaim(
MINT_FEE,
MINT_FEE_MERKLE,
address(creatorCore),
address(0x00000000000076A84feF008CDAbe6409d2FE638B),
address(0x00000000000000447e69651d841bD8D104Bed493)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ 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 {
vm.startPrank(owner);
creatorCore = new ERC1155Creator("Token", "NFT");
delegationRegistry = new DelegationRegistry();
delegationRegistryV2 = new DelegationRegistryV2();
example = new ERC1155LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2));
example = new ERC1155LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2));
manifoldMembership = new MockManifoldMembership();
example.setMembershipAddress(address(manifoldMembership));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,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, owner, address(delegationRegistry), address(delegationRegistryV2)
);
manifoldMembership = new MockManifoldMembership();
example.setMembershipAddress(address(manifoldMembership));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ 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 {
vm.startPrank(owner);
creatorCore = new ERC721Creator("Token", "NFT");
delegationRegistry = new DelegationRegistry();
delegationRegistryV2 = new DelegationRegistryV2();
example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2));
example = new ERC721LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2));
manifoldMembership = new MockManifoldMembership();
example.setMembershipAddress(address(manifoldMembership));

Expand Down Expand Up @@ -957,6 +960,8 @@ contract ERC721LazyPayableClaimTest is Test {
vm.startPrank(owner);

ERC721LazyPayableClaim claim = new ERC721LazyPayableClaim(
MINT_FEE,
MINT_FEE_MERKLE,
address(creatorCore),
address(0x00000000000076A84feF008CDAbe6409d2FE638B),
address(0x00000000000000447e69651d841bD8D104Bed493)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ 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 {
vm.startPrank(owner);
creatorCore = new ERC721Creator("Token", "NFT");
delegationRegistry = new DelegationRegistry();
delegationRegistryV2 = new DelegationRegistryV2();
example = new ERC721LazyPayableClaim(owner, address(delegationRegistry), address(delegationRegistryV2));
example = new ERC721LazyPayableClaim(MINT_FEE, MINT_FEE_MERKLE, owner, address(delegationRegistry), address(delegationRegistryV2));
manifoldMembership = new MockManifoldMembership();
example.setMembershipAddress(address(manifoldMembership));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,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, owner, address(delegationRegistry), address(delegationRegistryV2)
);
manifoldMembership = new MockManifoldMembership();
example.setMembershipAddress(address(manifoldMembership));
Expand Down
Loading