A secure multi-signature wallet implementation in Solidity that requires multiple confirmations for transaction execution. This project demonstrates advanced smart contract development with comprehensive security features and multi-party fund management.
This repository contains a complete MultiSig Wallet implementation deployed and verified on Ethereum Sepolia Testnet. The wallet requires multiple owner signatures to execute transactions, providing enhanced security for fund management and contract interactions.
Author: Eduardo Moreno
License: MIT
Solidity Version: ^0.8.26
Network: Ethereum Sepolia Testnet
β Requisitos Cumplidos:
- GitHub Portfolio: β Repositorio pΓΊblico con cΓ³digo documentado
- Safe Multi-Sig Address: β
0x138B6DD6266ee0E1fFAF118B26cD7a68554C01bA(Multisig_Eduardo_Moreno) - EVM Testnet Deployment: β Sepolia Network
- 2+ Signers Configuration: β 2-of-2 MultiSig Setup
Valor Agregado: ImplementaciΓ³n custom adicional que demuestra comprensiΓ³n profunda de los principios de seguridad MultiSig.
- Remix Deploy Address:
0x254190748c4fC38585B3Bb1439A30D3eE9aDAD30 - Etherscan Verified: https://sepolia.etherscan.io/address/0x254190748c4fC38585B3Bb1439A30D3eE9aDAD30#code
- Status: β Successfully verified and functional
- Type: Custom-developed MultiSig with enhanced features
- Safe Name:
Multising_Eduardo_Moreno - Safe Address:
0x138B6DD6266ee0E1fFAF118B26cD7a68554C01bA - Etherscan Verified: https://sepolia.etherscan.io/address/0x138B6DD6266ee0E1fFAF118B26cD7a68554C01bA
- Safe Web Interface: https://app.safe.global/sep:0x138B6DD6266ee0E1fFAF118B26cD7a68554C01bA
- Status: β Successfully deployed and configured
- Type: Industry-standard Gnosis Safe (2-of-2 configuration)
- Remix Deploy Address:
0x7047052C241e02bc36f4c4c3E1F137D7fa3ba6D7 - Etherscan Verified: https://sepolia.etherscan.io/address/0x7047052C241e02bc36f4c4c3E1F137D7fa3ba6D7#code
- Status: β Successfully verified and functional
The MultiSigWallet.sol contract implementation is based on the educational example published at: https://www.cyfrin.io/glossary/multisig-wallet-solidity-code-example
This implementation has been enhanced with comprehensive NatSpec documentation, additional security features, and professional-grade code structure.
| Feature | Custom MultiSig | Gnosis Safe |
|---|---|---|
| Development | β Built from scratch | β Factory deployment |
| Learning Value | β Deep understanding | β Industry standards |
| Security Audit | β Battle-tested | |
| Functionality | β Core features | β Advanced features |
| Gas Efficiency | β Optimized | β Production-ready |
| Upgradeability | β Static | β Modular system |
| Documentation | β Full NatSpec | β Extensive docs |
Why Both?
- Custom Implementation: Demonstrates smart contract development skills
- Gnosis Safe: Shows familiarity with industry-standard tools
- Owner 1:
0x4829f4f3aadee47Cb1cc795B2eC78A166042e918 - Owner 2:
0xbEdeE081acb0c97341DBB6005050307667957F60 - Confirmation Threshold: 2 out of 2 signatures required
- Type: 2-of-2 MultiSig (Maximum Security)
- Access Control: Owner-only functions
- Protection: Duplicate confirmation prevention
- Validation: Comprehensive input validation
| Function | Description | Parameters |
|---|---|---|
getOwners() |
Returns array of wallet owners | None |
getTransactionCount() |
Returns total number of transactions | None |
getTransaction(uint256) |
Returns transaction details | _txIndex |
numConfirmationsRequired() |
Returns required confirmation threshold | None |
isOwner(address) |
Checks if address is an owner | address |
isConfirmed(uint256, address) |
Checks confirmation status | _txIndex, _owner |
| Function | Description | Parameters |
|---|---|---|
submitTransaction() |
Submit new transaction for approval | _to, _value, _data |
confirmTransaction() |
Confirm a pending transaction | _txIndex |
executeTransaction() |
Execute confirmed transaction | _txIndex |
revokeConfirmation() |
Revoke previous confirmation | _txIndex |
Visit the MultiSigWallet on Etherscan and use the Read Contract tab:
-
Check Owners:
getOwners() β Should return both owner addresses -
Check Threshold:
numConfirmationsRequired() β Should return 2 -
Check Transaction Count:
getTransactionCount() β Should return current number of transactions
Visit the TestContract on Etherscan:
- Get Transaction Data:
getData() β Returns: 0x44e1c61500000000000000000000000000000000000000000000000000000000000000007b
Use the Write Contract tab on MultiSigWallet:
-
Connect MetaMask (Owner 1 account)
-
Submit Transaction:
submitTransaction( _to: 0x7047052C241e02bc36f4c4c3E1F137D7fa3ba6D7 _value: 0 _data: 0x44e1c61500000000000000000000000000000000000000000000000000000000000000007b ) -
Switch to Owner 2 in MetaMask
-
Confirm Transaction:
confirmTransaction(0) // Index of the transaction -
Execute Transaction:
executeTransaction(0) // Any owner can execute -
Verify Result: Go back to TestContract and check:
i() β Should show 123 (incremented value)
- Safe Name:
Multising_Eduardo_Moreno - Safe Web Interface: https://app.safe.global/sep:0x138B6DD6266ee0E1fFAF118B26cD7a68554C01bA
- Etherscan: https://sepolia.etherscan.io/address/0x138B6DD6266ee0E1fFAF118B26cD7a68554C01bA
- Connect both owner wallets to Safe interface
- Create test transaction (send small amount ETH)
- Sign with first owner
- Sign with second owner
- Execute transaction
- Verify on blockchain
- β Multi-signature requirement (2-of-2)
- β Owner-only access controls
- β Duplicate confirmation prevention
- β Transaction existence validation
- β Execution state checking
- β Confirmation revocation capability
Deposit- When ETH is receivedSubmitTransaction- When new transaction is submittedConfirmTransaction- When transaction is confirmedRevokeConfirmation- When confirmation is revokedExecuteTransaction- When transaction is executed
- Efficient storage patterns
- Minimal external calls
- Optimized loops and conditions
- Remix IDE
- MetaMask wallet with Sepolia ETH
- Access to Sepolia testnet
- Clone this repository
- Open contracts in Remix IDE
- Compile with Solidity 0.8.26
- Deploy to Sepolia testnet
- Verify on Etherscan
This project demonstrates:
- Smart Contract Security: Multi-signature patterns
- Access Control: Owner-based permissions
- State Management: Transaction lifecycle
- Event Logging: Comprehensive audit trail
- Code Documentation: Professional NatSpec standards
- Always verify transaction details before confirmation
- Ensure all owners are trusted parties
- Test thoroughly on testnet before mainnet deployment
- Consider upgradeability patterns for production use
- Implement additional security measures for large funds
- Etherscan Contract: Verified source code and ABI available
- Network: Sepolia Testnet (safe for testing)
- Gas Estimates: ~100k gas per transaction cycle
- Block Confirmations: Standard Ethereum confirmations
- Shared Fund Management: Multiple parties controlling funds
- DAO Treasury: Decentralized organization fund management
- Business Partnerships: Joint financial decisions
- Family Accounts: Shared cryptocurrency management
- Smart Contract Governance: Multi-party contract administration
For code review and functionality verification without additional setup:
-
Review Deployed Contracts:
-
Verify Source Code:
- Check NatSpec documentation
- Review security implementations
- Analyze function structure
-
Test Read Functions: Use the "Read Contract" tab on Etherscan to verify:
getOwners() β Returns the configured owner addresses numConfirmationsRequired() β Returns 2 getTransactionCount() β Returns current transaction count
For complete hands-on testing with your own wallet addresses:
- Install MetaMask browser extension
- Switch to Sepolia Testnet in MetaMask
- Create 2 new test accounts in MetaMask
- Get Sepolia ETH from faucet: https://sepoliafaucet.com/
- Copy both wallet addresses for deployment
-
Open Remix IDE: https://remix.ethereum.org
-
Create new files:
MultiSigWallet.sol- Copy code from this repositoryTestContract.sol- Copy code from this repository
-
Compile contracts:
- Select Solidity compiler version: 0.8.26
- Enable "Auto compile"
-
Deploy TestContract:
- Go to "Deploy & Run Transactions" tab
- Environment: "Injected Provider - MetaMask"
- Select "TestContract" and click "Deploy"
- Save the deployed address
-
Deploy MultiSigWallet:
- Select "MultiSigWallet"
- Constructor parameters:
["YOUR_ADDRESS_1","YOUR_ADDRESS_2"], 2 - Click "Deploy"
- Save the deployed address
-
In TestContract, call
getData():Result: 0x44e1c61500000000000000000000000000000000000000000000000000000000000000007b -
In MultiSigWallet, with Account 1:
submitTransaction( _to: [TestContract_Address] _value: 0 _data: [Result_from_getData] ) -
Switch to Account 2 in MetaMask:
confirmTransaction(0) -
Execute the transaction:
executeTransaction(0) -
Verify result in TestContract:
i() β Should return 123
Code Quality:
- NatSpec documentation present and comprehensive
- Proper access control implementation
- Input validation and error handling
- Event emission for transparency
- Gas-efficient code patterns
Security Features:
- Owner-only restrictions properly implemented
- Duplicate confirmation prevention
- Transaction existence validation
- Execution state checking
- Confirmation revocation capability
Functionality Testing:
- Contract deployment successful
- Owner configuration correct
- Transaction submission works
- Multi-signature confirmation process
- Transaction execution successful
- State changes reflected correctly
Test Case 1: Basic Transaction Flow
- Submit transaction with Owner 1
- Confirm with Owner 2
- Execute transaction
- Verify state change
Test Case 2: Insufficient Confirmations
- Submit transaction with Owner 1
- Attempt execution without sufficient confirmations
- Verify transaction fails appropriately
Test Case 3: Confirmation Revocation
- Submit and confirm transaction
- Revoke confirmation
- Verify confirmation count decreases
- Attempt execution should fail
Test Case 4: Access Control
- Attempt transaction submission from non-owner address
- Verify proper rejection with appropriate error message
- Dynamic owner management
- Flexible threshold adjustment
- Time-locked transactions
- Emergency recovery mechanisms
- Integration with other DeFi protocols
Developed by Eduardo Moreno
October 2025
Ethereum Sepolia Testnet
For questions or contributions, please refer to the verified contract code on Etherscan.