onExecuteAffirmation should call distributeFeeFromAffirmation that will call addBridgeNativeFeeReceivers. It is not needed to call addBridgeNativeFeeReceivers for every validator.
onSignaturesCollected should calculate fee value, call distributeFeeFromSignatures. The latter will call addBridgeNativeFeeReceivers to schedule the minting of new coins for the network validators and stakers.
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 toaddBridgeNativeFeeReceivers
(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:
from the foreign chain to the home chain:
onExecuteAffirmation
should calldistributeFeeFromAffirmation
that will calladdBridgeNativeFeeReceivers
. It is not needed to calladdBridgeNativeFeeReceivers
for every validator.from the home chain to the foreign chain:
onSignaturesCollected
should calculate fee value, calldistributeFeeFromSignatures
. The latter will calladdBridgeNativeFeeReceivers
to schedule the minting of new coins for the network validators and stakers.