Skip to main content

ReserveWrapper

Git Source

Inherits: Policy, PolicyEnabler, IPeriodicTask, IReserveWrapper

Title: ReserveWrapper

Periodic task to wrap the reserve tokens in the TRSRY module into sReserve tokens

Constants​

_RESERVE​

ERC20 internal immutable _RESERVE;

_SRESERVE​

ERC4626 internal immutable _SRESERVE;

State Variables​

TRSRY​

TRSRYv1 public TRSRY;

Functions​

constructor​

constructor(address kernel_, address reserve_, address sReserve_) Policy(Kernel(kernel_));

Parameters

NameTypeDescription
kernel_address
reserve_address
sReserve_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.

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.

getReserve​

Returns the address of the reserve token

function getReserve() external view override returns (address);

Returns

NameTypeDescription
<none>address

getSReserve​

Returns the address of the sReserve token

function getSReserve() external view override returns (address);

Returns

NameTypeDescription
<none>address

execute​

This function reverts if:

  • The caller is not authorized

Notes:

  • If this contract disabled, nothing is done
  • If the reserve balance is 0, nothing is done
  • If the previewDeposit would result in zero shares, nothing is done
  • If TRSRY is not active, nothing is done
function execute() external override onlyRole(HEART_ROLE);

supportsInterface​

function supportsInterface(
bytes4 interfaceId
) public view override(PolicyEnabler, IPeriodicTask) returns (bool);

Parameters

NameTypeDescription
interfaceIdbytes4

Returns

NameTypeDescription
<none>bool