ReserveWrapper
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
| Name | Type | Description |
|---|---|---|
| kernel_ | address | |
| reserve_ | address | |
| sReserve_ | address |
configureDependencies
Define module dependencies for this policy.
function configureDependencies() external override returns (Keycode[] memory dependencies);
Returns
| Name | Type | Description |
|---|---|---|
| dependencies | Keycode[] | - 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
| Name | Type | Description |
|---|---|---|
| permissions | Permissions[] | - 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
| Name | Type | Description |
|---|---|---|
| major | uint8 | The major version of the policy. |
| minor | uint8 | The minor version of the policy. |
getReserve
Returns the address of the reserve token
function getReserve() external view override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
getSReserve
Returns the address of the sReserve token
function getSReserve() external view override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |