Consensys / Tokens

Ethereum Token Contracts
MIT License
2.06k stars 1.2k forks source link

Clean up compiler warnings #85

Closed maurelian closed 7 years ago

maurelian commented 7 years ago

More recent versions of solidity are issuing warnings about various deprecations.

These are not a safety concern, but it does look scary to new comers, so we should fix it.

maurelian commented 7 years ago

Specifially, when running solc ./contracts/*.sol at version 0.4.17 or newer, you get this:

./contracts/Token.sol:20:5: Warning: No visibility specified. Defaulting to "public".
    function balanceOf(address _owner) constant returns (uint256 balance);
    ^--------------------------------------------------------------------^
./contracts/Token.sol:26:5: Warning: No visibility specified. Defaulting to "public".
    function transfer(address _to, uint256 _value) returns (bool success);
    ^--------------------------------------------------------------------^
./contracts/Token.sol:33:5: Warning: No visibility specified. Defaulting to "public".
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
    ^---------------------------------------------------------------------------------------^
./contracts/Token.sol:39:5: Warning: No visibility specified. Defaulting to "public".
    function approve(address _spender, uint256 _value) returns (bool success);
    ^------------------------------------------------------------------------^
./contracts/Token.sol:44:5: Warning: No visibility specified. Defaulting to "public".
    function allowance(address _owner, address _spender) constant returns (uint256 remaining);
    ^----------------------------------------------------------------------------------------^
./contracts/StandardToken.sol:17:5: Warning: No visibility specified. Defaulting to "public".
    function transfer(address _to, uint256 _value) returns (bool success) {
    ^
Spanning multiple lines.
./contracts/StandardToken.sol:29:5: Warning: No visibility specified. Defaulting to "public".
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
    ^
Spanning multiple lines.
./contracts/StandardToken.sol:43:5: Warning: No visibility specified. Defaulting to "public".
    function balanceOf(address _owner) constant returns (uint256 balance) {
    ^
Spanning multiple lines.
./contracts/StandardToken.sol:47:5: Warning: No visibility specified. Defaulting to "public".
    function approve(address _spender, uint256 _value) returns (bool success) {
    ^
Spanning multiple lines.
./contracts/StandardToken.sol:53:5: Warning: No visibility specified. Defaulting to "public".
    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
    ^
Spanning multiple lines.
./contracts/HumanStandardToken.sol:33:5: Warning: No visibility specified. Defaulting to "public".
    function HumanStandardToken(
    ^
Spanning multiple lines.
./contracts/HumanStandardToken.sol:47:5: Warning: No visibility specified. Defaulting to "public".
    function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
    ^
Spanning multiple lines.
./contracts/HumanStandardTokenFactory.sol:11:5: Warning: No visibility specified. Defaulting to "public".
    function HumanStandardTokenFactory() {
    ^
Spanning multiple lines.
./contracts/HumanStandardTokenFactory.sol:19:5: Warning: No visibility specified. Defaulting to "public".
    function verifyHumanStandardToken(address _tokenContract) constant returns (bool) {
    ^
Spanning multiple lines.
./contracts/HumanStandardTokenFactory.sol:54:5: Warning: No visibility specified. Defaulting to "public".
    function createHumanStandardToken(uint256 _initialAmount, string _name, uint8 _decimals, string _symbol) returns (address) {
    ^
Spanning multiple lines.
./contracts/Migrations.sol:11:3: Warning: No visibility specified. Defaulting to "public".
  function Migrations() {
  ^
Spanning multiple lines.
./contracts/Migrations.sol:15:3: Warning: No visibility specified. Defaulting to "public".
  function setCompleted(uint completed) restricted {
  ^
Spanning multiple lines.
./contracts/Migrations.sol:19:3: Warning: No visibility specified. Defaulting to "public".
  function upgrade(address new_address) restricted {
  ^
Spanning multiple lines.
./contracts/SampleRecipientSuccess.sol:16:3: Warning: No visibility specified. Defaulting to "public".
  function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) {
  ^
Spanning multiple lines.
./contracts/HumanStandardToken.sol:54:46: Warning: "sha3" has been deprecated in favour of "keccak256"
        require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData));
                                             ^----------------------------------------------------^
gitcoinbot commented 7 years ago

This issue now has a funding of 0.15 ETH (45.83 USDT) attached to it. To view or claim this funding, click here.

subramanianv commented 7 years ago

@maurelian I would like to work on this

subramanianv commented 7 years ago

Please review the PR. Thanks !

owocki commented 7 years ago

@maurelian would you mind hitting the 'accept' button at https://gitcoin.co/funding/details?url=https://github.com/ConsenSys/Tokens/issues/85 to remit payment to @subramanianv ? thanks!

gitcoinbot commented 7 years ago

The funding of 0.15 ETH attached to this issue has been approved & issued.

Learn more at: https://gitcoin.co/funding/details?url=https://github.com/ConsenSys/Tokens/issues/85

maurelian commented 7 years ago

got it