Contracts and API Changes

The recent updates deprecate the StargateDelegation.sol and NodeManagement.sol contracts, consolidating functionalities within the Stargate.sol and StargateNFT.sol contracts. Key changes include the removal and replacement of functions to improve delegation handling and NFT transferability, as well as the migration of node management functionalities. Functions like stakeAndDelegate(), migrateAndDelegate(), and methods to manage node and reward processes have either been relocated or modified.

Contracts

  1. StargateDelegation.sol contract is deprecated: all delegations and rewards are now handled by the Stargate.sol contract.

  2. Removed, in StargateNFT.sol, everything related to vet generated vtho (setters, getters, library), since the protocol is not generating VTHO just for owning VET, but only when delegating;

  3. Claimable delegation rewards are not automatically claimed any more upon a token transfer, only during unstake or new delegation, and such actions are handled by the Stargate.sol contract.

  4. NFT is now always transferable, even when it is delegated to a validator.

API

  1. stakeAndDelegate() now requires a fee paid in VTHO to allow skipping the maturity period, and the user needs to select a validator.

  2. migrate() function was removed, now it is only possible to migrateAndDelegate() and a validator must be selected when performing such action.

  3. delegate() must receive a validator as a parameter and delegation does not start immediately but at the start of the next period of the validator; delegation now has 4 states: uknown, pending, active, exited.

  4. isDelegationActive() was removed in favour of getDelegationStatus().

  5. accumulatedRewards() was removed in favour of lockedRewards().

  6. Removed getters in StargateNFT.sol to optimize contract size: normalTokensCount(), getCap(), canTransfer(), ownsNormalToken(), isNormalToken(), levelsOwnedBy()

  7. The following functions are moved from StargateNFT.sol to the Stargate.sol : - stake() - unstake() - stakeAndDelegate() - migrateAndDelegate()

  8. NodeManagement.sol contract is deprecated. Managers are now handled by the StargateNFT.sol contract. All previous managers from NodeManagement were migrated. The following functions have been deprecated: NodeManagement.getNodeManager() -> StargateNFT.getTokenManager() NodeManagement.getNodeOwner() -> StargateNFT.ownerOf() NodeManagement.getNodeLevel() -> StargateNFT.getTokenLevel() NodeManagement.isNodeManager() -> StargateNFT.isTokenManager() NodeManagement.delegateNode() -> StargateNFT.addTokenManager() NodeManagement.removeNodeDelegation() -> StargateNFT.removeTokenManager() NodeManagement.getNodeIds() -> call both StargateNFT.idsOwnedBy() and StargateNFT.idsManagedBy()

  9. Legacy nodes are not being considered any more.

Was this helpful?