-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating native coins by native-to-native bridge using RewardByBlock contract #22
Comments
Unit tests were also added: https://github.com/poanetwork/poa-network-consensus-contracts/blob/35a618d1ebb60db60c6fd006f8a153be695c2cef/test/reward_by_block_test.js That function may only be called once for the same receiver until a new block is created (
|
https://github.com/varasev/test-block-reward repo has been updated to be able to rebuild contracts with Now if some contract code changes, we can recompile contracts with I'm going to update contracts in that setup to the current versions available in https://github.com/poanetwork/poa-network-consensus-contracts/tree/35a618d1ebb60db60c6fd006f8a153be695c2cef and make |
https://github.com/varasev/test-block-reward has been updated with the latest versions of smart contracts and complemented with |
Title
Abstract
When the bridge needs to generate native coins on POA Network side, it will be able to use
RewardByBlock
(BlockReward) smart contract, the support of which was added in Parity 1.11: openethereum/parity-ethereum#8419.RewardByBlock
contract allows pointingParity
at how many coins must be generated after creating of each block and on which addresses these coins must be accrued.Rationale
It is the easiest and possibly only way native coins can be generated for the bridge.
Implementation
We need to complement
RewardByBlock
by the possibility of accruing coins to the specified address(es).Smart contract of the bridge has to call some function of
RewardByBlock
, which will write the specified addresses and appropriate amounts of coins into contract's state. When a new block is being generated, andreward
function is being called, those addresses and amounts will have to be inreturn
statement ofreward
function and will have to be removed from contract's state.RewardByBlock
contract must control the address (msg.sender
) of the bridge's contract.The text was updated successfully, but these errors were encountered: