Skip to content
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

ExampleBlockReward.sol has incorrect configuration for specific genesis.json setups #6

Open
chris-shyft opened this issue Jan 29, 2021 · 0 comments

Comments

@chris-shyft
Copy link

chris-shyft commented Jan 29, 2021

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant