Skip to main content

ICreditDelegationToken

ICreditDelegationToken​

Defines the basic interface for a token supporting credit delegation.

BorrowAllowanceDelegated​

event BorrowAllowanceDelegated(address fromUser, address toUser, address asset, uint256 amount)

Emitted on approveDelegation and `borrowAllowance

Parameters​

NameTypeDescription
fromUseraddressThe address of the delegator
toUseraddressThe address of the delegatee
assetaddressThe address of the delegated asset
amountuint256The amount being delegated

approveDelegation​

function approveDelegation(address delegatee, uint256 amount) external

Delegates borrowing power to a user on the specific debt token. Delegation will still respect the liquidation constraints (even if delegated, a delegatee cannot force a delegator HF to go below 1)

Parameters​

NameTypeDescription
delegateeaddressThe address receiving the delegated borrowing power
amountuint256The maximum amount being delegated.

borrowAllowance​

function borrowAllowance(address fromUser, address toUser) external view returns (uint256)

Returns the borrow allowance of the user

Parameters​

NameTypeDescription
fromUseraddressThe user to giving allowance
toUseraddressThe user to give allowance to

Return Values​

NameTypeDescription
[0]uint256The current allowance of toUser

delegationWithSig​

function delegationWithSig(address delegator, address delegatee, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external

Delegates borrowing power to a user on the specific debt token via ERC712 signature

Parameters​

NameTypeDescription
delegatoraddressThe delegator of the credit
delegateeaddressThe delegatee that can use the credit
valueuint256The amount to be delegated
deadlineuint256The deadline timestamp, type(uint256).max for max deadline
vuint8The V signature param
rbytes32The R signature param
sbytes32The S signature param