Giter Club home page Giter Club logo

block-reward's Issues

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.