Skip to main content

IAmmalgamDebtERC20

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 AmmalgamDebtERC20 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.

increaseDebtAllowance

Increases the debt allowance granted by the msg.sender to spender.

function increaseDebtAllowance(address spender, uint256 addedValue) external returns (bool);

Parameters

NameTypeDescription
spenderaddressThe account that will receive the increased debt allowance.
addedValueuint256The value to be added to the allowance.

Returns

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

decreaseDebtAllowance

Decreases the debt allowance granted by the msg.sender to spender.

function decreaseDebtAllowance(address spender, uint256 subtractedValue) external returns (bool);

Parameters

NameTypeDescription
spenderaddressThe account whose debt allowance will decrease.
subtractedValueuint256The value to subtract from the allowance.

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.