Function: migrate(address _poolAddress, uint256 _validatorId, uint256 _govDelegated, uint256 _bond, uint256 _unbond, uint256 _rate, uint256 _totalRTokenSupply, uint256 _totalProtocolFee, uint256 _era)
Allows the migration of the state of the contract to a bridged version of the contract.
Inputs
_poolAddressControl: Fully controlled by the owner.
Constraints: Checked that it does not already exist within bondedpools.
Impact: The address of the pool to migrate.
_validatorIdControl: Fully controller by the owner.
Constraints: Should not exist for the specified pool.
Impact: The validator ID to migrate.
_govDelegatedControl: Fully controlled by the owner.
Constraints: None.
Impact: The governance-delegated amount to migrate.
_bondControl: Fully controlled by the owner.
Constraints: None.
Impact: The bonded amount to migrate.
_unbondControl: Fully controlled by the owner.
Constraints: None.
Impact: The unbonded amount to migrate.
_rateControl: Fully controlled by the owner.
Constraints: None; it is important to add a check that it is not zero, so that
migratecannot be called more than once.Impact: The rate to migrate.
_totalRTokenSupplyControl: Fully controlled by owner.
Constraints: None.
Impact: The total rToken supply to migrate.
_totalProtocolFeeControl: Fully controlled by owner.
Constraints: None.
Impact: The total protocol fee to migrate.
_eraControl: Fully controlled by owner.
Constraints: None.
Impact: The
erato migrate.
Branches and code coverage (including function calls)
Intended branches
Should migrate all the states of the contract to the new contract.
Check that
_rateis not zero, so thatmigratecannot be called more than once.Check that the
_poolAddressdoes not already exist inbondedPools.Assumed that the admin calls this function with legitimate values.
Negative behavior
Should not allow calling it more than once. Ensured through the
ratevariable partly, since when set it is not checked if it is zero.Should not be callable by anyone other than the owner. Ensured through the
onlyAdminmodifier.