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

     1  // This file is part of Energi Core.
     2  //
     3  // Energi Core is free software: you can redistribute it and/or modify
     4  // it under the terms of the GNU General Public License as published by
     5  // the Free Software Foundation, either version 3 of the License, or
     6  // (at your option) any later version.
     7  //
     8  // Energi Core is distributed in the hope that it will be useful,
     9  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    11  // GNU General Public License for more details.
    12  //
    13  // You should have received a copy of the GNU General Public License
    14  // along with Energi Core. If not, see <http://www.gnu.org/licenses/>.
    15  
    16  // Energi Governance system is the fundamental part of Energi Core.
    17  
    18  // NOTE: It's not allowed to change the compiler due to byte-to-byte
    19  //       match requirement.
    20  pragma solidity 0.5.16;
    21  //pragma experimental SMTChecker;
    22  
    23  import { IGovernedContract } from "./IGovernedContract.sol";
    24  
    25  /**
    26   * Base for contract storage (SC-14).
    27   *
    28   * NOTE: it MUST NOT change after blockchain launch!
    29   */
    30  contract StorageBase {
    31      address payable internal owner;
    32  
    33      modifier requireOwner {
    34          require(msg.sender == address(owner), "Not owner!");
    35          _;
    36      }
    37  
    38      constructor() public {
    39          owner = msg.sender;
    40      }
    41  
    42      function setOwner(IGovernedContract _newOwner) external requireOwner {
    43          owner = address(_newOwner);
    44      }
    45  
    46      function kill() external requireOwner {
    47          selfdestruct(msg.sender);
    48      }
    49  }