-
Notifications
You must be signed in to change notification settings - Fork 19
[DEV-290] NFTFair Docs Update #84
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
Open
preston4896
wants to merge
6
commits into
master
Choose a base branch
from
update/NFTFair
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b14cb5a
additional networks
preston4896 a04afd0
updated vault base docs
preston4896 56f086f
added minter vault docs
preston4896 d533450
Merge branch 'master' into update/NFTFair
preston4896 3af13ba
fixed formatting
preston4896 2650fce
added polygon addresses and minter deprecation notice
preston4896 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # Minter Vault | ||
|
|
||
| :warning: **Note:** This template will be deprecated soon. We planned on adding the minting function on top of the existing FIFO and mystery box templates. At that point, this template will be removed from the Factory. | ||
|
|
||
| This vault extends the `NFTFairVaultBase` contract. However, there are several notable characteristics that set itself apart from the currently existing templates. Such differences are: | ||
|
|
||
| - The contract no longer holds pre-minted tokens, and will not accept any inbound token transfers. Calling the `onERC721Received` hook will cause a transaction to revert. | ||
| - The `ids` property of the Category object stores a list of token IDs that has been minted by the Vault. | ||
| - The `claimable_ids` property of the category object stores a list of pre-configured IDs that will be minted from the specified category. | ||
|
|
||
| --- | ||
|
|
||
| ## Workflow | ||
|
|
||
| The workflow to host a Fairdrop using this template does not deviate too far from the current workflow, except that it no longer requires the step of transferring tokens to the vault. | ||
|
|
||
| The following briefly shows the steps of setting up a Fairdrop using this template: | ||
|
|
||
| 1. Deploy a Minter vault. | ||
|
|
||
| 2. Deploy a contract that inherits either the `IERC721Mintable` or `IERC1155Mintable` interface | ||
|
|
||
| 3. Grant `MINTER_ROLE` permission to the Minter vault contract. | ||
|
|
||
| 4. Create one or more categories as usual. | ||
|
|
||
| 5. The vault is now ready to mint and distribute tokens. | ||
|
|
||
| --- | ||
|
|
||
| ## Methods | ||
|
|
||
| ### Overloaded Methods | ||
|
|
||
| The following functions inherited from the `NFTFairVaultBase` have been overloaded to accommodate the use case for this template. | ||
|
|
||
| #### `getCategoryNftIds` | ||
|
|
||
| ```solidity | ||
| function getCategoryNftIds(uint256 _category) public view override returns (uint256[] memory) | ||
| ``` | ||
|
|
||
| Returns the list of all NFT IDs belonging to the specified `_category`. This implementation is slightly different from `NFTFairVaultBase` because the `category.ids` list only contains the list of IDs that were minted by users. The function concatenates the `category.ids` and `category.claimable_ids` lists to make a list of all IDs. | ||
|
|
||
| #### `recover` | ||
|
|
||
| ```solidity | ||
| function recover(uint256[] memory _categoryArr, address _recipient) | ||
| ``` | ||
|
|
||
| This function results in the transaction to immediately revert, since, it is no longer necessary for the vault to recover any tokens. | ||
|
|
||
| #### `onERC**Received` | ||
|
|
||
| Same as `recover`. | ||
|
|
||
| --- | ||
| ### Set Category ID | ||
|
|
||
| ```solidity | ||
| function setCategoryIds(uint256 _category, uint256[] memory _ids, uint256[] memory _amounts) external | ||
| ``` | ||
|
|
||
| Use this method to assign token IDs to a category. This method must be invoked prior minting of tokens. | ||
|
|
||
| | Parameter | Type | Description | | ||
| | --- | --- | --- | | ||
| | Category | `uint256` | The integer representation of a category | | ||
| | IDs | `uint256[]` | An array of token IDs to be added into the category | | ||
| | Amounts | `uint256[]` | The amount of corresponding `_ids` to be added into the category. Pass an empty array for ERC721 tokens | | ||
|
|
||
| ### Claim | ||
|
|
||
| ```solidity | ||
| function claim(uint256 _category, uint256 _deadline, bytes calldata _sig) external onlyConveyor | ||
| ``` | ||
|
|
||
| Mints and distributes a token to the user. The token ID is not revealed until the transaction is final. | ||
|
|
||
| | Parameter | Type | Description | | ||
| | --- | --- | --- | | ||
| | Category | `uint256` | The integer representation of a category | | ||
| | Deadline | `uint256` | Transaction reverts at `block.timestamp > deadline` | | ||
| | Sig | `bytes` | The user's EIP712 message to authorize the Treasury for collecting the payment. You may pass `0x` if `paymentToken == address(0)` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.