ZivoeSwapper.sol
1INCH v5 Integration
Introduction
OneInchPrototype contract integrates with 1INCH to support custom data input.
State Variables
address
router1INCH_V5
The 1INCH v5 Router.
uint256
_ONE_FOR_ZERO_MASK
Private constant
uint256
_REVERSE_MASK
Private constant
OrderRFQ
This struct contains information for an OrderRFQ type transaction.
uint256
info
address
makerAsset
address
takerAsset
address
maker
address
allowedSender
uint256
makingAmount
uint256
takingAmount
SwapDescription
This struct contains information for a swap type transaction.
IERC20
srcToken
Source token.
IERC20
dstToken
Destination token.
address payable
srcReceiver
Source receiver.
address payable
dstReceiver
Destination receiver.
uint256
amount
Amount of srcToken.
uint256
minReturnAmount
Minimum amount returnable of dstToken.
uint256
flags
Additional flags for swap.
Sections
handle_validation_12aa3caf() - Will validate the data retrieved from 1inch API triggering a
swap()
function in 1inch router. The swap() function will execute a swap through multiple sources.handle_validation_e449022e() - Will validate the data retrieved from 1inch API triggering an
uniswapV3Swap()
function in 1inch router. TheuniswapV3Swap()
function will execute a swap through Uniswap V3 pools.handle_validation_0502b1c5() - Will validate the data retrieved from 1inch API triggering an unoswap() function in 1inch router.
handle_validation_3eca9c0a() - Will validate the data retrieved from 1inch API triggering a
fillOrderRFQ()
function in 1inch router.
convertAsset() - Executes a conversion via 1INCH v5.
Read Functions
handle_validation_12aa3caf()
handle_validation_12aa3caf()
Will validate the data retrieved from 1inch API triggering a swap()
function in 1inch router. The swap() function will execute a swap through multiple sources.
bytes
data
Payload for 1INCH v5 router, data regarding swap.
address
assetIn
The asset that will be converted.
address
assetOut
The asset that "assetIn" will be converted to.
uint256
amountIn
The amount of "assetIn" that will be converted.
handle_validation_e449022e()
handle_validation_e449022e()
Will validate the data retrieved from 1inch API triggering an uniswapV3Swap()
function in 1inch router. The uniswapV3Swap()
function will execute a swap through Uniswap V3 pools.
bytes
data
Payload for 1INCH v5 router, data regarding swap.
address
assetIn
The asset that will be converted.
address
assetOut
The asset that "assetIn" will be converted to.
uint256
amountIn
The amount of "assetIn" that will be converted.
handle_validation_0502b1c5()
handle_validation_0502b1c5()
Will validate the data retrieved from 1inch API triggering an unoswap() function in 1inch router.
bytes
data
Payload for 1INCH v5 router, data regarding swap.
address
assetIn
The asset that will be converted.
address
assetOut
The asset that "assetIn" will be converted to.
uint256
amountIn
The amount of "assetIn" that will be converted.
handle_validation_3eca9c0a()
handle_validation_3eca9c0a()
Will validate the data retrieved from 1inch API triggering a fillOrderRFQ()
function in 1inch router.
bytes
data
Payload for 1INCH v5 router, data regarding swap.
address
assetIn
The asset that will be converted.
address
assetOut
The asset that "assetIn" will be converted to.
uint256
amountIn
The amount of "assetIn" that will be converted.
Write Functions
convertAsset()
convertAsset()
Executes a conversion via 1INCH v5.
address
assetIn
The asset that will be converted.
address
assetOut
The asset that "assetIn" will be converted to.
uint256
amountIn
The amount of "assetIn" that will be converted.
bytes
data
Payload for 1INCH v5 router, data regarding swap.
Last updated