KyberSwap Docs
  • Introduction to KyberSwap
  • Getting Started
    • Quickstart
      • FAQ
    • Supported Exchanges And Networks
    • Foundational Topics
      • Decentralized Finance
        • Tokens
        • Stablecoins
        • DEX/DeFi Aggregator
        • Slippage
        • Price Impact
        • Zap
        • Maximal Extractable Value (MEV)
      • Decentralized Technologies
        • Wallets
        • Dapps
        • RPC
        • Oracles
        • On-Chain vs Off-Chain Data
      • Other Valuable Resources
  • KyberSwap Solutions
    • KyberSwap Interface
      • User Guides
        • Connect Your Wallet
        • Switching Networks
        • Instantly Swap At Superior Rates
        • Swap At Your Preferred Rates
        • Cross-chain Swap
        • Add Your Favourite Tokens
        • Get Crypto With Fiat
        • Bridge Your Assets Across Multiple Chains
      • Profiles
        • Profile Creation
        • Profile Customization
        • Sync Profile Across Devices
      • Notifications
        • Notification Center
    • KyberSwap Aggregator
      • Concepts
        • Dynamic Trade Routing
      • User Guides
        • Instantly Swap At Superior Rates
      • Developer Guides
        • Execute A Swap With The Aggregator API
        • Upgrading To APIv1
      • Aggregator API Specification
        • EVM Swaps
        • Permit
      • Contracts
        • Aggregator Contract Addresses
      • DEX IDs
      • Subgraphs
      • FAQ
    • KyberSwap Zap as a Service
      • KyberSwap Zap as a Service (ZaaS) API
        • ZaaS HTTP API
        • ZaaS GRPC API
      • KyberSwap Zap Liquidity Widget
      • Zap Fee Model
      • Zap's Supported Chains/Dexes
      • Zap's Deployed Contract Addresses
      • Zap's DEX IDs
    • KyberSwap Widget
      • Developer Guides
        • Integrating The KyberSwap Widget
        • Customizing The KyberSwap Widget
      • iFrame Alternative
      • Widget/iFrame Fee
    • KyberSwap Liquidity Widget
      • Integrating The KyberSwap Liquidity Widget
    • Limit Order
      • Concepts
        • Off-Chain Relay, On-Chain Settlement
        • Gasless Cancellation
      • User Guides
        • Swap At Your Preferred Rates
        • Update Limit Orders
        • Cancel Limit Orders
      • Developer Guides
        • Create Limit Order
        • Gasless Cancel
        • Hard Cancel
        • Fill Limit Order
      • Contracts
        • Limit Order Contract Addresses
      • Limit Order API Specification
        • General APIs
        • Maker APIs
        • Taker APIs
      • FAQ
    • KyberSwap OnChain Price Service
    • Fee Schedule
  • Governance
    • KyberDAO
      • User Guides
        • Participating in KyberDAO
        • Staking
        • Voting
        • Stake KNC And Enjoy Gas Savings
      • Fees to KyberDAO
      • KyberDAO Operator MultiSig
      • Contracts
        • KyberDAO Contract Repo
        • KyberDAO Contract Addresses
      • FAQ - Others
    • KNC Token
      • KNC Tokenomics & Utility
      • Gas Refund Program
      • KNC Contract Addresses
  • Security
    • Audits
  • Reference
    • Legacy
      • KyberSwap Classic
        • Concepts
          • Programmable Pricing Curves
          • Dynamic Auto-Adjusting Fees
          • Virtual Balances
          • Protocol Fees
        • Contracts
          • Classic Contract Repo
          • Classic Contract Addresses
          • Classic Contract Farming Addresses
      • KyberSwap Elastic
        • Concepts
          • Concentrated Liquidity
          • Reinvestment Curve
          • Tick-Range Mechanism
          • Pool Process Flows
          • Anti-Sniping Mechanism
          • Tick-Based Farming
          • Elastic Zap
          • TWAP Oracle
          • Elastic APR Calculations
        • Contracts
          • Elastic Contract Repo
          • Elastic Contract Addresses
          • Elastic Farming Contract Addresses
          • Elastic Zap Contract Addresses
          • Elastic Core Contracts
          • Elastic Core Libraries
          • Elastic Periphery Core Contracts
          • Elastic Peripheral Library Contracts
          • Elastic Peripheral Base Contracts
        • Subgraphs
      • Whitepapers
      • Audits
      • KyberAI
        • KyberScore
        • Concepts
        • On-Chain Indicators
          • Number Of Trades
          • Trading Volume
          • Netflow To Whale Wallets
          • Netflow To CEX
          • Number Of Transfers
          • Volume Of Transfers
          • Number Of Holders
          • Top Holders
        • Technical Indicators
          • Live Charts
          • Support & Resistance Levels
          • Live Trades
          • Funding Rate On CEX
          • Liquidations On CEX
        • Liquidity Analysis
      • Elastic Legacy
        • Elastic Legacy Contract Repo
        • Elastic Legacy Contract Addresses
        • Elastic Legacy Farming Contract Addresses
        • Remove Elastic Legacy Liquidity
      • Protocol
        • Overview
        • Smart Contract Architecture
        • Trust and Security Model
      • Integrations
        • Getting Started
        • Use Cases
        • Integration Types
        • Smart Contracts
        • Ethers JS
        • RESTful API
        • Slippage Rate Protection
        • Price Feed Security
        • Contract Events
        • Platform Fees
      • Reserves
        • Getting Started
          • Overview
          • Why Develop On Kyber
          • Create New Reserve
          • Existing Reserves
          • Customising Existing Reserves
        • Development Guides
          • Fed Price Reserve
          • Automated Price Reserve
          • Reserves with Ganache
          • Orderbook Reserve
        • Operations
          • Listing Policies
          • Reserve IDs
          • Reserve Rebates
          • Sanity Rates
      • Addresses
        • Introduction
        • Mainnet
        • Kovan
        • Rinkeby
        • Ropsten
      • API/ABI
        • Introduction
        • RESTful API
          • RESTful API Overview
          • RESTful API
        • Core Smart Contracts
          • IKyberNetworkProxy
          • KyberNetworkProxy
          • IKyberNetwork
          • ISimpleKyberProxy
          • IKyberMatchingEngine
          • KyberMatchingEngine
          • IKyberHint
          • KyberHintHandler
          • IKyberHintHandler
          • IKyberFeeHandler
          • IKyberStaking
          • KyberStaking
          • IKyberDao
          • KyberDao
          • IKyberStorage
          • KyberStorage
          • IKyberHistory
          • KyberHistory
          • IKyberReserve
          • KyberReserve
          • ConversionRates
          • LiquidityConversionRates
          • EpochUtils
          • IEpochUtils
          • KyberFeeHandler
        • Contract ABIs
          • ABIs
        • Code Snippets
          • Token Quantity Conversion
        • Misc Contracts
          • KyberNetwork
          • ConversionRatesInterface
          • PermissionGroups
          • SanityRates
          • Withdrawable
          • OrderbookReserveInterface
          • OrderbookReserveLister
    • KyberSwap Operator MultiSig
    • Permitable Tokens
    • Third-Party Integrations
    • KyberSwap Analytics
    • KyberSwap App
    • GitHub
    • KyberSwap Analytics
    • KyberSwap Blog
    • Kyber Network Press Kit
  • Socials
    • X
    • Discord
    • Telegram
    • LinkedIn
    • Reddit
    • Instagram
    • Tik Tok
  • Support
    • KyberSwap Help Center
    • Complaints Handling Process
Powered by GitBook
On this page
  • contract KyberFeeHandler
  • INDEX​
  • REFERENCE​
  • function receive() external payable​

Was this helpful?

  1. Reference
  2. Legacy
  3. API/ABI
  4. Core Smart Contracts

KyberFeeHandler

PreviousIEpochUtilsNextContract ABIs

Last updated 2 years ago

Was this helpful?

You are referring to the Legacy version of KyberSwap docs.

For the most updated information, please refer to:

contract KyberFeeHandler

is , Utils5, DaoOperator, ReentrancyGuard\ imports Utils5, ReentrantcyGuard, , , , , IBurnableToken, ISanityRate, SafeMath, DaoOperator

Source:


INDEX

<AUTOGENERATED_TABLE_OF_CONTENTS>

REFERENCE

Events

FeeDistributed

Event for logging the rewards paid.


event FeeDistributed(IERC20 token, address platformWallet, uint256 platformFeeWei, uint256 rewardWei, uint256 rebateWei, address[] rebateWallets, uint256[] rebatePercentBpsPerWallet, uint256 burnAmtWei) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | token | contract IERC20 | ERC20 token address | | platformWallet | address | address receiving the platform fee | | platformFeeWei | uint256 | platform fees distributed in wei | | rewardWei | uint256 | rewards distributed in wei | | rebateWei | uint256 | rebates distributed in wei | | rebateWallets | address[] | address receiving the reabtes | | rebatePercentBpsPerWallet | uint256[] | rebate percentage in BPS per wallet | | burnAmtWei | uint256 | burned amount in wei | Signature: 0x53e2e1b5ab64e0a76fcc6a932558eba265d4e58c512401a7d776ae0f8fc08994

\

Event for logging the update of the BRR values.


event BRRUpdated(uint256 rewardBps, uint256 rebateBps, uint256 burnBps, uint256 expiryTimestamp, uint256 epoch) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | rewardBps | uint256 | reward settings in BPS | | rebateBps | uint256 | rebate settings in BPS | | burnBps | uint256 | burn settings in BPS | | expiryTimestamp | uint256 | timestamp when the settings will expire | | epoch | uint256 | epoch when the settings was set | Signature: 0x4b3150a36b957ed95a132721c7412af319174861da7c8c7a55ef6e1a2794528d

\

Event logging the receiving of ETH to the FeeHandler.


event EthReceived(uint256 amount) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | amount | uint256 | amount of ETH received in wei | Signature: 0x353bcaaf167a6add95a753d39727e3d3beb865129a69a10ed774b0b899671403

\

Event logging the setting of the KyberDao address.


event KyberDaoAddressSet(IKyberDao kyberDao) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | kyberDao | IKyberDao | KyberDao contract address | Signature: 0x6792eb8fe9de88d4eaaee7128e99aede17da98cd391520d3ec51a365804722c4

\

Event logging the setting of the burn configuration.


event BurnConfigSet(ISanityRate sanityRate, uint256 weiToBurn) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | sanityRate | ISanityRate | SanityRates contract address | | weiToBurn | uint256 | amount of wei to burn | Signature: 0xe40f97f23269c4682610e9b2522d6d4272ee56f115906d71fcb3da82a860f755

\

Event logging the removed rewards for burning.


event RewardsRemovedToBurn(uint256 epoch, uint256 rewardsWei) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | epoch | uin256 | epoch number when event was emitted | | rewardsWei | uint256 | removed rewards in wei to burn | Signature: 0x11c852d8be537f120b8d4b4d5c3c211870522fd96a8bd9fa51d102774077a51b

\

Event logging the the setting of the network contract address.


event KyberNetworkUpdated(address kyberNetwork) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | kyberNetwork | address | KyberNetwork contract address | Signature: 0x18970d46ac8a7d7e0da90e1bebb0be3e87ffc7705fc09d3bba5373d59b7a12aa

\

event logging the updating of the proxy contract address.


event KyberProxyUpdated(IKyberProxy kyberProxy) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | kyberProxy | IKyberProxy | IKyberProxy contract address | Signature: 0x8457f9bd0d13488a6c265af376d291f3c6bd2311d9e8dee5671d4169ca6e0ae0

\

Emits EthReceived event when ETH is received in the contract.


### `handleFees` Handles the fees when a trade happens in the network, unless the trade is not involving any fees. ___ function __handleFees__(IERC20 token, address[] rebateWallets, uint256[] rebateBpsPerWallet, address platformWallet, uint256 platformFee, uint256 networkFee) external payable override onlyKyberNetwork nonReentrant | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `token` | IERC20 | ERC20 token address | | `rebateWallets` | address[] | list of rebate wallets that will get rebate for this trade | | `rebateBpsPerWallet` | uint256[] | percentage of rebate for each wallet address out of total rebate | | `platformWallet` | address | wallet address receiving the platform fee | | `platformFee` | uint256 | fee amount in wei the platfrom wallet is entitled to | | `networkFee` | uint256 | fee amount in wei to be allocated for BRR | ### `claimStakerReward` Claim the staking rewards from KyberFeeHandler. ___ function __claimStakerReward__(address staker, uint256 epoch) external returns (uint256 amountWei) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `staker` | address | staker's address | | `epoch` | uin256 | which epoch is the staker claiming the reward | **Returns:**\ amountWei - The staking reward amount claimed in wei. ### `claimReserveRebate` Claim the rebates for the rebate wallet from KyberFeeHandler. ___ function __claimReserveRebate__(address rebateWallet) external returns (uint256 amountWei) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `rebateWallet` | address | address receiving the rebate | **Returns:**\ amountWei - The rebate amount claimed in wei. ### `claimPlatformFee` Claim the platform fees for the platform wallet from KyberFeeHandler. ___ function __claimPlatformFee__(address platformWallet) external returns (uint256 amountWei) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `platformWallet` | address | address receiving the platform fee | **Returns:**\ amountWei - The platform fee amount claimed in wei. ### `burnKnc` Burns KNC. The burn amount is limited. Forces block delay between burn calls. only externall owned accounts can call this function. ___ function __burnKnc__() external onlyNonContract returns (uint256 kncBurnAmount) **Returns:**\ kncBurnAmount - Amount of knc burned ### `makeEpochRewardBurnable` If no one voted for an epoch, no one will receive rewards, and the rewards instead will be marked for burning. ___ function __makeEpochRewardBurnable__(uint256 epoch) external | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `epoch` | uint256 | epoch number to check | ### `getSanityRateContracts` Returns a list of sanity rate contracts, where index 0 is the currently used contract address, and indexes > 0 are older versions. ___ function __getSanityRateContracts__() external view returns (ISanityRate[] sanityRates) **Returns:**\ sanityRates - SanityRates contract address ### `getLatestSanityRate` Return latest KNC/ETH rate from the SanityRates contract. ___ function __getLatestSanityRate__() external view returns (uint256 kncToEthSanityRate) | Parameter | Type | Description | **Returns:**\ kncToEthSanityRate - the KNC/ETH rate from SanityRates ### `getBRR` Gets the Burn, Rewards, Rebates values from the KyberDao and updates the FeeHandler BRR data. The burnBps value can be extrapolated since the rewardBps and rebateBps is known and the total BPS is 10000. ___ function __getBRR__() public returns (uint256 rewardBps, uint256 rebateBps, uint256 epoch) **Returns:**\ rewardBps - reward settings in BPS rebateBps - rebate settings in BPS epoch - epoch when the settings was set ### `readBRRData` Returns the the Burn, Rewards, Rebates values in BPS. The burnBps value can be extrapolated since the rewardBps and rebateBps is known and the total BPS is 10000. ___ function __readBRRData__() public view returns (uint256 rewardBps, uint256 rebateBps, uint256 expiryTimestamp, uint256 epoch) **Returns:**\ rewardBps, uint256 rebateBps, uint256 expiryTimestamp, uint256 epoch rewardBps - reward settings in BPS rebateBps - rebate settings in BPS expiryTimestamp - expiry timestamp in epoch time epoch - epoch when the settings was set

BRRUpdated

EthReceived

KyberDaoAddressSet

BurnConfigSet

RewardsRemovedToBurn

KyberNetworkUpdated

KyberProxyUpdated

Functions

receive

function receive() external payable

Classic
Elastic
Limit Order
Aggregator
IKyberFeeHandler
IKyberDao
IKyberFeeHandler
IKyberNetworkProxy
ISimpleKyberProxy
KyberFeeHandler.sol
​
​
​
​
​
​
​
​
​
​
​
​
​
​