SanityRates
You are referring to the Legacy
version of KyberSwap docs.
For the most updated information, please refer to:
contract SanityRates
is SanityRatesInterface, Withdrawable, Utils\ imports ERC20Interface, Withdrawable, Utils, SanityRatesInterface
Source: SanityRates.sol
The SanityRates contract's role is provide a safeguard for reserves whereby trades are disabled in the event exchange rates fall below the lower limit or rise above the upper limit of the sanity rates.
INDEX
<AUTOGENERATED_TABLE_OF_CONTENTS>
REFERENCE
Functions
SanityRates
SanityRates
Contract constructor. Note that constructor methods are called exactly once during contract instantiation and cannot be called again.
function SanityRates(address _admin) public | Parameter | Type | Description | | ----------|:-------:|:--------------------:| | _admin
| address | address of the admin |
getSanityRate
getSanityRate
Gets the sanity rate for a pair of tokens.
function getSanityRate(ERC20 src, ERC20 dest) public view returns (uint) | Parameter | Type | Description | | --------- |:-----:|:----------------------------------------:| | src
| ERC20 | source ERC20 token contract address | | dest
| ERC20 | destination ERC20 token contract address | Returns:\ The sanity rate for the pair of tokens
Web3 Example:
setReasonableDiff
setReasonableDiff
Set reasonable conversion rate difference in percentage (any conversion rate outside of this range is considered unreasonable).
function setReasonableDiff(ERC20[] srcs, uint[] diff) public | Parameter | Type | Description | | --------- |:-----:|:-----------------------------------------------:| | srcs
| ERC20[] | list of source ERC20 token contract addresses | | diff
| uint[] | list of reasonableDiffs in basis points (bps)
1 bps = 0.01%
Modifiers: onlyAdmin |
Web3 Example:
setSanityRates
setSanityRates
Sets the sanity rate for a list of tokens.
function setSanityRates(ERC20[] srcs, uint[] rates) public | Parameter | Type | Description | | --------- |:-------:|:---------------------------------------------:| | srcs
| ERC20[] | list of source ERC20 token contract addresses | | rates
| uint[] | list of rates in ETH wei | Modifiers: onlyOperator
Web3 Example:
Last updated