Vault
A time-locked vault to distribute ERC20 tokens to owners of an ERC721 or ERC4907 collection at expiry based on their percentage of ownership in the collection.
Getting Started Module Methods Smart Contract Methods
Getting Started
To begin we'll import the FrostySDK, chain configurations, and the Vault module.
Then we'll setup our signer (via wagmi/ethers) and create a new instance of the FrostySDK.
Module Methods
deploy Deploy a minimal proxy clone of the Vault implementation contract.
getContract Get an ethers contract instance of a previously deployed Vault contract.
deploy
Deploy a minimal proxy clone of the Vault implementation contract.
sdk (SDK) An instance of the FrostySDK, configured with a chain and signer.
vaultDistributionTokenAddress (string) The address of the ERC20 token that will be distributed by the vault.
nftVaultKeyAddress (string) The address of the ERC20 token that will be distributed by the vault.
nftTotalSupply (number) The total supply of the ERC721 collection that is wrapped by the vault.
unlockDate (number) The timestamp at which the vault will unlock and allow distributions.
onTxPending (Function) - optional A callback function executed upon submission of the deploy transaction.
onTxReceipt (Function) - optional A callback function executed upon receipt of the deploy transaction.
getContract
Get an ethers contract instance of a previously deployed Vault contract.
sdk (SDK) An instance of the FrostySDK, configured with a chain and signer.
address (string) The contract address of a previously deployed Rentable contract.
Smart Contract Methods
vaultBalance Returns the balance of the ERC20 token held by the vault.
totalReleased Returns the total amount of the ERC20 which has been claimed and released.
claimMany Allows owners of the ERC721 collection to claim their share of the ERC20 funding the vault for multiple tokens.
claim Allows owners of the ERC721 collection to claim their share of the ERC20 funding the vault for an individual token.
drain A failsafe allowing the vault owner to withdraw ERC20 tokens sent to the vault
drainEth A failsafe allowing the vault owner to withdraw ETH sent to the vault
vaultBalance
Returns the balance of the ERC20 token held by the vault.
totalReleased
Returns the total amount of the ERC20 which has been claimed and released.
claimMany
Allows owners of the ERC721 collection to claim their share of the ERC20 funding the vault for multiple tokens.
to (address) The address of the owner in the ERC721 collection to which ERC20 tokens will be sent.
tokenIds (uint256[]) An array of tokens held by the owner against which to claim their share of the ERC20 tokens funded by the vault.
claim
Allows owners of the ERC721 collection to claim their share of the ERC20 funding the vault for an individual token.
to (address) The address of the owner in the ERC721 collection to which ERC20 tokens will be sent.
tokenId (uint256) The id of the token against which to claim a share of the ERC20 tokens funded by the vault.
drain
A failsafe allowing the vault owner to withdraw ERC20 tokens sent to the vault
token (IERC20) The address of the ERC20 token to withdraw from the vault.
drainEth
A failsafe allowing the vault owner to withdraw ETH sent to the vault
Last updated