ReserveMigrator
Inherits: IReserveMigrator, Policy, RolesConsumer
State Variables
TRSRY
TRSRYv1 internal TRSRY;
from
ERC20 public immutable from;
sFrom
ERC4626 public immutable sFrom;
to
ERC20 public immutable to;
sTo
ERC4626 public immutable sTo;
migrator
IDaiUsds public migrator;
locallyActive
bool public locallyActive;
Functions
constructor
constructor(Kernel kernel_, address sFrom_, address sTo_, address migrator_) Policy(kernel_);
configureDependencies
function configureDependencies() external override returns (Keycode[] memory dependencies);
requestPermissions
function requestPermissions() external view override returns (Permissions[] memory permissions);
migrate
migrate reserves and wrapped reserves in the treasury to the new reserve token
this function is restricted to the heart role to avoid complications with opportunistic conversions
function migrate() external override onlyRole("heart");
VERSION
Returns the version of the policy.
function VERSION() external pure returns (uint8 major, uint8 minor);
Returns
Name | Type | Description |
---|---|---|
major | uint8 | The major version of the policy. |
minor | uint8 | The minor version of the policy. |
activate
Activate the policy locally, if it has been deactivated
This function is restricted to the reserve_migrator admin role
function activate() external onlyRole("reserve_migrator_admin");
deactivate
Deactivate the policy locally, preventing it from migrating reserves
This function is restricted to the reserve_migrator admin role
function deactivate() external onlyRole("reserve_migrator_admin");
rescue
Rescue any ERC20 token sent to this contract and send it to the TRSRY
This function is restricted to the reserve_migrator admin role
function rescue(address token_) external onlyRole("reserve_migrator_admin");
Parameters
Name | Type | Description |
---|---|---|
token_ | address | The address of the ERC20 token to rescue |