State-Changing Functions
transfer
Copy function transfer ( address _to , uint _value ) public returns ( bool )
Method to transfer KSP tokens
transferFrom
Copy function transferFrom ( address _from , address _to , uint _value ) public returns ( bool )
Method to transfer tokens on behalf of the approved wallet
approve
Copy function approve ( address _spender , uint _value ) public returns ( bool )
Method to approve a transfer as much as value to spender
changeNextOwner
Copy function changeNextOwner ( address _nextOwner ) public
Method to set the next Owner in advance before changing Owner
changeOwner
Copy function changeOwner () public
Method for the next Owner to change the actual Owner
changeCreateFee
Copy function changeCreateFee ( uint _createFee ) public
Method that changes KSP fees when liquidity pairs are added
changeTeamWallet
Copy function changeTeamWallet ( address _teamWallet ) public
Method to change the developer wallet
changePoolFee
Copy function changePoolFee ( address tokenA , address tokenB , uint fee) public
Method to change transaction fees for each liquidity pair
changeMiningRate
Copy function changeMiningRate ( address [] memory tokenA , address [] memory tokenB , uint [] memory rate) public
Method to change the mining weight per liquidity pair
All pairs for mining must be changed at once
The rate of each pair is between 1 and 100
The sum of rates for all pairs is 100
Parameters
tokenA
: list of addresses of the first token pair
tokenB
: list of addresses of the second token pair
rate
: list of mining rate for a pair
claimTeamAward
Copy function claimTeamAward () public
Method to claim the accrued quantity that the developer has
createKlayPool
Copy function createKlayPool ( address token , uint amount , uint fee) public payable
A method called to add a liquidity pair with one side as KLAY
The wallet that calls this must have KSP greater than or equal to createFee
Token for when the KLAY-KIP7 pair to be registered has never been registered before
Parameters
token
: KIP7 token address to add liquidity
amount
: the amount of tokens (KIP7) to be provided for the initial liquidity
fee
: Sets the initial fee value for liquidity pairs
A value between 0 and 100
Meaning: 0 -> 0%, 100 -> 1%
msg.value
: KLAY quantity to initially supply liquidity
Delivers the transaction value without specifying otherwise
createKctPool
Copy function createKctPool ( address tokenA , uint amountA , address tokenB , uint amountB , uint fee) public
Method called to add liquidity pair in case of KIP7 token pair
The wallet calling the KSP above createFee must have it.
parameter
tokenA
: The address of the first token
amountA
: The quantity of the first token that supplies the initial liquidity
tokenB
: The address of the second token
amountB
: The quantity of the second token that supplies the initial liquidity
fee
: Sets the initial fee value for liquidity pairs
exchangeKlayPos
Copy function exchangeKlayPos ( address token , uint amount , address [] memory path) public payable
Method to call when token to be paid is KLAY and a POS transaction is desired
Parameters
token
: Address of the KIP7 to be recieved
amount
: the minimum amount tokens that you want to receive
If the amount of tokens to be received is lower than this amount, the Tx will fail.
path
: list of token addresses to go through for routing transactions
If routing transaction is not needed, submit empty list
msg.value
: KLAY quantity to be paid
exchangeKctPos
Copy function exchangeKctPos ( address tokenA , uint amountA , address tokenB , uint amountB , address [] memory path) public
Method called when the token to be paid is KIP7 and a POS transaction is desired
Parameters
tokenA
: address of token to be paid
amountA
: the amount of tokens to be paid
tokenB
: address of token to be received
amountB
: the minimum amount of tokens that you want to receive
If the amount of tokens to be received is lower than this amount, the Tx will fail.
path
:list of token addresses to go through for routing transactions
If routing transaction is not needed, submit empty list
exchangeKlayNeg
Copy function exchangeKlayNeg ( address token , uint amount , address [] memory path) public payable
Method for executing a NEG transaction by paying KLAY
Parameters
token
: address of tokens to be received
amount
: quantity of tokens to be received
path
: list of token addresses to go through for routing transactions
If routing transaction is not needed, submit empty list
msg.value
: maximum amount of payable KLAY
If more KLAY than the corresponding quantity needs to be paid, theTx will fail
the difference with KLAY used in the actual transaction is returned to msg.sender
exchangeKctNeg
Copy function exchangeKctNeg ( address tokenA , uint amountA , address tokenB , uint amountB , address [] memory path) public
Method for executing NEG transaction by paying KIP7
Parameters
tokenA
: address of token to be paid
amountA
: the maximum amount of tokenA that can be paid
If more tokenA than the corresponding amount is needed, the Tx will fail.
tokenB
: address of the token to be received
amountB
: the amount of tokens to be received
path
: list of token addresses to go through for routing transactions
If routing transaction is not needed, submit empty list