Skip to main content

TreasuryCustodian

Git Source

Inherits: Policy, RolesConsumer

State Variables

TRSRY

TRSRYv1 public TRSRY;

Functions

constructor

constructor(Kernel kernel_) Policy(kernel_);

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 requests);

Returns

NameTypeDescription
requestsPermissions[]- 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");

reduceWithdrawerApproval

Lower an address's withdrawer approval

function reduceWithdrawerApproval(address for_, ERC20 token_, uint256 amount_) external onlyRole("custodian");

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");

grantDebtorApproval

Allow an address to incur amount_ of debt from the treasury

function grantDebtorApproval(address for_, ERC20 token_, uint256 amount_) external onlyRole("custodian");

reduceDebtorApproval

Lower an address's debtor approval

function reduceDebtorApproval(address for_, ERC20 token_, uint256 amount_) external onlyRole("custodian");

increaseDebt

Allow authorized addresses to increase debt in special cases

function increaseDebt(ERC20 token_, address debtor_, uint256 amount_) external onlyRole("custodian");

decreaseDebt

Allow authorized addresses to decrease debt in special cases

function decreaseDebt(ERC20 token_, address debtor_, uint256 amount_) external onlyRole("custodian");

revokePolicyApprovals

Anyone can call to revoke a deactivated policy's approvals.

function revokePolicyApprovals(address policy_, ERC20[] memory tokens_) external onlyRole("custodian");

Events

ApprovalRevoked

event ApprovalRevoked(address indexed policy_, ERC20[] tokens_);

Errors

Custodian_PolicyStillActive

error Custodian_PolicyStillActive();