A secure and efficient smart contract wallet with features like multi-signature approval for ownership transfer, allowances for authorized spenders, and unlimited fund reception.
- Single Owner Wallet: Initially controlled by a single owner.
- Receive Funds: Capable of receiving unlimited funds.
- Multi-Signature Approval: Allows change of ownership with the approval of 3 out of 5 guardians.
- Allowances: Owner can set allowances for other addresses to spend a limited amount of funds.
- Install Truffle:
npm install -g truffle
- Clone the repository:
git clone <REPO_URL>
- Change to the repo directory:
cd <REPO_DIRECTORY>
- Install dependencies:
npm install
- Compile the contract:
truffle compile
Interact with the contract using Truffle console or deploy it to a testnet or mainnet using Truffle's deployment tools.
Functionality:
proposeNewOwner(address _newOwner)
- Propose a new owner (Only guardians can call this function).approveNewOwner()
- Approve the proposed new owner. Ownership changes if 3 out of 5 guardians approve.addAllowance(address _who, uint256 _amount)
- Set an allowance for a specific address (Only owner can call this function).withdrawMoney(address payable _to, uint256 _amount)
- Withdraw funds if you're the owner or an address with sufficient allowance.
The contract uses OpenZeppelin's Ownable contract for secure ownership management and SafeMath library to prevent integer overflow and underflow attacks.
Test cases can be added in the test/
directory and executed using the truffle test
command.
Open for contributions. Please ensure to test thoroughly before creating a pull request.