Skip to content

Commit ab0e32d

Browse files
authored
Merge pull request #24 from pimlicolabs/fix/forked-env
fix/forked env
2 parents ef8ffb3 + ad8dfb5 commit ab0e32d

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

mock-contract-deployer/src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,25 @@ const main = async () => {
130130

131131
if (process.env.SKIP_DEPLOYMENTS) {
132132
console.log("Skipping Deployments...");
133+
134+
// Remove EIP-7702 code delegations from anvil accounts 0-9
135+
// This resets them to regular EOAs for testing on forked mainnet.
136+
// Most anvil accounts are delegated via 7702 to sweeper accounts; this loop removes them.
137+
for (let i = 0; i < 10; i++) {
138+
const account = mnemonicToAccount(
139+
"test test test test test test test test test test test junk",
140+
{ addressIndex: i },
141+
);
142+
await anvilClient.setCode({
143+
address: account.address,
144+
bytecode: "0x",
145+
});
146+
await anvilClient.setBalance({
147+
address: account.address,
148+
value: parseEther("10000"),
149+
});
150+
}
151+
133152
// set nonces to match onchain nonces
134153
const promises: any = [];
135154

mock-verifying-paymaster/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"start": "tsx src/wait-anvil.ts && tsx src/index.ts"
66
},
77
"dependencies": {
8-
"@pimlico/mock-paymaster": "^0.0.6",
8+
"@pimlico/mock-paymaster": "^0.0.7",
99
"prool": "^0.0.25",
1010
"zod-validation-error": "^5.0.0"
1111
},

0 commit comments

Comments
 (0)