Skip to main content

IERC20DebtToken

Git Source

Inherits: IAmmalgamERC20

This interface extends the IAmmalgamERC20 with additional methods. for handling debt allowances and claims in the Ammalgam protocol.

Functions

debtAllowance

Returns the current debt allowance of spender from receiver.

function debtAllowance(address receiver, address spender) external view returns (uint256);

Parameters

NameTypeDescription
receiveraddressThe account that would receive debt moved by the spender.
spenderaddressThe account that can spend the debt.

Returns

NameTypeDescription
<none>uint256The allowance of debt the spender can send to the receiver.

approveDebt

Sets amount of debt tokens that can be accepted by the caller from the spender.

The approveDebt implementation in ERC4626DebtToken calls _approve from ERC20, by passing in the receiver as owner.

function approveDebt(address spender, uint256 amount) external returns (bool);

Parameters

NameTypeDescription
spenderaddressThe account that can transfer the debt.
amountuint256The amount of the debt.

Returns

NameTypeDescription
<none>boolA boolean value indicating whether the operation succeeded.

claimDebt

Allows caller to claim amount of debt from owner.

The caller must have sufficient collateral in order to secure the debt being claimed.

function claimDebt(address owner, uint256 amount) external;

Parameters

NameTypeDescription
owneraddressThe account that owns the debt.
amountuint256The amount of the debt to be claimed.