This project is an implementation of the MultiDelegateCall proposal (ERC-6357) using Hardhat, a development environment for Ethereum
This EIP standardizes an interface containing a single function, multicall, allowing EOAs to call multiple functions of a smart contract in a single transaction, and revert all calls if any call fails.
contracts/: Contains the Solidity contracts for the projectdeploy/: Contains the deployment scripts for the contractstest/: Contains the test scripts for the contracts
- Node.js and npm installed on your machine
- Hardhat installed globally or locally in your project. You can install it using
npm install --save-dev hardhat
-
Clone the repository to your local machine using
git clone https://github.com/eludius18/ERC-6357-MultiDelegateCall.git -
Navigate to the project directory
-
Install the project dependencies using
npm install
Follow these steps to deploy the contracts:
-
Compile the contracts using
npx hardhat compile. This step is necessary before you can deploy the contracts -
Deploy the
TokenERC20contract usingnpx hardhat deploy --network arbitrum --tags TokenERC20. This deploys theTokenERC20Smart Contract
Note: The
--network arbitrumflag is used to specify that the contracts should be deployed to the Arbitrum Sepolia network that you started in step 1
Before running the scripts, you need to set up your environment variables. Follow these steps:
-
Create a new file in the root of your project named
.env -
Open the
.envfile and add the following variables:
TOKENERC20_ADDRESS = <YOUR_TOKENERC20_CONTRACT_ADDRESS>
RPC_URL_ARBITRUM = <YOUR_ARBITRUM_RPC_URL>
PRIVATE_KEY = <YOUR_PRIVATE_KEY>Follow these steps to execute the scripts:
Run the 1-batchTx.ts script using npx hardhat run --network arbitrum scripts/1-batchTx.ts. This script interacts with the deployed contracts for creating a Batch Transaction
Run the mint-tokenERC20.ts script using npx hardhat run --network arbitrum scripts/mint-tokenERC20.ts. This script interacts with the deployed contracts for minting Tokens
https://sepolia.arbiscan.io/tx/0x83cc847075edfd529ea997cbf59757a710543500e6e00d945f1ef28b70c8b186
Contributions are welcome! Please feel free to submit a pull request
