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 #161

Merged
merged 51 commits into from
Sep 29, 2023
Merged

Premint #161

merged 51 commits into from
Sep 29, 2023

Conversation

oveddan
Copy link
Collaborator

@oveddan oveddan commented Sep 7, 2023

  • Premint - delegated contract & token creation, & minting
  • First minter rewards
  • Determinstic contract addresses

@oveddan
Copy link
Collaborator Author

oveddan commented Sep 7, 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.

some minor fixes should be worked on before merging to master

@@ -0,0 +1,59 @@
# Preminter
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this should be made up to date before merging to master

}

// todo: move to its own contract
error MintNotYetStarted();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lets do this todo, and just reference IZora1155Errors.MintNotYetStarted

import {ECDSAUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/ECDSAUpgradeable.sol";
import {ZoraCreatorFixedPriceSaleStrategy} from "../minters/fixed-price/ZoraCreatorFixedPriceSaleStrategy.sol";

struct ContractCreationConfig {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this doesn't quite belong in this file, as it is primarily used to create new contracts and get a deterministic address based on these fields

import {IMinter1155} from "../interfaces/IMinter1155.sol";
import {PremintConfig, ContractCreationConfig, TokenCreationConfig, ZoraCreator1155Attribution} from "./ZoraCreator1155Attribution.sol";

/// @title Enables creation of and minting tokens on Zora1155 contracts transactions using eip-712 signatures.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

add Enjoy graphic (and inherit from it)

isNewContract = contractAddress.code.length == 0;

if (isNewContract) {
// if address doesnt exist for hash, createi t
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fix typo

return "ZORA 1155 Premint Executor";
}

// upgrade functionality
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

duplicate comment

kulkarohan and others added 16 commits September 28, 2023 20:34
* refactor: only mint if specified quantity is greater than 0

* fix tests

---------

Co-authored-by: Dan Oved <[email protected]>
* Can mine for a determinstic address for the proxy shim in a script, and have a test that shows we can determinstically deploy proxy to that address with that salt and deployer account

* wip on deploy via script. nneed to create web ui

* cleanup

* update test to work with new params :)

* deployment works now!. lets genericize stuff :)

* consolidated into one

* end to end scripting works :)

* renamed and refactored to be more usable

* Determinstic deployer scripts are more generic and can deploy and verify :)

* rename

* another rename :)

* Premint proxy deploy (#211)

* made premint executor ugparde scripts.  renamed executor to proxy

* deploy preminter impl with script, and updated the config for that chain

* Have premint proxy deploy scripts.  can deploy both now

* preminter proxy pushed

* Refactor deterministic add upgrade gate (#210)

* large refactor

* update scripts

* updates to test code

* test naming updates

* compiler run correctly

* update with new deterministic configs

* make node deps only for scripts

* Premint deploy determinstic fix tests (#213)

* fixed tests by just making it more dyanmic

* fix stack too deep error for coverage

* ignore deployment folder for coverage

* properly filter out deployment

---------

Co-authored-by: Iain Nash <[email protected]>
* fix: remove unused param names

* fix: linting
@@ -281,7 +280,7 @@ describe("ZoraCreator1155Preminter", () => {
[collectorAccount]
);

const zoraMintFee = chainConfigs[zora.id].MINT_FEE_AMOUNT;
const zoraMintFee = parseEther("0.0007");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be 0.000777?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i delete this test for now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, fixing

@oveddan oveddan merged commit 399b8e6 into main Sep 29, 2023
3 checks passed
@oveddan oveddan deleted the premint branch September 29, 2023 17:42
iainnash added a commit that referenced this pull request Jan 11, 2024
* Premint

* Add back mint fee getter (#198)

* add back mint fee getter

* add mint fee to interface

* * Updated script to deploy preminter to now deploy the proxy (#189)

* Extracted common deployment tasks to reusable helper functions
* Added script to upgrade preminter

* Premint - move premint state to its own contract (#188)

Renamed Premint folder to delegated mint

* fix: redeem minter tests

* fix: token transfer hook for single token transfers

* feat: add unit tests

* Seperate upgrade gate new contract (#204)

* wip

* wip

* fix tests

* chore: run lint & update natspec

* update storage layout

---------

Co-authored-by: Rohan Kulkarni <[email protected]>

* refactor: add helper to read uups implementation

* fix: param name casing

* refactor: use updated zora 1155 impl getter

* refactor: add helper to read uups implementation

* fix: zora 1155 impl var name

* chore: run lint

* chore: run lint

* refactor: implement first minter reward on adminMint

* chore: update runs

* refactor: remove mint fee amount deploy param

* chore: run lint

* chore: run lint

* chore: remove mint fee amount from chain configs

* chore: update fork test

* fix: use mint w rewards to gurantee mint fee amount

* Premint: updated documentation (#199)

Premint - update documentation

* move upgrade gate to initializer pattern (#209)

* move upgrade gate to initalizer pattern

* formatting

* refactor: only mint if specified quantity is greater than 0 (#212)

* refactor: only mint if specified quantity is greater than 0

* fix tests

---------

Co-authored-by: Dan Oved <[email protected]>

* Premint - factory proxy 777 deployments (#191)

* Can mine for a determinstic address for the proxy shim in a script, and have a test that shows we can determinstically deploy proxy to that address with that salt and deployer account

* wip on deploy via script. nneed to create web ui

* cleanup

* update test to work with new params :)

* deployment works now!. lets genericize stuff :)

* consolidated into one

* end to end scripting works :)

* renamed and refactored to be more usable

* Determinstic deployer scripts are more generic and can deploy and verify :)

* rename

* another rename :)

* Premint proxy deploy (#211)

* made premint executor ugparde scripts.  renamed executor to proxy

* deploy preminter impl with script, and updated the config for that chain

* Have premint proxy deploy scripts.  can deploy both now

* preminter proxy pushed

* Refactor deterministic add upgrade gate (#210)

* large refactor

* update scripts

* updates to test code

* test naming updates

* compiler run correctly

* update with new deterministic configs

* make node deps only for scripts

* Premint deploy determinstic fix tests (#213)

* fixed tests by just making it more dyanmic

* fix stack too deep error for coverage

* ignore deployment folder for coverage

* properly filter out deployment

---------

Co-authored-by: Iain Nash <[email protected]>

* update deps

* add back release command

* fix version publish

* fix contract version

* move wagmi cli to proper version

* more things in dev deps

* move all into deps

* update protocol rewards package (#226)

* fix build

* fix wagmi build

* Clean Up Transfer Hook Mock (#229)

* fix: remove unused param names

* fix: linting

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
Co-authored-by: Rohan Kulkarni <[email protected]>
Co-authored-by: Isabella Smallcombe <[email protected]>
Co-authored-by: Iain Nash <[email protected]>
Co-authored-by: Isabella Smallcombe <[email protected]>
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.

4 participants