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

Premint: first minter rewards #162

Merged
merged 13 commits into from
Sep 14, 2023
Merged

Premint: first minter rewards #162

merged 13 commits into from
Sep 14, 2023

Conversation

oveddan
Copy link
Collaborator

@oveddan oveddan commented Sep 11, 2023

No description provided.

@oveddan
Copy link
Collaborator Author

oveddan commented Sep 11, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link
Collaborator Author

@oveddan oveddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could do this also with gt upstack restack then it restacks your branches' changes on top of the premint branch

Copy link
Collaborator Author

@oveddan oveddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add test that shows: first minter gets rewards on multiple mints from different minters

src/nft/ZoraCreator1155Impl.sol Outdated Show resolved Hide resolved
@kulkarohan
Copy link
Contributor

can you please add test that shows: first minter gets rewards on multiple mints from different minters

https://github.com/ourzora/zora-1155-contracts/pull/162/files#diff-4351e9f1c8712bdd84b0b795fa32bc3f4b01e309cf2b3aeb21d789bef6279cd2R969-R999

Copy link
Collaborator Author

@oveddan oveddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great improvements and nice new test coverage


uint256 maxQuantity = 10;
uint256 pricePerToken = 1000000000000000000;
uint256 pricePerToken = 1 ether;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice change here to these units

@@ -963,6 +966,66 @@ contract ZoraCreator1155Test is Test {
target.mintWithRewards(fixedPriceMinter, tokenId, quantity, abi.encode(recipient), address(0));
}

function test_FirstMinterRewardReceivedOnConsecutiveMints(uint256 quantity) public {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome test!


// Execute commands returned from minter
_executeCommands(minter.requestMint(msg.sender, tokenId, quantity, ethValueSent, minterArguments).commands, ethValueSent, tokenId);

emit Purchased(msg.sender, address(minter), tokenId, quantity, msg.value);
}

/// @dev Get and/or set the first minter a token
function _handleFirstMinter(uint256 tokenId, bytes calldata data) internal returns (address) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor (and optional improvement) - for readability, having returns (address firstMinter) would be clearer.

@oveddan
Copy link
Collaborator Author

oveddan commented Sep 13, 2023

Looks like test coverage went down to 69.5% - maybe some tests were deleted?

@oveddan
Copy link
Collaborator Author

oveddan commented Sep 13, 2023

todo:

  • fix test coverage
  • fix fork tests

oveddan added a commit that referenced this pull request Sep 19, 2023
* refactor: remove legacy mint fee contracts

* refactor: remove unusued import

* chore: update tests

* chore: lint

* chore: update runs

* chore: update storage layout

* style: update natspec

* chore: update tests

* chore: remove unused var

* chore: update tests

* fix: move hardcoded fork vars to constants

* added first minter changeset

* * Added changeset that depreates redeem minters.
* Remove Redeem minter from coverage.

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
oveddan added a commit that referenced this pull request Sep 20, 2023
* refactor: remove legacy mint fee contracts

* refactor: remove unusued import

* chore: update tests

* chore: lint

* chore: update runs

* chore: update storage layout

* style: update natspec

* chore: update tests

* chore: remove unused var

* chore: update tests

* fix: move hardcoded fork vars to constants

* added first minter changeset

* * Added changeset that depreates redeem minters.
* Remove Redeem minter from coverage.

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
oveddan added a commit that referenced this pull request Sep 21, 2023
* refactor: remove legacy mint fee contracts

* refactor: remove unusued import

* chore: update tests

* chore: lint

* chore: update runs

* chore: update storage layout

* style: update natspec

* chore: update tests

* chore: remove unused var

* chore: update tests

* fix: move hardcoded fork vars to constants

* added first minter changeset

* * Added changeset that depreates redeem minters.
* Remove Redeem minter from coverage.

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
oveddan added a commit that referenced this pull request Sep 21, 2023
* refactor: remove legacy mint fee contracts

* refactor: remove unusued import

* chore: update tests

* chore: lint

* chore: update runs

* chore: update storage layout

* style: update natspec

* chore: update tests

* chore: remove unused var

* chore: update tests

* fix: move hardcoded fork vars to constants

* added first minter changeset

* * Added changeset that depreates redeem minters.
* Remove Redeem minter from coverage.

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
oveddan added a commit that referenced this pull request Sep 21, 2023
* refactor: remove legacy mint fee contracts

* refactor: remove unusued import

* chore: update tests

* chore: lint

* chore: update runs

* chore: update storage layout

* style: update natspec

* chore: update tests

* chore: remove unused var

* chore: update tests

* fix: move hardcoded fork vars to constants

* added first minter changeset

* * Added changeset that depreates redeem minters.
* Remove Redeem minter from coverage.

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
This was referenced Sep 21, 2023
iainnash pushed a commit that referenced this pull request Sep 26, 2023
* refactor: remove legacy mint fee contracts

* refactor: remove unusued import

* chore: update tests

* chore: lint

* chore: update runs

* chore: update storage layout

* style: update natspec

* chore: update tests

* chore: remove unused var

* chore: update tests

* fix: move hardcoded fork vars to constants

* added first minter changeset

* * Added changeset that depreates redeem minters.
* Remove Redeem minter from coverage.

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
iainnash pushed a commit that referenced this pull request Sep 27, 2023
* refactor: remove legacy mint fee contracts

* refactor: remove unusued import

* chore: update tests

* chore: lint

* chore: update runs

* chore: update storage layout

* style: update natspec

* chore: update tests

* chore: remove unused var

* chore: update tests

* fix: move hardcoded fork vars to constants

* added first minter changeset

* * Added changeset that depreates redeem minters.
* Remove Redeem minter from coverage.

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
oveddan added a commit that referenced this pull request Apr 8, 2024
MINTs contract implementation and integration with Zora Creator 1155s and the Premint Executor.

Additional improvements:
* Created a new `DeterminsticTransparentProxyDeployer` for deploying the MINTs contract, which follows the TransparentProxyDeployer upgradeability method
* Moved many contracts and entities into a new private shared package `shared-contracts` - enabling both the MINTs contract and Zora creator 1155 contract to use them.
* simplified/flattened out rewards splits calculations to save contract storage size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants