Skip to content

moonkey-global/moonkey-contracts

Repository files navigation

🌔 MoonKey Contracts

This repo started as a fork of the ZeroDev repo based on official AA repo.

Setup

Clone this repo into your local environment:

git clone git@github.com:moonkey-global/moonkey-contracts.git
cd moonkey-contracts

Install dependencies:

yarn install

Commands

Once you have an environment setup, these commands can be used for running the example scripts.

Get account address

Smart contract account addresses can be deterministically generated.

The account will be deployed by this command transaction.

yarn hardhat run ./scripts/run/deploy.ts

Transfer ETH

Before executing a transfer, make sure to deposit some ETH to the address.

yarn run ts-node --files ./scripts/run/transfer.ts <to-address> <value-wei>

Transfer ERC-20 token

Make sure the address generated has enough specified tokens to execute the transfer.

If not using a paymaster, make sure to also have enough ETH to pay gas fees.

yarn run ts-node --files ./scripts/run/transfer_erc20.ts <token-contract> <to-address> <value>

Transfer using Paymaster

Before executing transaction using paymaster, make sure to update the verifying paymaster address. Current address only allows spending for team members. Therefore deploy your own paymaster and use that address.

yarn run ts-node --files ./scripts/run/paymaster.ts <to-address> <value-wei>

Custom deployment

If You want to use your own account factory or you want to use paymaster follow this steps.

First, edit hardhat.config.ts and uncomment namedAccounts and etherscan

yarn hardhat --network <target-network> deploy

Then to verify the contracts for EtherScan

yarn hardhat --network <target-network> etherscan-verify

Alternative verification of source file,

yarn hardhat --network <target-network> sourcify

About

ERC4337 account abstraction based on eth-infinitism implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors