0x00000002 / rootcore

Apache License 2.0
0 stars 1 forks source link

use of constant is deprecated #16

Open gabriel-canaan opened 6 years ago

gabriel-canaan commented 6 years ago

rootcore/blob/master/contracts/CrowdsaleController.sol Line 21-26,31,32,35-37,125

uint256 public constant DURATION = 14 days; 
uint256 public constant TOKEN_PRICE_N = 1;
uint256 public constant TOKEN_PRICE_D = 1000;    
uint256 public constant MAX_GAS_PRICE = 50000000000 wei;   
uint256 public constant MAX_CONTRIBUTION = 40 ether;       
uint256 public constant SOFTCAP_GRACE_DURATION = 10;//86400;   
uint256 public TOTAL_ETHER_CAP = 110000 ether;             
uint256 public TOTAL_ETHER_SOFT_CAP = 100000 ether;
uint256 public constant PRESALE_DURATION = 14 days;              
uint256 public constant PRESALE_MIN_CONTRIBUTION = 200 ether;
string public constant TOKEN_NAME = "Rootcoin"; 
string public constant TOKEN_SYM = "RCT";       
uint8 public constant TOKEN_DEC = 18;
function computeReturn(uint256 _contribution) public constant returns (uint256) {
        // return safeMul(_contribution, TOKEN_PRICE_D) / TOKEN_PRICE_N;
        return safeMul(_contribution, TOKEN_PRICE_D) / TOKEN_PRICE_N;
    }

rootcore/blob/master/contracts/helpers/TestUtils.sol Line 12,16,20

    function testSafeAdd(uint256 _x, uint256 _y) public constant returns (uint256) {
        return super.safeAdd(_x, _y);
    }
    function testSafeSub(uint256 _x, uint256 _y) public constant returns (uint256) {
        return super.safeSub(_x, _y);
    }
    function testSafeMul(uint256 _x, uint256 _y) public constant returns (uint256) {
        return super.safeMul(_x, _y);
    }

rootcore/blob/master/contracts/helpers/TestUtils.sol Line 8-13

function name() public constant returns (string name) { name; }
    function symbol() public constant returns (string symbol) { symbol; }
    function decimals() public constant returns (uint8 decimals) { decimals; }
    function totalSupply() public constant returns (uint256 totalSupply) { totalSupply; }
    function balanceOf(address _owner) public constant returns (uint256 balance) { _owner; balance; }
    function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { _owner; _spender; remaining; }

rootcore/blob/master/contracts/interfaces/IOwned.sol Line 8

function owner() public constant returns (address owner) { owner; }
gabriel-canaan commented 6 years ago

constant is deprecated in favor of two new and more specific modifiers. We suggest replacing it with view or pure.