IGNACIO PALACIOS SANTOS
- Truffle 5.0.1 (web3.js 1.0.0)
- Ganache-cli 6.1.6 (ganache-core: 2.1.5)
$ npm install
$ npm run chain
$ npm run test
-
The 3 owners are initialized in the constructor and can not be changed.
-
Owners can not retry to send a failed transaction. They would have to submit a new transactions.
-
Only owners can submit transactions to be confirmed and executed.
-
Only wallet owner can change masterKey address.
-
Only wallet owner can add ERC20 tokens.
-
When transaction is executed (message call)
address(trx.destination).call.value(trx.value)(trx.data))
no GAS argument is attached. Ifdestination
is untrusted, it could lead to the consumption of all the GAS. This situation can be solved easily limitinggasLimit
param in the transaction to be sign itself. Other option would be to add an attributegas
toTransaction
struct, defining how much fromgasLimit
the owner is willing to use in the message call. -
Reentrancy attack is not possible because
addTransaction()
is internal. -
Cross-function Reentrancy attack is not possible because
confirmTransaction()
(which callsaddTransaction()
) can be called only by owners. -
SafeMath library has not been used since there are two cases where a number is added. Both cases are counters that will never reach 2^256, so I considered it was beneficial to save some GAS.
-
Block Gas limit might be reached if
_numberOfOwners
is too high during contract deployment. -
Addresses of ERC20 tokens are not stored in storage. Addresses stored in the Logs should be enough to allow the user to interact with them. Storing them might be to be considered though, in case of future functionalities.
-
If
masterKey
is changed, the new one will have to add all the tokens again in order to be approved fortransferFrom
on behalf of the MultiSigWallet contract. -
Enough Events are emitted to make possible to interact with the wallet from a UI.
-
Contracts Ownable.sol and Pausable.sol belongs to OpenZeppelin
-
In a real project for production, what I would have done is to use one of the MultiSigWallets already available, audited and widely used such as MultiSignWallet from Gnosis https://github.com/Gnosis/MultiSigWallet .I would have modified it as less as possible if needed. I got inspired by it but decided to create my own in order to show my skills and create a simpler version good enough to fulfill the assignment requirements.
-
Use a Upgradeability pattern like Unstructured storage.
-
Use Security tools and audit the smart contracts.
-
Reach 100% test coverage.
-
Decide what
uint
storage variables can be downgraded touint128
,uint64
, etc.. to be packed wisely in storage and save GAS when SSTORE and SLOAD. -
Add functionality to add, change and remove owners. It can be easily done adding
function addOwner()
,function removeOwner()
andfunction replaceOwner()
from MultiSignWallet from Gnosis. -
Add more functionalities that can be also found in MultiSignWallet from Gnosis such as
function revokeConfirmation()
.