github.com/codingfuture/orig-energi3@v0.8.4/energi/contracts/src/StakerRewardV1.sol (about)

     1  // Copyright 2019 The Energi Core Authors
     2  // This file is part of Energi Core.
     3  //
     4  // Energi Core is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // Energi Core is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU General Public License
    15  // along with Energi Core. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  // Energi Governance system is the fundamental part of Energi Core.
    18  
    19  // NOTE: It's not allowed to change the compiler due to byte-to-byte
    20  //       match requirement.
    21  pragma solidity 0.5.16;
    22  //pragma experimental SMTChecker;
    23  
    24  import { GlobalConstants } from "./constants.sol";
    25  import { IGovernedContract, GovernedContract } from "./GovernedContract.sol";
    26  import { IBlockReward } from "./IBlockReward.sol";
    27  
    28  /**
    29   * Genesis hardcoded version of SporkReward
    30   *
    31   * NOTE: it MUST NOT change after blockchain launch!
    32   */
    33  contract StakerRewardV1 is
    34      GlobalConstants,
    35      GovernedContract,
    36      IBlockReward
    37  {
    38      // IGovernedContract
    39      //---------------------------------
    40      // solium-disable-next-line no-empty-blocks
    41      constructor(address _proxy) public GovernedContract(_proxy) {}
    42  
    43      // IBlockReward
    44      //---------------------------------
    45      function reward() external payable {
    46          block.coinbase.transfer(msg.value);
    47      }
    48  
    49      function getReward(uint _blockNumber)
    50          external view
    51          returns(uint amount)
    52      {
    53          if (_blockNumber > 0) {
    54              amount = REWARD_STAKER_V1;
    55          }
    56      }
    57  
    58      // Safety
    59      //---------------------------------
    60      function () external payable {
    61          revert("Not supported");
    62      }
    63  }