Skip to content

v2.0.0

Compare
Choose a tag to compare
@tsudmi tsudmi released this 16 Jul 10:25
· 1 commit to main since this release
50293fb

What's Changed

Gnosis vaults

  • New Gnosis vaults were deployed to the Gnosis network. They use the new VaultGnoStaking module. The main differences from the Ethereum vaults are as follows:
    • Deposits are made in GNO tokens, and ERC-20 approval must be done before the call.
    • Partial and full withdrawals are stored in the contract used to register the validators. They are pulled by the vault during user withdrawals, validator registrations, and state updates.
    • 1 GNO, instead of 32 ETH, must be staked for the validator to activate.
    • Rewards from transaction fees are received in xDAI and must be swapped using the swapXdaiToGno function. This function performs the transaction through the Balancer pool (which can be updated by the DAO) and uses oracles to verify the correct swap price in the XdaiExchange contract.

Restake vaults

Blocklist vaults

  • New blocklist vaults were deployed to Ethereum and Gnosis. These vaults use the VaultBlocklist module, which keeps track of accounts that cannot stake to the vault. For example, you can block all sanctioned addresses from depositing to your vault.
  • The account with the blocklistManager role can manage the blocklist. This role is assigned to the vault admin by default. The vault admin can update the role using the setBlocklistManager function, which emits the BlocklistManagerUpdated event.
  • You can use blockedAccounts to check whether an account is blocked. The blocklistManager can update the list using the updateBlocklist function. Blocklist updates emit the BlocklistUpdated event.

Exit queue

  • The enterExitQueue function now locks the conversion rate between assets and shares at the time of the call, rather than during the updateState call. Shares are burned immediately. The locked assets will not receive rewards after the call but will incur penalties if the vault APY is negative. These penalties will be distributed proportionally to all assets in the vault. Exit positions created before the upgrade will be processed according to the Vault’s V1 logic.
  • All newly created exit positions now emit the V2ExitQueueEntered event.
  • The ExitingAssetsPenalized event is emitted during the updateState call if the vault incurs a penalty. The penalty will be proportionally distributed among all currently exiting assets.
  • The claimExitedAssets will not return anything after the upgrade.
  • The claimExitedAssets must be used for the exit positions created before and after the vault upgrade to V2.
  • The redeem function was removed. All the exits must be submitted using enterExitQueue.
  • The totalExitingAssets function was added to the vault. It returns the total amount of assets in the exit queue after the upgrade to V2.
  • For exit positions created after the upgrade, the getExitQueueIndex function is not needed. You can pass 0 to both the calculateExitedAssets and claimExitedAssets functions.

Validators management

  • All the logic for managing the vault’s deposit data has been moved to the immutable DepositDataRegistry contract:
  • During the vault upgrade, all current values for the variables above are migrated to the DepositDataRegistry contract, so no extra actions are needed.
  • The new validatorsManager role has been added to the vault. The address assigned to this role can register validator(s) and defaults to the DepositDataRegistry contract. The validatorsManager role can be updated by the admin using the setValidatorsManager function. This function emits the ValidatorsManagerUpdated event on every update.
  • The new registerValidators function has been added to the vault. This function allows for the registration of both single and multiple validators. It can only be called by the validatorsManager or by providing the signature of the validatorsManager over the validator registration data (see example here).

Private vaults

  • The ERC-20 private vaults, on token transfer, check that both the sender and recipient are whitelisted.
  • Both ERC-20 and non-ERC-20 private vaults, on mintOsToken, check that the caller is still whitelisted.

Vault osToken

  • The depositAndMintOsToken and updateStateAndDepositAndMintOsToken functions have been added to all the Ethereum vault contracts. These functions can be used to batch deposit, mint osToken, and update the vault state in a single call. If the osTokenShares argument is set to 2^256 - 1, the maximum osToken shares will be minted based on the deposit amount.
  • The OsTokenConfig was updated:
    • Replaced redeemFromLtvPercent and redeemToLtvPercent variables with the redeemer role that can redeem assets from the vaults where osToken was minted. An equal amount of osToken must be burned during the call. This role is managed by the DAO through the setRedeemer function, which emits the RedeemerUpdated event.
    • The DAO can set the default configuration for all vaults or override the configuration for a specific vault using the updateConfig function. By setting the liqThresholdPercent parameter to 2^64 - 1, liquidations will be disabled for the vault.

RewardSplitter

  • The redeem function was removed from the RewardSplitter contract.
  • The totalRewards function was added. It returns the total amount of accumulated unclaimed rewards.

Full Changelog: v1.1.0...v2.0.0