Skip to content

Poor definition of function visibility #11

@joshuahannan

Description

@joshuahannan

All of WalletMainLib’s functions have public visibility. Functions like calcConfirmsNeeded or getAmount should be private, and functions that are only intended to be called from “the outside world” (i.e. not by a deployed contract) should be external. For example, functions that represent actions from the owners of the wallet, such as serveTx, addOwner, removeOwner, etc, should be external instead of public because they are not intended to be called from within the library functions themselves.
As a result, the code will not only be more explicit, but could also save gas. The reason for such lower gas costs is that external calls don’t need to copy arguments to memory and can directly read from calldata.
Consider reviewing the visibility of all the functions in the wallet contracts, as per solidity.readthedocs.io and implementing the recommendations and best practices were possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions