omni / tokenbridge-contracts

Smart contracts for TokenBridge
http://docs.tokenbridge.net
GNU General Public License v3.0
230 stars 228 forks source link

Fee Manager for `erc-to-native` bridge in POSDAO chain #159

Closed akolotov closed 5 years ago

akolotov commented 5 years ago

As per requirement for the erc-to-native bridge every time when the fee for transferring assets needs to be distributed it is necessary to pass the request to addBridgeNativeFeeReceivers (https://github.com/poanetwork/posdao-contracts/blob/71c742bd2c4f84c8cc9a77bac78a39c5e2d1ae7c/contracts/abstracts/BlockRewardBase.sol#L48) of the block reward contract. This method will schedule the fee distribution among the network validators and stakers.

So, overall logic will as the following:

  1. from the foreign chain to the home chain:

    • onExecuteAffirmation should call distributeFeeFromAffirmation that will call addBridgeNativeFeeReceivers. It is not needed to call addBridgeNativeFeeReceivers for every validator.
  2. from the home chain to the foreign chain:

akolotov commented 5 years ago

Available in the release 2.3.0