This repo started as a fork of the ZeroDev repo based on official AA repo.
Clone this repo into your local environment:
git clone git@github.com:moonkey-global/moonkey-contracts.git
cd moonkey-contractsInstall dependencies:
yarn installOnce you have an environment setup, these commands can be used for running the example scripts.
Smart contract account addresses can be deterministically generated.
The account will be deployed by this command transaction.
yarn hardhat run ./scripts/run/deploy.tsBefore 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>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>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>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> deployThen to verify the contracts for EtherScan
yarn hardhat --network <target-network> etherscan-verifyAlternative verification of source file,
yarn hardhat --network <target-network> sourcify