diff --git a/contracts/mocks/Imports.sol b/contracts/mocks/Imports.sol new file mode 100644 index 0000000..d2a4197 --- /dev/null +++ b/contracts/mocks/Imports.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity ^0.8.24; + +/* solhint-disable reason-string */ + +import "account-abstraction/contracts/core/EntryPoint.sol"; diff --git a/package.json b/package.json index 21bcfb0..eaefe02 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "Biconomy Paymasters", + "name": "biconomy-paymasters", "description": "Account abstraction ERC4337 paymaster contracts", "version": "1.0.0", "author": { diff --git a/scripts/hardhat/deploy.ts b/scripts/hardhat/deploy.ts index aec5b4c..f1ac8e7 100644 --- a/scripts/hardhat/deploy.ts +++ b/scripts/hardhat/deploy.ts @@ -21,7 +21,11 @@ async function main() { // We recommend this pattern to be able to use async/await everywhere // and properly handle errors. -main().catch((error) => { - console.error(error); - process.exitCode = 1; -}); +main() + .then(() => { + process.exit(0); + }) + .catch((error) => { + console.error(error); + process.exitCode = 1; + }); diff --git a/scripts/hardhat/sample/deploy-verifying-paymaster.ts b/scripts/hardhat/sample/deploy-verifying-paymaster.ts new file mode 100644 index 0000000..db310e7 --- /dev/null +++ b/scripts/hardhat/sample/deploy-verifying-paymaster.ts @@ -0,0 +1,46 @@ +import { ethers } from "hardhat"; + +const entryPointAddress = + process.env.ENTRY_POINT_ADDRESS || + "0x0000000071727De22E5E9d8BAf0edAc6f37da032"; + +const verifyingSigner = + process.env.PAYMASTER_SIGNER_ADDRESS_PROD || + "0x2cf491602ad22944D9047282aBC00D3e52F56B37"; + +const deployEntryPoint = process.env.DEPLOY_ENTRY_POINT || true; + +async function main() { + let targetEntryPoint = entryPointAddress; + + if (deployEntryPoint) { + // Note: unless the network is actual chain where entrypoint is deployed, we have to deploy for hardhat node tests + const entryPoint = await ethers.deployContract("EntryPoint"); + + await entryPoint.waitForDeployment(); + + targetEntryPoint = entryPoint.target as string; + + console.log(`EntryPoint updated to ${entryPoint.target}`); + } + + const verifyingPaymaster = await ethers.deployContract("VerifyingPaymaster", [ + targetEntryPoint, + verifyingSigner, + ]); + + await verifyingPaymaster.waitForDeployment(); + + console.log(`VerifyingPaymaster deployed to ${verifyingPaymaster.target}`); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => { + process.exit(0); + }) + .catch((error) => { + console.error(error); + process.exitCode = 1; + });