openethereum / block-reward Goto Github PK
View Code? Open in Web Editor NEWBlock reward contract interface
License: Apache License 2.0
Block reward contract interface
License: Apache License 2.0
I'm trying to understand the block reward contract for use in a private PoA network. What I basically want is to give a validator 1 Ether for each block they produce. Is it correct that I just have to change this line:
https://github.com/parity-contracts/block-reward/blob/3bcc898dbf7e9ca7491a797c22d2f1b65903bd46/contracts/ExampleBlockReward.sol#L48
to 1000000000000000000 Wei (1 Ether)?
edit: Yes, it does.
The constructor within ExampleBlockReward.sol, where it takes in the "systemaddress" rather than directly using the commented out code
constructor(address _systemAddress) public { /* systemAddress = 0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE; */ systemAddress = _systemAddress; }
This will fail on a production environment with the equivalent of:
"blockRewardContractAddress": "0x000000000000000000000000000000073410f33D",
"blockRewardContractTransition": "0x0",
(with the bytecode being set within the "accounts" subsection & associating the bytecode with the 0x....000073410f33D" address)
as the parameter that is passed through will be incorrect, and indeed even msg.sender in the constructor will return "0x000000000000000000000000000000073410f33D", which is not the system address that will be required to be checked in subsequent reward()
calls (which does indeed come from 0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE).
My suggestion is to specifically rename this file to a "RopstenExampleBlockReward" or the equivalent, with the "ExampleBlockReward" having the constructor parameter removed & the system address association uncommented.
I should note that this is more than likely an issue that wasn't spotted on Ropsten due to genesis.json configuration - in my tests the Ropsten ExampleBlockReward.sol (with those constructor parameters) will not complain if the bytecode is placed in a blockRewardContractCode
vs the blockRewardContractAddress
parameter (probably due to the call type difference).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.