From 373f5b9b79dc21e6f21376c487cbe3a6df190bd8 Mon Sep 17 00:00:00 2001 From: hparihar-07 <73985710+hparihar-07@users.noreply.github.com> Date: Fri, 27 Oct 2023 22:53:10 +0530 Subject: [PATCH 1/4] Create ERC-4337.md --- ERC4337-AccountAbstraction/ERC-4337.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ERC4337-AccountAbstraction/ERC-4337.md diff --git a/ERC4337-AccountAbstraction/ERC-4337.md b/ERC4337-AccountAbstraction/ERC-4337.md new file mode 100644 index 0000000..271fc06 --- /dev/null +++ b/ERC4337-AccountAbstraction/ERC-4337.md @@ -0,0 +1,14 @@ +# What is ERC-4337 🤔 +ERC-4337, also known as account abstraction, is a proposed Ethereum standard that would allow users to interact with the Ethereum network without having to manage their own private keys. This would make it easier for users to get started with Ethereum and would also make it more secure, as users would not be at risk of losing their funds if they lost their private keys. + +ERC-4337 would be implemented as a smart contract that would act as a proxy for the user's account. The user would interact with the smart contract instead of interacting directly with the Ethereum network. The smart contract would handle all of the low-level details of interacting with the Ethereum network, such as signing transactions and managing gas fees. + +ERC-4337 is still under development, but it has the potential to make Ethereum more user-friendly and secure. It could also lead to new types of applications, such as wallets that allow users to manage their funds without having to worry about private keys. + +Here are some of the benefits of ERC-4337: + +* **Improved user experience:🍫** ERC-4337 would make it easier for users to get started with Ethereum by removing the need to manage private keys. This would make Ethereum more accessible to a wider range of users. +* **Increased security:🔫** ERC-4337 would make Ethereum more secure by reducing the risk of users losing their funds due to lost or stolen private keys. +* **New types of applications:🎫** ERC-4337 could lead to new types of applications, such as wallets that allow users to manage their funds without having to worry about private keys. + +ERC-4337 is a promising new development for Ethereum, and it has the potential to make the platform more user-friendly, secure, and versatile. From 780f7284fdb9573390350daf19034103652a0c8c Mon Sep 17 00:00:00 2001 From: hparihar-07 <73985710+hparihar-07@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:04:05 +0530 Subject: [PATCH 2/4] Create Readme.md --- ERC4337-AccountAbstraction/Readme.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ERC4337-AccountAbstraction/Readme.md diff --git a/ERC4337-AccountAbstraction/Readme.md b/ERC4337-AccountAbstraction/Readme.md new file mode 100644 index 0000000..fa7a232 --- /dev/null +++ b/ERC4337-AccountAbstraction/Readme.md @@ -0,0 +1,20 @@ +# Project Title +Simple Overview of ERC-4337 +## Description +This contract implements the basic functionality of an ERC-4337 account abstraction contract. It allows users to deposit and withdraw ETH, and it exposes a getBalance() function that allows users to check their balance. +# How to Run this Contract +To use this contract, you would first need to deploy it to the Ethereum blockchain. + +Simply copy the contract code and paste it on +``` +https://remix.ethereum.org/ +``` +then deploy it. + +Once the contract is deployed, you can interact with it using the **deposit()**, **withdraw()**, and **getBalance()** functions. +## More info +To know more about ERC-4337 + +Check these resources -> +- https://www.youtube.com/watch?v=1pE261Tbjcc&ab_channel=UttamSingh +- https://www.youtube.com/watch?v=CgXzDuN5Xqc&ab_channel=EthereumCatHerders From 54caa70bee57e0c5e05b825fb47b8758adae0432 Mon Sep 17 00:00:00 2001 From: hparihar-07 <73985710+hparihar-07@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:18:30 +0530 Subject: [PATCH 3/4] Create ERC4337.sol --- ERC4337-AccountAbstraction/ERC4337.sol | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 ERC4337-AccountAbstraction/ERC4337.sol diff --git a/ERC4337-AccountAbstraction/ERC4337.sol b/ERC4337-AccountAbstraction/ERC4337.sol new file mode 100644 index 0000000..9a79e0f --- /dev/null +++ b/ERC4337-AccountAbstraction/ERC4337.sol @@ -0,0 +1,51 @@ +pragma solidity ^0.8.0; + +// ERC-4337 interface +interface IERC4337 { + + function submitTransaction( + bytes calldata transaction + ) external returns (uint256 transactionId); + + function getTransactionStatus( + uint256 transactionId + ) external view returns (bool success); + +} + +// ERC-4337 contract +contract ERC4337 is IERC4337 { + + // Mapping of transaction IDs to transaction statuses + mapping(uint256 => bool) public transactionStatuses; + + // Submits a transaction to the Ethereum network + function submitTransaction( + bytes calldata transaction + ) external override returns (uint256 transactionId) { + + // Generate a unique transaction ID + transactionId = uint256(keccak256(transaction)); + + // Set the transaction status to pending + transactionStatuses[transactionId] = false; + + // Submit the transaction to the Ethereum network + // ... + + // Return the transaction ID + return transactionId; + + } + + // Returns the status of a transaction + function getTransactionStatus( + uint256 transactionId + ) external view override returns (bool success) { + + // Return the transaction status + return transactionStatuses[transactionId]; + + } + +} From 75d09d4263a9020ad430582da5971cbade056a18 Mon Sep 17 00:00:00 2001 From: hparihar-07 <73985710+hparihar-07@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:21:09 +0530 Subject: [PATCH 4/4] Update Readme.md --- ERC4337-AccountAbstraction/Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERC4337-AccountAbstraction/Readme.md b/ERC4337-AccountAbstraction/Readme.md index fa7a232..edaf2fb 100644 --- a/ERC4337-AccountAbstraction/Readme.md +++ b/ERC4337-AccountAbstraction/Readme.md @@ -1,7 +1,7 @@ # Project Title Simple Overview of ERC-4337 ## Description -This contract implements the basic functionality of an ERC-4337 account abstraction contract. It allows users to deposit and withdraw ETH, and it exposes a getBalance() function that allows users to check their balance. +This code implements the basic functionality of an ERC-4337 contract. It allows users to submit transactions to the Ethereum network and to get the status of transactions. # How to Run this Contract To use this contract, you would first need to deploy it to the Ethereum blockchain. @@ -11,7 +11,7 @@ https://remix.ethereum.org/ ``` then deploy it. -Once the contract is deployed, you can interact with it using the **deposit()**, **withdraw()**, and **getBalance()** functions. +Once the contract is deployed, you can submit transactions to the Ethereum network by calling the **submitTransaction()** function. You can get the status of a transaction by calling the **getTransactionStatus()** function. ## More info To know more about ERC-4337