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

[Feature] [Gas] create a multi-asset ERC-721 vault #22

Merged
merged 4 commits into from
May 19, 2022

Conversation

jake-nyquist
Copy link
Contributor

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.

Copy link
Contributor Author

jake-nyquist commented May 18, 2022

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Comment on lines +16 to +20
/// @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.
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

IERC721FlashLoanReceiver receiver = IERC721FlashLoanReceiver(
receiverAddress
);
require(assetId == assetId, "flashLoan -- invalid asset id");
Copy link
Contributor

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

@jake-nyquist jake-nyquist force-pushed the 05-18-create_multi-asset_erc-721_vault branch from 96d605a to 02e5bab Compare May 18, 2022 22:56
This was referenced May 19, 2022
@jake-nyquist jake-nyquist requested a review from regynald May 19, 2022 05:32
Copy link
Contributor Author

jake-nyquist commented May 19, 2022

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

@jake-nyquist jake-nyquist force-pushed the 05-17-update_covered_call_impl_to_support_multiple_token_ids branch from 8dd8283 to 02bd7e9 Compare May 19, 2022 05:36
@jake-nyquist jake-nyquist changed the base branch from 05-17-update_covered_call_impl_to_support_multiple_token_ids to main May 19, 2022 05:38
@jake-nyquist jake-nyquist force-pushed the 05-18-create_multi-asset_erc-721_vault branch from 02e5bab to 172ac4d Compare May 19, 2022 05:38
@jake-nyquist jake-nyquist merged commit 64edc62 into main May 19, 2022
@regynald regynald deleted the 05-18-create_multi-asset_erc-721_vault branch May 31, 2022 22:27
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