1INCH-V4 - Fantom

On-chain DEX Aggregator. 1Inch-v4 connector on fantom triggers methods like oneInchSwap, _sell, sell. You can view details like source code, ABIs on Etherscan.

  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee to indicate ETH.
  • use -1 or dsa.maxValue for the maximum amount in function.
  • If not sure about the arguments getId and setId, pass 0.

OneInchSwap

spells.add({  connector: "1INCH-A",  method: "oneInchSwap",  args: [oneInchData, ftmAmt]});
Parameter Type Description
oneInchData OneInchData - contains data returned from 1inch API. Struct defined in interfaces.sol
ftmAmt uint256 - Ftm to swap for .value()

_sell

spells.add({  connector: "1INCH-A",  method: "_sell",  args: [oneInchData, setId]});
Parameter Type Description
oneInchData OneInchData Struct with multiple swap data defined in interfaces.sol
setId uint256 Set token amount at this ID in `InstaMemory` Contract.

Sell

Swap tokens from exchanges like kyber, 0x etc, with calculation done off-chain.

spells.add({  connector: "1INCH-A",  method: "sell",  args: [buyAddr, sellAddr, sellAmt, unitAmt, callData, setId]});
Parameter Type Description
buyAddr address The address of the token to buy.(For FTM: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
sellAddr address The address of the token to sell.(For FTM: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
sellAmt uint256 The amount of the token to sell.
unitAmt uint256 The amount of buyAmt/sellAmt with slippage.
callData bytes Data from 1inch API.
setId uint256 ID stores the amount of token brought.

If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.


Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.

Table of Contents