LogoLogo
User DocsDeveloper DocsHow-To Guides
  • ➡️Start Here
  • 🚧Disclaimer
  • User Docs
    • Introduction
    • Fund Overview
    • zVLT
    • Tranches
    • ZVE Token
  • How-To Guides
    • Complete KYC/KYB
    • Mint Tranche Tokens
    • Stake Tranche Tokens
  • Developer Docs
    • Contract Addresses
    • Core Contracts
      • ZivoeDAO.sol
      • ZivoeGlobals.sol
      • ZivoeGovernorV2.sol
      • ZivoeITO.sol
      • ZivoeLocker.sol
      • ZivoeMath.sol
      • ZivoeRewards.sol
      • ZivoeRewardsVesting.sol
      • ZivoeToken.sol
      • ZivoeTranches.sol
      • ZivoeTrancheToken.sol
      • ZivoeYDL.sol
    • Lockers
      • OCC_Modular.sol
      • OCE_ZVE.sol
      • OCL_ZVE.sol
      • OCR_Modular.sol
      • OCT_DAO.sol
      • OCT_YDL.sol
      • OCT_ZVL.sol
      • OCY_Convex_A.sol
      • OCY_Convex_B.sol
      • OCY_Convex_C.sol
      • OCY_OUSD.sol
      • ZivoeSwapper.sol
  • Official Links
    • Audits
    • Website
    • Twitter
    • Telegram
    • Blog
    • Discord
  • Terms
    • Terms Of Use / Privacy Policy
    • Reg S Compliance
Powered by GitBook

Zivoe Finance - Official Documentation

On this page
  • Introduction
  • Sections
  • Read Functions
  • Write Functions
  1. Developer Docs
  2. Lockers

ZivoeSwapper.sol

1INCH v5 Integration

Introduction

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

State Variables

Type
Name
Description

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.

Type
Name

uint256

info

address

makerAsset

address

takerAsset

address

maker

address

allowedSender

uint256

makingAmount

uint256

takingAmount

SwapDescription

This struct contains information for a swap type transaction.

Type
Name
Description

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

  • convertAsset() - Executes a conversion via 1INCH v5.

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;
Type
Name
Description

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;
Type
Name
Description

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;
Type
Name
Description

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;
Type
Name
Description

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;
Type
Name
Description

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.

PreviousOCY_OUSD.solNextAudits

Last updated 10 months ago