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
_poolAddress
Control: Fully controlled by the owner.
Constraints: Checked that it does not already exist within bondedpools.
Impact: The address of the pool to migrate.
_validatorId
Control: Fully controller by the owner.
Constraints: Should not exist for the specified pool.
Impact: The validator ID to migrate.
_govDelegated
Control: Fully controlled by the owner.
Constraints: None.
Impact: The governance-delegated amount to migrate.
_bond
Control: Fully controlled by the owner.
Constraints: None.
Impact: The bonded amount to migrate.
_unbond
Control: Fully controlled by the owner.
Constraints: None.
Impact: The unbonded amount to migrate.
_rate
Control: Fully controlled by the owner.
Constraints: None; it is important to add a check that it is not zero, so that
migrate
cannot be called more than once.Impact: The rate to migrate.
_totalRTokenSupply
Control: Fully controlled by owner.
Constraints: None.
Impact: The total rToken supply to migrate.
_totalProtocolFee
Control: Fully controlled by owner.
Constraints: None.
Impact: The total protocol fee to migrate.
_era
Control: Fully controlled by owner.
Constraints: None.
Impact: The
era
to migrate.
Branches and code coverage (including function calls)
Intended branches
Should migrate all the states of the contract to the new contract.
Check that
_rate
is not zero, so thatmigrate
cannot be called more than once.Check that the
_poolAddress
does 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
rate
variable 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
onlyAdmin
modifier.