A secure, upgradeable multi-signature wallet smart contract built with Solidity. This contract enables decentralized management of funds through multi-owner governance.
- 🔐 Multi-owner governance with configurable confirmation thresholds
- 💰 Support for both ETH and ERC20 tokens
- ⚡ Dynamic owner management through multi-sig consensus
- 🔄 Upgradeable contract architecture
- ⏱️ Configurable transaction expiration
- 📝 Comprehensive event logging
- 🛡️ Extensive security checks and validations
- Solidity ^0.8.22
- Foundry
- OpenZeppelin Contracts
# Clone the repository
git clone https://github.com/yourusername/multi-sig-wallet.git
cd multi-sig-wallet
# Install dependencies
forge install
Deploy the contract with the following parameters:
constructor(
address[] memory _owners,
uint8 _requiredConfirmations
)
_owners
: Array of owner addresses (minimum 1, no duplicates)_requiredConfirmations
: Number of required confirmations (minimum 1, maximum owners count)
function submitTransaction(
address token,
address to,
uint256 value,
bytes data,
uint256 expiration
) external returns (uint256 txIndex)
function confirmTransaction(uint256 txIndex) external
function executeTransaction(uint256 txIndex) external
function revokeConfirmation(uint256 txIndex) external
function submitAddOwner(address newOwner, uint256 expiration) external
function submitRemoveOwner(address ownerToRemove, uint256 expiration) external
function changeRequiredConfirmations(uint8 newRequired, uint256 expiration) external
# Run all tests
forge test
# Run specific test file
forge test --match-path test/MultiSigWallet.t.sol
-
Owner Selection
- Choose trusted owners
- Consider using hardware wallets
- Implement proper key management
-
Confirmation Threshold
- Set appropriate confirmation requirements
- Consider transaction value and risk level
- Implement time locks for critical operations
-
Transaction Management
- Set reasonable expiration times
- Validate token addresses and amounts
- Monitor transaction status
The contract system consists of:
MultiSigWallet.sol
: Main contract implementationMultiSigWalletEvents.sol
: Event definitionsMultiSigWalletErrors.sol
: Custom error definitionsProxy.sol
: Upgradeability proxyUpgradableSetup.sol
: Upgrade initialization
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository.