Skip to main content

ReserveMigrator

Git Source

Inherits: IReserveMigrator, Policy, RolesConsumer

Constants​

from​

ERC20 public immutable from;

sFrom​

ERC4626 public immutable sFrom;

to​

ERC20 public immutable to;

sTo​

ERC4626 public immutable sTo;

State Variables​

TRSRY​

TRSRYv1 internal TRSRY;

migrator​

IDaiUsds public migrator;

locallyActive​

bool public locallyActive;

Functions​

constructor​

constructor(Kernel kernel_, address sFrom_, address sTo_, address migrator_) Policy(kernel_);

Parameters

NameTypeDescription
kernel_Kernel
sFrom_address
sTo_address
migrator_address

configureDependencies​

Define module dependencies for this policy.

function configureDependencies() external override returns (Keycode[] memory dependencies);

Returns

NameTypeDescription
dependenciesKeycode[]- Keycode array of module dependencies.

requestPermissions​

Function called by kernel to set module function permissions.

function requestPermissions()
external
view
override
returns (Permissions[] memory permissions);

Returns

NameTypeDescription
permissionsPermissions[]- Array of keycodes and function selectors for requested 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

if no migration is required or it is deactivated, the function does nothing

function migrate() external override onlyRole("heart");

VERSION​

Returns the version of the policy.

function VERSION() external pure returns (uint8 major, uint8 minor);

Returns

NameTypeDescription
majoruint8The major version of the policy.
minoruint8The 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

NameTypeDescription
token_addressThe address of the ERC20 token to rescue