Borrowing
Smart Contract:[ThemisBorrowCompound.sol](Solidity-Open-Source/ThemisBorrowCompound.sol at main · Themis-protocol/Solidity-Open-Source · GitHub)
function getUserMaxBorrowAmount(
uint256 pid,
uint256 tokenId,
uint256 borrowAmount,
address _user) public view
returns(
uint256 _maxBorrowAmount,
bool _flag)
Get the max borrow amount of a user when the user trying to collateral the NFT
Parameters:
Name | Type | Description |
---|---|---|
pid | uint256 | the ID of borrowing pool |
tokenId | uint256 | NFT ID to collateral |
borrowAmount | uint256 | input of borrow amount |
_user | address | Wallet address of a user |
Returns:
Name | Type | Description |
---|---|---|
_maxBorrowAmount | uint256 | Max borrow amount |
_flag | bool | Over loan amount |
function v3NFTBorrow(
uint256 pid,
uint256 tokenId,
uint256 borrowAmount) public
Parameters:
Name | Type | Description |
---|---|---|
pid | uint256 | Pool ID |
tokenId | uint256 | NFT ID to collateral |
borrowAmount | uint256 | borrow amount |
Repayment the loan
function userReturn(
uint256 bid,
uint256 repayAmount) public
Parameters:
Name | Type | Description |
---|---|---|
bid | uint256 | Borrow ID |
repayAmount | uint256 | repay amount |
Get the pid of a user
function getBorrowPoolIdsOfOwner(
address owner
) external view returns (uint256[] memory)
Parameters:
Name | Type | Description |
---|---|---|
owner | address | wallet address of a user |
Get the borrow id of the owner form pid when user get a loan
function getBorrowIdsOfOwnerAndPoolId(
address owner,
uint256 pid
) external view returns (uint256[] memory)
Parameters:
Name | Type | Description |
---|---|---|
owner | address | Wallet address of owner |
pid | uint256 | Owner's pid |
Get the borrow id info
BorrowInfo[] public borrowInfo;
Parameters:
Name | Type | Description |
---|---|---|
bid | uint256 | borrow id |
Returns
Name | Type | Description |
---|---|---|
user | address | wallet address of user |
pid | uint256 | pool id of a loan |
tokenId | uint256 | Collateralized NFT token ID |
Last modified 1yr ago