https://github.com/Into-the-Fathom/fathom-dao-smart-contracts/blob/master/contracts/dao/staking/vault/packages/VaultPackage.sol
VaultProxy
is proxy, and its implementation is VaultPackage
.
The VaultPackage
contract manages the operations and state related to supported tokens and their deposits within the vault. It handles the addition and removal of tokens, depositing of tokens for rewards, and managing migration of tokens to a new vault package.
Description: Tracks the total amount of each token that has been deposited into the vault.
Key: Token address.
Value: Amount deposited.
Description: Indicates whether a token is supported by the vault.
Key: Token address.
Value: Boolean indicating support.
Description: An array of token addresses that are currently supported by the vault.
Description: A boolean flag indicating if the vault has been migrated to a new package.
Deposits a specified amount of a supported token into the vault.
Parameters:
_token
(address): The token's address.
_amount
(uint256): Amount of the token to deposit.
Returns: None.
Pays out rewards to a user from the deposited tokens.
Parameters:
_user
(address): The user's address.
_token
(address): The token's address.
_amount
(uint256): Amount of the token to pay out.
Returns: None.
Adds a token to the list of supported tokens.
Parameters:
_token
(address): The token's address.
Returns: None.
Removes a token from the list of supported tokens.
Parameters:
_token
(address): The token's address.
Returns: None.
Migrates the vault to a new package.
Parameters:
newVaultPackage
(address): The new vault package's address.
Returns: None.
Withdraws excess balances of supported tokens.
Parameters:
_withdrawTo
(address): Address to which the tokens will be withdrawn.
Returns: None.
Withdraws all balances of an unsupported token.
Parameters:
_token
(address): The token's address.
_withdrawTo
(address): Address to which the tokens will be withdrawn.
Returns: None.
Emitted when a token is added to the list of supported tokens.
Parameters:
tokenAddress
(address indexed): Address of the token added.
addedBy
(address indexed): Address of the user who added the token.
timestamp
(uint256): Time at which the token was added.
Emitted when a token is removed from the list of supported tokens.
Parameters:
tokenAddress
(address indexed): Address of the token removed.
removedBy
(address indexed): Address of the user who removed the token.
timestamp
(uint256): Time at which the token was removed.