iMsdTokens

MSD Token

MSD Token is the synthetic asset in the dForce Lending & Synthetic system. It conforms to the ERC-20 standard and has a Mint interface with permissions. Only MsdController has permission to call mint function. Users can mint MSD Token when the certain collateral ratio is satisfied.
Minting MSD Token from the system has similar behavior to borrowing, and repay borrow means burn the MSD Token. When the collateral rate is lower than the requirement, the MSD loan can be liquidated. The liquidation of MSD is consistent with the liquidation of the loan.

EIP20 Methods

All standard EIP20 methods are implemented, such as balanceOf(), transfer(), transferFrom(), approve(), totalSupply(), etc.

EIP2612 Methods

permit()

Allows a user to permit another account (or contract) to use their funds using a signed message. This enables gas-less transactions and single approval/transfer transactions.
1
function permit(
2
address _owner,
3
address _spender,
4
uint256 _value,
5
uint256 _deadline,
6
uint8 _v,
7
bytes32 _r,
8
bytes32 _s
9
)
Copied!

Methods

Mint()

1
function mint(address to, uint256 amount) external onlyMinter
Copied!
Mint MSD token with limited authority, only MSD Controller has authority to mint, account who has enough collateral can call borrow from iMsdToken to mint MSD.

Burn()

1
function burn(address from, uint256 amount) external;
Copied!

iMsdTokens

iMSDToken inherits most functions of iToken, explores interfaces to interact with protocol to mint or burn MsdTokens. Borrowing from iMsdToken results in minting MsdToken under collaterals, and repaying from iMsdToken results in burning MsdToken, no Mint & Redeem function needed.

Methods

Borrow()

Users call Borrow function to mint MSD token if the certain collateral ratio is satisfied.
1
function borrow(uint256 _borrowAmount) external;
Copied!

RepayBorrow()

Users call RepayBorrow function to burn MSD token, this will repay the outstanding loan of user.
1
function repayBorrow(uint256 _repayAmount) external;
Copied!

RepayBorrowBehalf()

Repay a loan on behalf of borrower.
1
function repayBorrowBehalf(address _borrower, uint256 _repayAmount) external;
Copied!

LiquidateBorrow()

Repay a loan on behalf of the borrower and seize the same value of iToken plus incentive as a reward.
1
function liquidateBorrow(
2
address _borrower,
3
uint256 _repayAmount,
4
address _assetCollateral
5
) external;
Copied!