Skip to content

Commit

Permalink
further refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Mar 19, 2024
1 parent c4ef9c5 commit c009873
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 5 deletions.
6 changes: 6 additions & 0 deletions contracts/mocks/Imports.sol
Original file line number Diff line number Diff line change
@@ -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";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Biconomy Paymasters",
"name": "biconomy-paymasters",
"description": "Account abstraction ERC4337 paymaster contracts",
"version": "1.0.0",
"author": {
Expand Down
12 changes: 8 additions & 4 deletions scripts/hardhat/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
46 changes: 46 additions & 0 deletions scripts/hardhat/sample/deploy-verifying-paymaster.ts
Original file line number Diff line number Diff line change
@@ -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;
});

0 comments on commit c009873

Please sign in to comment.