This is the report from a security audit performed on MultiSigWallet by gorbunovperm.
Multisignature wallet — Allows multiple parties to agree on transactions before execution.
In total, 5 issues were reported including:
-
0 high severity issue.
-
0 medium severity issues.
-
2 low severity issues.
-
3 minor observations.
Issues for MultiSigWalletWithDailyLimit.sol
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
There is no zero-address check in replaceOwner
method. This can lead to unexpected behavior.
Use notNull
modifier.
modifier validRequirement(uint ownerCount, uint _required) {
/// ...
}
The name of the function parameters is recommended to start with the "_" symbol. But in this code some parameters have prefix, but some do not. This can lead to confusion or to a mistake in the future.
Add "_" prefix to all parameters of functions.
In 7 places in the code. For example:
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
// ...
}
constant
on functions is an alias to view, but this is deprecated and will be dropped in version 0.5.0.
Use view
mark.
Example:
function getOwners()
public
constant
returns (address[])
{
return owners;
}
The functions getOwners
, getConfirmations
and getTransactionIds
have public
visibility, which implies that they can be called internally. Even though such an internal call does not exist in the contract, a future modification may add one, producing unexpected results. More information here.
Functions that return variable sized arrays should be external
.
throw
is deprecated in favour ofrevert()
,require()
andassert()
.- Defining constructors as functions with the same name as the contract is deprecated.
Transaction tx = transactions[transactionId]
. Variable is declared as a storage pointer.- Invoking events without
emit
prefix is deprecated. - No visibility specified. Defaulting to
public
.
- Use
revert()
,require()
andassert()
. - Use
constructor(...) { ... }
instead. - Use an explicit
storage
keyword. - Use
emit
prefix for events. - Use
public
mark.
There is no serious security vulnerabilities. But it is recommend to fix all issues so that the code is clearer and safer.