Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing function visibility specifier (low severity, code readability) #4

Open
Dexaran opened this issue Feb 10, 2018 · 0 comments
Open
Labels

Comments

@Dexaran
Copy link
Member

Dexaran commented Feb 10, 2018

Severity: low

Code snippet

https://github.com/EthereumCommonwealth/ethereum-classic-multisig/blob/master/contracts/ownership/Multisig.sol#L27

Description

It is strongly recommended to adhere to the same coding standard when developing important components of blockchain systems such as multisig wallet.

Unlike the other functions, confirm(bytes32 _h) does not have a visibility specifier.

Recommendation

Implement a public visibility specifier for confirm function of the Multisig.sol and MultisigWallet.sol contracts as follows:

contract Multisig {
  function confirm(bytes32 _h) public returns (bool) { }
}

contract MultisigWallet is Multisig, Shareable, DayLimit {

  /**
   * @dev Confirm a transaction by providing just the hash. We use the previous transactions map,
   * txs, in order to determine the body of the transaction from the hash provided.
   * @param _h The transaction hash to approve.
   */
  function confirm(bytes32 _h) public onlymanyowners(_h) returns (bool) {
    if (txs[_h].to != 0) {
      assert(txs[_h].to.call.value(txs[_h].value)(txs[_h].data));
      MultiTransact(msg.sender, _h, txs[_h].value, txs[_h].to, txs[_h].data);
      delete txs[_h];
      return true;
    }
  }
}
@Dexaran Dexaran added the audit label Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant