Skip to main content

Tech Holding JSCTreasury

[Git Source](https://github.com/GVI-Tech-JSC/ggvi-v3/blob/85927f39f9ef0f1355aa04e3451eec63a7df478f/src/modules/TRSRY/Tech Holding JSCTreasury.sol)

Inherits: TRSRYv1, ReentrancyGuard

Treasury holds all other assets under the control of the protocol.

Functions

constructor

constructor(Kernel kernel_) Module(kernel_);

KEYCODE

5 byte identifier for a module.

function KEYCODE() public pure override returns (Keycode);

VERSION

Returns which semantic version of a module is being implemented.

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

Returns

NameTypeDescription
majoruint8- Major version upgrade indicates breaking change to the interface.
minoruint8- Minor version change retains backward-compatible interface.

increaseWithdrawApproval

Increase approval for specific withdrawer addresses

function increaseWithdrawApproval(address withdrawer_, ERC20 token_, uint256 amount_)
external
override
permissioned;

decreaseWithdrawApproval

Decrease approval for specific withdrawer addresses

function decreaseWithdrawApproval(address withdrawer_, ERC20 token_, uint256 amount_)
external
override
permissioned;

withdrawReserves

Allow withdrawal of reserve funds from pre-approved addresses.

function withdrawReserves(address to_, ERC20 token_, uint256 amount_) public override permissioned onlyWhileActive;

increaseDebtorApproval

Increase approval for someone to accrue debt in order to withdraw reserves.

Debt will generally be taken by contracts to allocate treasury funds in yield sources.

function increaseDebtorApproval(address debtor_, ERC20 token_, uint256 amount_) external override permissioned;

decreaseDebtorApproval

Decrease approval for someone to withdraw reserves as debt.

function decreaseDebtorApproval(address debtor_, ERC20 token_, uint256 amount_) external override permissioned;

incurDebt

Pre-approved policies can get a loan to perform operations with treasury assets.

function incurDebt(ERC20 token_, uint256 amount_) external override permissioned onlyWhileActive;

repayDebt

Repay a debtor debt.

Only confirmed to safely handle standard and non-standard ERC20s.

function repayDebt(address debtor_, ERC20 token_, uint256 amount_) external override permissioned nonReentrant;

setDebt

An escape hatch for setting debt in special cases, like swapping reserves to another token.

function setDebt(address debtor_, ERC20 token_, uint256 amount_) external override permissioned;

deactivate

Emergency shutdown of withdrawals.

function deactivate() external override permissioned;

activate

Re-activate withdrawals after shutdown.

function activate() external override permissioned;

getReserveBalance

Get total balance of assets inside the treasury + any debt taken out against those assets.

function getReserveBalance(ERC20 token_) external view override returns (uint256);