octo-defi-core-contracts
v0.0.1
Published
Core contracts for the octo-wallet!
Downloads
6
Readme
OctoWallet Project
Welcome to the OctoWallet project! This project implements a highly modular smart contract wallet utilizing the ERC-4337 and ERC-2535 standards. The key components of this project are the OctoWallet
, OctoWalletFactory
, and SmartContractWalletFacet
contracts.
Table of Contents
Introduction
The OctoWallet project aims to create a customizable and extensible smart contract wallet. By leveraging the ERC-4337 and ERC-2535 standards, this project provides a flexible architecture that allows users to tailor their wallet's functionality according to their needs.
Standards
- ERC-4337: This standard introduces account abstraction, enabling the creation of smart contract wallets with enhanced capabilities.
- ERC-2535: Known as the Diamond Standard, it allows for modular smart contracts where functionalities can be added or removed by integrating or removing facets.
Contracts
OctoWallet
The OctoWallet
contract is the core of the wallet system. It implements the Diamond Standard (ERC-2535) to allow modularity and uses ERC-4337 for account abstraction.
OctoWalletFactory
The OctoWalletFactory
contract is responsible for creating instances of the OctoWallet
. It uses the Create2
opcode for deterministic address generation, ensuring that the same wallet can be recreated with the same parameters.
SmartContractWalletFacet
The SmartContractWalletFacet
contract provides the core functionalities of the wallet. It includes functions for executing transactions, batch operations, and more. This facet can be extended or replaced to add new features to the wallet.
Installation
To get started with the OctoWallet project, you'll need to have Node.js and Hardhat installed.
Clone the repository:
git clone https://github.com/your-repo/octowallet.git cd octowallet
Install the dependencies:
npm install
Usage
You can interact with the OctoWallet contracts using Hardhat. Below are some basic commands:
Compile the contracts:
npx hardhat compile
Deploy the contracts:
npx hardhat run scripts/deploy.js
Run tests:
npx hardhat test
Deployment
To deploy the OctoWallet contracts, follow these steps:
Update the deployment script
scripts/deploy.js
with the necessary parameters.Run the deployment script:
npx hardhat run scripts/deploy.js --network <network-name>
Replace <network-name>
with the name of the network you want to deploy to (e.g., localhost
, rinkeby
, mainnet
).
Testing
The project includes a suite of tests to ensure the functionality of the contracts. To run the tests, execute:
npx hardhat test
The tests are located in the test
directory and cover various scenarios for the OctoWallet, OctoWalletFactory, and SmartContractWalletFacet contracts.
Contributing
We welcome contributions to the OctoWallet project! If you have suggestions for improvements or find any issues, please feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using the OctoWallet project! If you have any questions or need further assistance, please don't hesitate to reach out.