KyberDeveloper · Powering Liquidity for the Ecosystem

KyberDeveloper · Powering Liquidity for the Ecosystem

  • Home
  • Integrations
  • Reserves
  • KyberPRO
  • Addresses
  • API/ABI
  • Trade Debugger
  • Tracker
  • GitHub

›Core Smart Contracts

Getting Started

  • Introduction

RESTful API

  • RESTful API Overview
  • RESTful API

Widgets

  • Widgets Overview
  • KyberWidget
  • Sign In Widget

Core Smart Contracts

  • IKyberNetworkProxy
  • KyberNetworkProxy
  • IKyberNetwork
  • ISimpleKyberProxy
  • IKyberMatchingEngine
  • KyberMatchingEngine
  • IKyberHint
  • KyberHintHandler
  • IKyberFeeHandler
  • KyberFeeHandler
  • IKyberStaking
  • KyberStaking
  • IKyberDao
  • KyberDao
  • IKyberStorage
  • KyberStorage
  • IKyberHistory
  • KyberHistory
  • IKyberReserve
  • KyberReserve
  • ConversionRates
  • LiquidityConversionRates
  • IEpochUtils
  • EpochUtils

Contract ABIs

  • ABIs

Plugins

  • Plugins Overview
  • WooCommerce Plugin

Code Snippets

  • Token Quantity Conversion

Misc Contracts

  • KyberNetwork
  • ConversionRatesInterface
  • OrderbookReserveInterface
  • PermissionGroups
  • SanityRates
  • SanityRatesInterface
  • Withdrawable

ISimpleKyberProxy

interface ISimpleKyberProxy

imports IERC20

Source: ISimpleKyberProxy.sol


INDEX

  • swapTokenToEther
  • swapEtherToToken
  • swapTokenToToken

REFERENCE

Functions

swapTokenToEther

Execute a simple ETH -> ERC20 token trade.


function swapTokenToEther(IERC20 token, uint256 srcAmount, uint256 minConversionRate) external returns (uint256 destAmount)

ParameterTypeDescription
tokenIERC20destination ERC20 token contract address
srcAmountuint256source ERC20 token amount in its token decimals
minConversionRateuint256minimum conversion rate; trade is canceled if actual rate is lower

Returns:
destAmount - Amount of actual destination ETH wei


swapEtherToToken

Execute a simple ERC20 token -> ETH trade.


function swapEtherToToken(IERC20 token, uint256 minConversionRate) external returns (uint256 destAmount)

ParameterTypeDescription
tokenIERC20destination ERC20 token contract address
minConversionRateuint256minimum conversion rate; trade is canceled if actual rate is lower

Returns:
destAmount - Amount of actual destination tokens in twei


swapTokenToToken

Makes a simple ERC20 -> ERC20 token trade.


function swapTokenToToken(IERC20 src, uint256 srcAmount, IERC20 dest, uint256 minConversionRate) external returns (uint256 destAmount)

ParameterTypeDescription
srcIERC20source ERC20 token contract address
srcAmountuint256wei amount of source ERC20 token
destIERC20destination ERC20 token contract address
minConversionRateuint256minimum conversion rate; trade is canceled if actual rate is lower

Returns:
destAmount - Amount of actual destination tokens in twei

← KyberNetworkIKyberMatchingEngine →
  • INDEX
  • REFERENCE
    • Functions
    • swapTokenToEther
    • swapEtherToToken
    • swapTokenToToken
KyberDeveloper · Powering Liquidity for the Ecosystem
EssentialsGetting StartedDesign PrinciplesProtocol OverviewSmart Contract Architecture
IntegrationsDAppsVendorsWalletsPlatform Fees
ReservesFed PriceAutomated Price
© 2019 Kyber Network. All rights reserved.
Follow us on Facebook
Follow us on Twitter
Follow us on Github
Follow us on Reddit
Join our Telegram group
Subscribe to our Youtube channel
Read our blog on Medium