From 4dab0f7b02676001d06a5a6d8a311d9e52ca3415 Mon Sep 17 00:00:00 2001 From: h4rpy-wings Date: Sat, 23 Sep 2023 19:40:45 +0330 Subject: [PATCH] wip --- contracts/MultiSigWallet.sol | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/contracts/MultiSigWallet.sol b/contracts/MultiSigWallet.sol index 9e2e6b4..4073e74 100644 --- a/contracts/MultiSigWallet.sol +++ b/contracts/MultiSigWallet.sol @@ -18,6 +18,7 @@ contract MultiSigWallet { event ConfirmTransaction(address indexed owner, uint indexed txIndex); event RevokeConfirmation(address indexed owner, uint indexed txIndex); event ExecuteTransaction(address indexed owner, uint indexed txIndex); + enum TxType {transfer, addOwner, removeOwner } address[] public owners; mapping(address => bool) public isOwner; @@ -26,7 +27,7 @@ contract MultiSigWallet { uint public addOwnerConfirmationsRequired = 70; // 70/100 70% uint public removeOwnerConfirmationsRequired = 90; // 90/100 | 90% - bytes4 private _transferSelector; + bytes4 private _transferSelector = bytes4(keccak256("transfer(address,uint256)")); struct Transaction { TxType txType; address baseToken; @@ -68,8 +69,6 @@ contract MultiSigWallet { for (uint i = 0; i < _owners.length; i++) { addOwner(_owners[i]); } - - _transferSelector = bytes4(keccak256("transfer(address,uint256)")); } receive() external payable { @@ -153,9 +152,7 @@ contract MultiSigWallet { emit ExecuteTransaction(msg.sender, _txIndex); } - function revokeConfirmation( - uint _txIndex - ) public onlyOwner txExists(_txIndex) notExecuted(_txIndex) { + function revokeConfirmation(uint _txIndex) public onlyOwner txExists(_txIndex) notExecuted(_txIndex) { Transaction storage transaction = transactions[_txIndex]; require(isConfirmed[_txIndex][msg.sender], "tx not confirmed");