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

IKyberStaking

interface IKyberStaking

is IEpochUtils imports IEpochUtils

Source: IKyberStaking.sol


INDEX

  • Delegated
  • Deposited
  • Withdraw
  • deposit
  • delegate
  • withdraw
  • getStakerData
  • getLatestStakerData
  • getStakerRawData

REFERENCE

Events

Delegated

Event for logging the delegation to a representative.


event Delegated(address staker, address representative, uint256 epoch, bool isDelegated)

ParameterTypeDescription
stakeraddressstaker's address
representativeaddressrepresentative's address delegated to
epochuint256epoch number where delegation happens
isDelegatedbooltrue if staker has delegated to a new representative, otherwise false

Signature: 0xfbb976ae5268347766b726bd1edba29af0fe16f9c505fbd3b9a10cb6d00cfa3d


Deposited

Event for logging the deposit of KNC into the staking contract.


event Deposited(uint256 curEpoch, address staker, uint256 amount)

ParameterTypeDescription
curEpochuint256current epoch number where KNC was deposited
stakeraddressstaker's address
amountuint256amount of KNC deposited in twei

Signature: 0x1599c0fcf897af5babc2bfcf707f5dc050f841b044d97c3251ecec35b9abf80b


Withdraw

Event for logging the withdrawal of KNC from the staking contract.


event Withdraw(uint256 curEpoch, address staker, uint256 amount)

ParameterTypeDescription
curEpochuint256current epoch number where KNC was deposited
stakeraddressstaker's address
amountuint256amount of KNC withdrawn in twei

Signature: 0x9da6493a92039daf47d1f2d7a782299c5994c6323eb1e972f69c432089ec52bf


Functions

deposit

Deposit and stake KNC.


function deposit(uint256 amount) external

ParameterTypeDescription
amountuint256amount of KNC to deposit in twei


delegate

Sets the delegation to a representative, and only takes effect on the next epoch


function delegate(address dAddr) external

ParameterTypeDescription
dAddraddressrepresentative's address to delegate to


withdraw

Unstakes and withdraws KNC from the staking contract.


function withdraw(uint256 amount) external

ParameterTypeDescription
amountuint256amount of KNC to withdraw in twei


getStakerData

Iterates through all the epochs and returns the staker data up to current epoch + 1.


function getStakerData(address staker, uint256 epoch) external returns (uint256 stake, uint256 delegatedStake, address representative)

ParameterTypeDescription
stakeraddressstaker's address
epochuint256epoch number to start iterating from to get staker data

Returns:
stake - total amount of KNC staked in twei delegatedStake - amount of KNC delegated to the staker's address in twei representative - if the staker is delegating, this shows the address he is delegating to


getLatestStakerData

Returns the staker data for the latest epoch.


function getLatestStakerData(address staker) external returns (uint256 stake, uint256 delegatedStake, address representative)

ParameterTypeDescription
stakeraddressstaker's address

Returns:
stake - total amount of KNC staked in twei delegatedStake - amount of KNC delegated to the staker's address in twei representative - if the staker is delegating, this shows the address he is delegating to


getStakerRawData

Returns the raw staker data up to current epoch + 1. Returns 0 values if staker data is uninitialized.


function getStakerRawData(address staker, uint256 epoch) external returns (uint256 stake, uint256 delegatedStake, address representative)

ParameterTypeDescription
stakeraddressstaker's address
epochuint256epoch number to get staker raw data

Returns:
stake - total amount of KNC staked in twei delegatedStake - amount of KNC delegated to the staker's address in twei representative - if the staker is delegating, this shows the address he is delegating to

← KyberFeeHandlerKyberStaking →
  • INDEX
  • REFERENCE
    • Events
    • Delegated
    • Deposited
    • Withdraw
    • Functions
    • deposit
    • delegate
    • withdraw
    • getStakerData
    • getLatestStakerData
    • getStakerRawData
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