logo
projects

My Projects: Multi Signature Ethereum Wallet

4 min read

Made as part of Moralis Academy's Ethereum Smart Contract Programming 101 course, this project is more than just code - it's a Multi-Signature Ethereum wallet, my first project using Solidity and my beginning of navigating the decentralized web..

paul simroth solidity cover image
Projects

My Projects: Multi Signature Ethereum Wallet

In the ever-evolving landscape of decentralized technologies, my journey through the Ethereum Smart Contract Programming 101 course at Moralis Academy stands out as a transformative odyssey. At its finish line lies this project, a testament to my commitment to mastering Solidity and Web3. This project, created as part of this course, is not merely lines of code; it's a Multi-Signature Ethereum wallet—a paradigm shift in decentralized finance.

You can see the code here: https://github.com/paulsimroth/Ethereum101-course-project

About this Project: A Glimpse into Web3 Mastery

At the center of this repository lies the culmination of what I had learned thus far - a Multi-Signature Ethereum wallet designed as a part of the Ethereum Smart Contract Programming 101 Course. Completed on November 8th, 2021, this project goes above traditional wallet functionalities, introducing a multi-faceted layer of security and decentralization.

Decoding the Wallet Project:

At its core, the wallet is a manifestation of Solidity prowess, showcasing the art of writing smart contracts—a skill sharpened under the tutelage of Moralis Academy. The emphasis on multi-signature functionality introduces an extra layer of security, revolutionizing transaction approval processes within the Ethereum ecosystem.

Key Features:

  • Multi-Signature Functionality: The project's centerpiece, the multi-signature functionality, requires the consensus of designated administrators for any transaction to proceed. This safeguards the assets within the wallet, adding an unparalleled layer of security.
  • Admin Approval Mechanism: In this decentralized ballet, the administrators play a pivotal role. Their collective approval becomes the key to unlock the gates of the wallet, ensuring that no single entity holds absolute control—a crucial aspect in mitigating risks associated with single points of failure.
  • Technology Stack & Tools: Solidity emerges as the protagonist in this narrative, being the language of choice for crafting smart contracts. This technological backbone empowers the wallet, offering a robust foundation for secure and trustless transactions within the Ethereum blockchain.

Decoding the Code: A Step-by-Step Guide

1. Contract Structure:

The contract structure includes mappings for balances and approvals, a counter for transfer IDs, and a limit for approvals. The Transfer struct encapsulates details of a transfer request, and arrays store requests and owner addresses. The constructor initializes the deployer as the first owner.

2. Modifier for Admins:

The modifier onlyOwner ensures that only owners can execute certain functions. It iterates through the 'owners' array to validate the caller and make sure the address calling certain functions has been given the role of owner.

3. Add Admin Function:

The addAdmin function allows an owner to add a new administrator to the owners' array, updating the approval limit accordingly.

4. Regular End-user Functions:

Explanation: The functions deposit() public payable and withdraw(uint amount) public enable end-users to deposit and withdraw ETH from their accounts.

5. Transfer Request Function:

  • Purpose: This function allows an owner to create a transfer request.
  • Input Parameters:
    • _receiver: The address of the recipient.
    • _amount: The amount of Ether to be transferred.
  • Conditions:
    • It checks if the owner has sufficient balance for the requested transfer.
    • Ensures that the sender and receiver are not the same.
  • Action:
    • It creates a Transfer struct (transferInstance) with details such as sender, receiver, amount, approvals, and a unique ID.
    • This instance is then added to the transferRequests array.

The transferId is incremented for uniqueness.

6. Approve Transfer Function:

  • Purpose: This function allows an owner to approve a transfer request and execute it if the required approvals are met.
  • Input Parameters:
    • id: The unique ID of the transfer request to be approved.
  • Conditions:
    • Checks if the owner has not already authorized the transfer.
  • Action:
    • Marks the transfer as authorized by setting approvals[msg.sender][transferId] to true.
    • Increments the approval count for the specific transfer request.
    • If the approvals reach the defined limit (approvalLimit), it executes the transfer:
      • Deducts the transferred amount from the approving owner's balance.
      • Adds the transferred amount to the receiver's balance.
      • Initiates the actual transfer of Ether to the receiver's address.
    • Returns a message indicating whether the transaction was approved or not.

7. Get Balance Function:

This function enables users to check their account balance.

Conclusion

This project was my first introduction to Solidity and helped me understand the basics of Ethereum Wallets, Smart Contract Programming and other valuable lessons, offering a skill set that is not just technical proficiency but a key to unlocking the untapped potential of blockchain technology and web3.

To everyone navigating the vast realms of Web3, this project showcases my commitment, skills, and understanding of solidity. Feel free to explore my repository, delve into the code, and envision the potential this project brings to your team or personal aspirations. If you have any questions, please feel free to contact me!

author
Avatar Paul Simroth

Paul Simroth

Full-stack & blockchain developer

Blockchain developer from Austria focused on Web3 technology, smart contracts, and decentralized applications. Passionate about building innovative solutions in the blockchain space.

keep reading

8 more articles in similar categories.

paul simroth, projects foundry defi protocol

My Projects: DeFi Protocol with Stablecoin

Feb 27, 2024

In this article I go over my study project called "Foundry DeFi Protocol". It is a DeFi Protocol with Stablecoin. Check out the article to find out all about it.

Read article
paul simroth, projects foundy lottery

My Projects: Foundry Lottery

Feb 27, 2024

In this artilce I go over my implementation of a Smart Contract Lottery, which uses Chainlink VRF in order to achieve true randomness on the blockchain.

Read article
paul simroth, projects foundry fund me

My Projects: Foundry Fund Me

Feb 27, 2024

In this article I go over an implementation of a crowdfunding smart contract built with using Foundry.

Read article
paul simroth portfolio, title image automated market maker

My Projects: Automated Market Maker

Feb 23, 2024

Discover the future of DeFi with our blog on an Automated Market Maker project. Dive into smart contracts and decentralized exchanges.

Read article
paul simroth portfolio, real estate escrow

My Projects: Real Estate Escrow Contract

Feb 21, 2024

Here you can read more about my Project "Real Estate Escrow". Explore on of the many usecases of Web3 with me - the Tokenization of Real Wolrd Assets!

Read article
paul simroth portfolio image of solidity code, ethereum domain registrar

My Projects: Ethereum Domain Registrar

Feb 20, 2024

Dive into Web3 with a decentralized domain platform on Ethereum. Learn about ENS, smart contracts, and the future of decentralized apps.

Read article
paul simroth portfolio image of solidity code

My Projects: Building an Ethereum Game

Jan 26, 2024

In this project I venture into the area of Web3 gaming. I go over one Game I coded myselff. What is Web3 Gaming? What Web3 Games are there? Why is Web3 Gaming important? I will go over all these questions!

Read article
paul simroth portfolio image of solidity code

My Projects: Decentralized Ethereum Exchange

Jan 26, 2024

In this article I go over another one of my coding projects. This time I walk you through my project coded as part of the course Ethereum Smart Contract Programming 201 at Moralis Academy. It is a Decentralized Exchange. Read this article to find out more!

Read article

Structured overview for LLMs and search: llms.txt