FCT_Ext_TokensValidator
Smart contract that adds the ability to compare values within FCT execution
The values ins and value out supports decimals, making it easy to support various ERC20 tokens.
The comparison is done with normalized values, meaning that 2 USCD (2,000,000 at the blockchain level) will be bigger than 1 Kiro (1,000,000,000,000,000,000 at the blockchain level), because USDC's decimal is 6, comparing to 18 in case of KIRO.
Main Functions
greaterThan
Reverts when amount1/(10^decimals) <= amount2/(10^decimals) Returns amount1 - amount2 normalized to decimalsOut otherwise
greaterThanEqual
Reverts when amount1/(10^decimals) < amount2/(10^decimals) Returns amount1 - amount2 normalized to decimalsOut otherwise
lessThan
Reverts when amount1/(10^decimals) >= amount2/(10^decimals) Returns amount2 - amount1 normalized to decimalsOut otherwise
lessEqual
Reverts when amount1/(10^decimals) > amount2/(10^decimals) Returns amount2 - amount1 normalized to decimalsOut otherwise
between
Reverts when amountIn/(10^decimals) <= minAmount/(10^decimals) or amountIn/(10^decimals) > =maxAmount/(10^decimals) Returns amountMax - amountMin normalized to decimalsOut otherwise
betweenEqual
Reverts when amountIn/(10^decimals) < minAmount/(10^decimals) or amountIn/(10^decimals) > maxAmount/(10^decimals) Returns amountMax - amountMin normalized to decimalsOut otherwise
equal
Reverts when amount1/(10^decimals) != amount2/(10^decimals) Returns amount1 normalized to decimalsOut otherwise
Last updated