SinglePool
This contract is a single pool contract, where liquidity providers deposit/withdraw assets, and Plus Pool users bring or return utilized assets from a single pool.
Github Link: (Will be updated after official launch)
Contract adress after production is deployed (scope link)
Events
Read-Only Functions
State-Changing Functions
GiveReward
event GiveReward(address user, uint amount, uint lastIndex, uint rewardSum);
- Event log of when mined KSP is claimed and distributed
Deposit
event Deposit(address user, uint depositAmount, uint depositTokens, uint totalAmount, uint totalSupply);
- Event log of single pool liquidity additions
- Parameters
user
: user addressdepositAmount
: amount of tokens deposited by the userdepositTokens
: amount of single pool tokens depositedtotalAmount
: total amount of tokens depositedtotalSupply
: total amount of single pool tokens deposited
Withdraw
event Withdraw(address user, uint withdrawAmount, uint withdrawTokens, uint totalAmount, uint totalSupply);
- Event log of single pool liquidity removals
- Parameters
user
: User addresswithdrawAmount
: The amount of tokens removed by the userwithdrawTokens
: The amount of single pool tokens removed by the usertotalAmount
: Total amount of tokens depositedtotalSupply
: Total amount of single pool tokens deposited
Borrow
event Borrow(address user, address plusPoolAddress, uint borrowAmount, uint accountBorrows, uint totalBorrows);
- Event log of using assets utilized during plus deposit
- Parameters
user
: user addressplusPoolAddress
: Plus Pool addressborrowAmount
: The amount of tokens utilizedaccountBorrows
: Total amount of assets utilized by userstotalBorrows
: Total amount of single pool utilized
Repay
event Repay(address user, address plusPoolAddress, uint repayAmount, uint accountBorrows, uint totalBorrows);
- Event log of used assets are returned
- Parameters
user
: User addressplusPoolAddress
: PlusPool addressrepayAmount
: The amount of returned asset tokensaccountBorrows
: Total amount of assets utilized by userstotalBorrows
: Total amount of single pool utilized
- "I" + token name
- "i" + token symbol
decimals
- 18
token
- KIP7 token address
- mint/burn depending on liquidity addition/removal
- Number of LP tokens held by each address
- Status of approval to spender for each address
- Number of tokens held by contract
- KSP buyback & burn allocation ratio among utilization fees
- It is a value between 0 and 10^18, in units of 0.000000000000000001%
- Default - 200000000000000000
- Total Assets Utilized
- The ratio of KSPs distributed to a single pool mined by that pool
- It is a value between 0 and 10000, in units of 0.0001%
- SinglePoolFactory.mined() value at the last time the pair updated the index
function withdrawActive() public view returns (bool)
- Whether single pool withdrawal is possible
function depositActive() public view returns (bool)
- Whether single pool deposit is possible
function transfer(address _to, uint _value) public returns (bool)
- KIP7 Standard
- Method to transfer tokens
function transferFrom(address _from, address _to, uint _value) public returns (bool)
- KIP7 Standard
- Method to transfer tokens on behalf of the approved wallet
function approve(address _spender, uint _value) public returns (bool)
- KIP7 Standard
- Method to approve a transfer as much as value to spender
function depositKlay() public payable
- Method used to provide liquidity when token is KLAY
- Liquidity of the KLAY
msg.value
function depositKct(uint depositAmount) public
- Method used to provide liquidity when token is KIP7 standard token
- Liquidity of the number of deposit amount is provided
function withdraw(uint withdrawAmount)
- Method to withdraw tokens to
msg.sender
wallet. withdrawAmount
: Number of token amount to withdraw
function withdrawByAmount(uint withdrawTokens)
- Method to withdraw tokens to
msg.sender
wallet. withdrawTokens
: Number of SinglePool liquidity token amount to withdraw
function addReserves(uint addAmount) external payable
- Method to transfer tokens to using buyback KSP
addAmount
: Number of token
function claimReward() public
- Method that a user calls to claim the claimable KSP and airdrop that has accumulated for the pair
- When called, KSP is claimed from the Factory and paid to
msg.sende
- Even if the method is not called directly, it is automatically called when the SinglePool token balance of the user’s wallet changes.
- When liquidity is added
- When liquidity is removed
Last modified 7mo ago