grgVault docs
GrgVault
stakingProxy
address stakingProxyisInCatastrophicFailure
bool isInCatastrophicFailure_balances
mapping(address => uint256) _balancesgrgAssetProxy
contract IAssetProxy grgAssetProxy_grgToken
contract IERC20Token _grgToken_grgAssetData
bytes _grgAssetDataonlyStakingProxy
modifier onlyStakingProxy()Only stakingProxy can call this function.
onlyInCatastrophicFailure
modifier onlyInCatastrophicFailure()Function can only be called in catastrophic failure mode.
onlyNotInCatastrophicFailure
modifier onlyNotInCatastrophicFailure()Function can only be called not in catastropic failure mode
constructor
constructor(address grgProxyAddress, address grgTokenAddress, address newOwner) publicConstructor.
Parameters
grgProxyAddress
address
Address of the RigoBlock Grg Proxy.
grgTokenAddress
address
Address of the Grg Token.
newOwner
address
Address of the Grg vault owner.
setStakingProxy
function setStakingProxy(address stakingProxyAddress) externalSets the address of the StakingProxy contract. Note that only the contract owner can call this function.
Parameters
stakingProxyAddress
address
Address of Staking proxy contract.
enterCatastrophicFailure
function enterCatastrophicFailure() externalVault enters into Catastrophic Failure Mode. *** WARNING - ONCE IN CATOSTROPHIC FAILURE MODE, YOU CAN NEVER GO BACK! *** Note that only the contract owner can call this function.
setGrgProxy
function setGrgProxy(address grgProxyAddress) externalSets the Grg proxy. Note that only an authorized address can call this function. Note that this can only be called when not in Catastrophic Failure mode.
Parameters
grgProxyAddress
address
Address of the RigoBlock Grg Proxy.
depositFrom
function depositFrom(address staker, uint256 amount) externalDeposit an amount of Grg Tokens from staker into the vault. Note that only the Staking contract can call this. Note that this can only be called when not in Catastrophic Failure mode.
Parameters
staker
address
of Grg Tokens.
amount
uint256
of Grg Tokens to deposit.
withdrawFrom
function withdrawFrom(address staker, uint256 amount) externalWithdraw an amount of Grg Tokens to staker from the vault. Note that only the Staking contract can call this. Note that this can only be called when not in Catastrophic Failure mode.
Parameters
staker
address
of Grg Tokens.
amount
uint256
of Grg Tokens to withdraw.
withdrawAllFrom
function withdrawAllFrom(address staker) external returns (uint256)Withdraw ALL Grg Tokens to staker from the vault. Note that this can only be called when in Catastrophic Failure mode.
Parameters
staker
address
of Grg Tokens.
balanceOf
function balanceOf(address staker) external view returns (uint256)Returns the balance in Grg Tokens of the staker
Return Values
[0]
uint256
Balance in Grg.
balanceOfGrgVault
function balanceOfGrgVault() external view returns (uint256)Returns the entire balance of Grg tokens in the vault.
_withdrawFrom
function _withdrawFrom(address staker, uint256 amount) internalWithdraw an amount of Grg Tokens to staker from the vault.
Parameters
staker
address
of Grg Tokens.
amount
uint256
of Grg Tokens to withdraw.
_assertSenderIsStakingProxy
function _assertSenderIsStakingProxy() private viewAsserts that sender is stakingProxy contract.
_assertInCatastrophicFailure
function _assertInCatastrophicFailure() private viewAsserts that vault is in catastrophic failure mode.
_assertNotInCatastrophicFailure
function _assertNotInCatastrophicFailure() private viewAsserts that vault is not in catastrophic failure mode.
Last updated