ZivoeSwapper.sol

1INCH v5 Integration

Introduction

OneInchPrototype contract integrates with 1INCH to support custom data input.

State Variables

TypeNameDescription

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.

TypeName

uint256

info

address

makerAsset

address

takerAsset

address

maker

address

allowedSender

uint256

makingAmount

uint256

takingAmount

SwapDescription

This struct contains information for a swap type transaction.

TypeNameDescription

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

Read Functions

  • 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. The uniswapV3Swap() 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.

Write Functions

Read Functions

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.

function handle_validation_12aa3caf(
    bytes calldata data, 
    address assetIn, 
    address assetOut, 
    uint256 amountIn
) internal view;
TypeNameDescription

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()

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.

function handle_validation_e449022e(
    bytes calldata data,
    address assetIn,
    address assetOut,
    uint256 amountIn
) internal;
TypeNameDescription

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()

Will validate the data retrieved from 1inch API triggering an unoswap() function in 1inch router.

function handle_validation_0502b1c5(
    bytes calldata data, 
    address assetIn, 
    address assetOut, 
    uint256 amountIn
) internal view;
TypeNameDescription

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()

Will validate the data retrieved from 1inch API triggering a fillOrderRFQ() function in 1inch router.

function handle_validation_3eca9c0a(
    bytes calldata data, 
    address assetIn, 
    address assetOut, 
    uint256 amountIn
) internal pure;
TypeNameDescription

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()

Executes a conversion via 1INCH v5.

function convertAsset(
    address assetIn,
    address assetOut,
    uint256 amountIn,
    bytes calldata data
) internal;
TypeNameDescription

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

Zivoe Finance - Official Documentation