-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Feature] [Gas] create a multi-asset ERC-721 vault #22
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
9caf758
to
8dd8283
Compare
86762f4
to
2ad195a
Compare
/// @title HookMulitVault -- implemenation of a Vault for multiple assets within a NFT collection, with entitlements. | ||
/// @author Jake Nyquist - [email protected] | ||
/// @notice HookVault holds a multiple NFT asset in escrow on behalf of multiple beneficial owners. Other contracts | ||
/// are able to register "entitlements" for a fixed period of time on the asset, which give them the ability to | ||
/// change the vault's owner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we take out and combine docs with IHookERC721MultiVault
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is IHookERC721MultiVault? I don't think we have one, at least as of this commit.
src/HookERC721MultiVaultImplV1.sol
Outdated
IERC721FlashLoanReceiver receiver = IERC721FlashLoanReceiver( | ||
receiverAddress | ||
); | ||
require(assetId == assetId, "flashLoan -- invalid asset id"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this require statement accomplishes
96d605a
to
02e5bab
Compare
Graphite Merge Job Current status: ✅ Merged This pull request was successfully merged as part of a stack. This comment was auto-generated by Graphite. Job Reference: zj1dV246sIyY6mD9nEbE |
8dd8283
to
02bd7e9
Compare
02e5bab
to
172ac4d
Compare
This vault takes a similar form to our current ERC-721 vault; however, instead of
requiring that a unique vault be deployed for each underlying ERC-721 token, this single
vault can support multiple tokenIds each with a distinct entitlement and a beneficial owner.
We believe this will result in substantial gas savings by removing the requirement that a
new vault is deployed for each minted option. Additionally, more care is taken in this
implementation to remove extraneous SSTOREs.
One area where we could get further SSTORE improvements would be by thining the
entitlement struct that we persist to not include the notion of the vault address, as the
vault adderss is the same for each asset within the vault.