YEARN
v2
v2
  • Introduction to Yearn
  • FAQ
  • DeFi Glossary
  • How-To Guides
    • How to Add a Custom Token to MetaMask
    • How To Make a YIP
    • How to Mint yUSD
    • How To Participate in a yVault
    • How to Understand CRV Vote Locking
    • How To Understand yVault ROI
    • How To Withdraw from yEarn and yVaults
  • YFI and yTokens
  • yUSD
  • Products
    • yVaults
      • V2 yVaults
        • Strategies and yVaults available
      • V1 yVaults
    • Earn
    • Zap
    • yInsure
    • yGift
  • R&D
    • yBorrow
    • yLiquidate
    • ySwap
    • yTrade
    • Delegated Funding DAO Vaults
    • StableCredit
  • Developers
    • Naming Conventions
    • Deployed Contracts Registry
    • Code Repositories
    • Integration Guide
    • yVaults Documentation
      • Vaults Overview
      • Vault Interfaces
    • Misc Resources
      • YIP Boilerplate
      • Admin Access Policy
      • Smart Contract API
        • APR
        • iToken
        • Zap
      • Smart Contract Integration
        • 1split
        • aave
        • apr
        • aprmap
        • aprmapwithpool
        • aprwithpool
        • compound
        • curvefi
        • dydx
        • fulcrum
        • imanage
        • interface
        • itoken
        • uniswap
        • uniswapapr
        • uniswaproi
        • ybtc
        • ybusd
        • ycrv
        • ydai
        • ysusd
        • ytusd
        • yusdc
        • yusdt
        • zap
  • Additional Resources
    • Team
    • Github
    • Medium
    • Gov Forum
    • Discord
    • Telegram
    • Reddit
  • Contributors
    • Contribute
    • Contributor Tools
    • Writing Style Guide
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Misc Resources
  3. Smart Contract Integration

1split

Contract

Address

1split.eth

1split.eth Interface

// Solidity Interface

interface IOneSplit {

    function getExpectedReturn(
        address fromToken,
        address toToken,
        uint256 amount,
        uint256 parts,
        uint256 disableFlags // 1 - Uniswap, 2 - Kyber, 4 - Bancor, 8 - Oasis, 16 - Compound, 32 - Fulcrum, 64 - Chai, 128 - Aave, 256 - SmartToken
    )
        external
        view
        returns(
            uint256 returnAmount,
            uint256[] memory distribution // [Uniswap, Kyber, Bancor, Oasis]
        );

    function swap(
        address fromToken,
        address toToken,
        uint256 amount,
        uint256 minReturn,
        uint256[] calldata distribution, // [Uniswap, Kyber, Bancor, Oasis]
        uint256 disableFlags // 16 - Compound, 32 - Fulcrum, 64 - Chai, 128 - Aave, 256 - SmartToken
    )
        external
        payable;

    function goodSwap(
        address fromToken,
        address toToken,
        uint256 amount,
        uint256 minReturn,
        uint256 parts,
        uint256 disableFlags // 1 - Uniswap, 2 - Kyber, 4 - Bancor, 8 - Oasis, 16 - Compound, 32 - Fulcrum, 64 - Chai, 128 - Aave, 256 - SmartToken
    )
        external
        payable;
}
PreviousSmart Contract IntegrationNextaave

Last updated 4 years ago

Was this helpful?

1split.eth