TreasuryCustodian
Inherits: Policy, RolesConsumer
State Variables
TRSRY
TRSRYv1 public TRSRY;
Functions
constructor
constructor(Kernel kernel_) Policy(kernel_);
Parameters
| Name | Type | Description |
|---|---|---|
| kernel_ | Kernel |
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 requests);
Returns
| Name | Type | Description |
|---|---|---|
| requests | Permissions[] | - Array of keycodes and function selectors for requested permissions. |
grantWithdrawerApproval
Allow an address to withdraw amount_ from the treasury
function grantWithdrawerApproval(
address for_,
ERC20 token_,
uint256 amount_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| for_ | address | |
| token_ | ERC20 | |
| amount_ | uint256 |
reduceWithdrawerApproval
Lower an address's withdrawer approval
function reduceWithdrawerApproval(
address for_,
ERC20 token_,
uint256 amount_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| for_ | address | |
| token_ | ERC20 | |
| amount_ | uint256 |
withdrawReservesTo
Custodian can withdraw reserves to an address.
Used for withdrawing assets to a MS or other address in special cases.
function withdrawReservesTo(
address to_,
ERC20 token_,
uint256 amount_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| to_ | address | |
| token_ | ERC20 | |
| amount_ | uint256 |
grantDebtorApproval
Allow an address to incur amount_ of debt from the treasury
function grantDebtorApproval(
address for_,
ERC20 token_,
uint256 amount_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| for_ | address | |
| token_ | ERC20 | |
| amount_ | uint256 |
reduceDebtorApproval
Lower an address's debtor approval
function reduceDebtorApproval(
address for_,
ERC20 token_,
uint256 amount_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| for_ | address | |
| token_ | ERC20 | |
| amount_ | uint256 |
increaseDebt
Allow authorized addresses to increase debt in special cases
function increaseDebt(
ERC20 token_,
address debtor_,
uint256 amount_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| token_ | ERC20 | |
| debtor_ | address | |
| amount_ | uint256 |
decreaseDebt
Allow authorized addresses to decrease debt in special cases
function decreaseDebt(
ERC20 token_,
address debtor_,
uint256 amount_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| token_ | ERC20 | |
| debtor_ | address | |
| amount_ | uint256 |
revokePolicyApprovals
Anyone can call to revoke a deactivated policy's approvals.
function revokePolicyApprovals(
address policy_,
ERC20[] memory tokens_
) external onlyRole("custodian");
Parameters
| Name | Type | Description |
|---|---|---|
| policy_ | address | |
| tokens_ | ERC20[] |
Events
ApprovalRevoked
event ApprovalRevoked(address indexed policy_, ERC20[] tokens_);
Parameters
| Name | Type | Description |
|---|---|---|
| policy_ | address | |
| tokens_ | ERC20[] |
Errors
Custodian_PolicyStillActive
error Custodian_PolicyStillActive();