Skip to content

Commit

Permalink
feat: Added Kernel 0.7 v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
poolpitako committed Jul 2, 2024
1 parent 6a63d8c commit 4f94046
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 7 deletions.
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
anvil:
image: ghcr.io/foundry-rs/foundry:nightly-c4a984fbf2c48b793c8cd53af84f56009dd1070c
ports: [ "8545:8545" ]
entrypoint: [ "anvil", "--host", "0.0.0.0", "--block-time", "0.1", "--silent"]
# Uncomment this if you want to use a fork
#entrypoint: [ "anvil", "--chain-id", "1", "--fork-url", "http://your_node:845", "--host", "0.0.0.0", "--block-time", "0.1", "--silent"]
platform: linux/amd64/v8

mock-paymaster:
build:
context: ./mock-verifying-paymaster
dockerfile: Dockerfile
ports: [ "3000:3000" ]
environment:
- ALTO_RPC=http://alto:4337
- ANVIL_RPC=http://anvil:8545

alto:
build:
context: ./mock-alto-bundler
dockerfile: Dockerfile
ports: [ "4337:4337" ]
environment:
- ANVIL_RPC=http://anvil:8545
# Uncomment this if you want to use the forked version
#- SKIP_DEPLOYMENTS=true
13 changes: 11 additions & 2 deletions mock-alto-bundler/src/constants.ts

Large diffs are not rendered by default.

41 changes: 36 additions & 5 deletions mock-alto-bundler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import {
KERNEL_V06_FACTORY_CREATECALL,
KERNEL_V07_ACCOUNT_V3_LOGIC_CREATECALL,
KERNEL_V07_ECDSA_VALIDATOR_V3_CREATECALL,
KERNEL_V07_FACTORY_CREATECALL,
KERNEL_V07_FACTORY_V3_CREATECALL,
KERNEL_V07_META_FACTORY_CREATECALL,
KERNEL_V07_ACCOUNT_V3_1_LOGIC_CREATECALL,
KERNEL_V07_FACTORY_V3_1_CREATECALL,
LIGHT_ACCOUNT_FACTORY_V110_CREATECALL,
SAFE_MULTI_SEND_CALL_ONLY_CREATECALL,
SAFE_MULTI_SEND_CREATECALL,
Expand Down Expand Up @@ -75,6 +77,7 @@ const client = createPublicClient({

const main = async () => {
if (process.env.SKIP_DEPLOYMENTS) {
console.log("Skipping Deployments...")
// set nonces to match onchain nonces
const promises: any = [];

Expand Down Expand Up @@ -313,11 +316,11 @@ const main = async () => {
walletClient
.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: KERNEL_V07_FACTORY_CREATECALL,
data: KERNEL_V07_FACTORY_V3_CREATECALL,
gas: 15_000_000n,
nonce: nonce++,
})
.then(() => console.log("[KERNEL] Deploying V0.7 Factory"));
.then(() => console.log("[KERNEL] Deploying V0.7 Factory V3"));

walletClient
.sendTransaction({
Expand Down Expand Up @@ -346,6 +349,24 @@ const main = async () => {
})
.then(() => console.log("[KERNEL] Deploying V0.7 META FACTORY"));

walletClient
.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: KERNEL_V07_ACCOUNT_V3_1_LOGIC_CREATECALL,
gas: 15_000_000n,
nonce: nonce++,
})
.then(() => console.log("[KERNEL] Deploying V0.7 ACCOUNT V3_1 LOGIC "));

walletClient
.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: KERNEL_V07_FACTORY_V3_1_CREATECALL,
gas: 15_000_000n,
nonce: nonce++,
})
.then(() => console.log("[KERNEL] Deploying V0.7 Factory V3_1"));

walletClient
.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
Expand Down Expand Up @@ -386,16 +407,23 @@ const main = async () => {
// register 0x6723b44Abeec4E71eBE3232BD5B455805baDD22f
await sendTransaction(walletClient, {
account: kernelFactoryOwner,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* kernel factory v0.7 */,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* kernel factory v0.7 v3*/,
data: "0x6e7dbabb0000000000000000000000006723b44abeec4e71ebe3232bd5b455805badd22f0000000000000000000000000000000000000000000000000000000000000001",
});

await sendTransaction(walletClient, {
account: kernelFactoryOwner,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* kernel factory v0.7 */,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* Stake 0.1 eth in the entry point */,
data: "0xc7e55f3e0000000000000000000000000000000071727de22e5e9d8baf0edac6f37da0320000000000000000000000000000000000000000000000000000000000015180",
});

// register 0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419
await sendTransaction(walletClient, {
account: kernelFactoryOwner,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* kernel factory v0.7 v3.1 */,
data: "0x6e7dbabb000000000000000000000000aac5d4240af87249b3f71bc8e4a2cae074a3e4190000000000000000000000000000000000000000000000000000000000000001",
});

await anvilClient.stopImpersonatingAccount({
address: kernelFactoryOwner,
});
Expand Down Expand Up @@ -450,6 +478,9 @@ const main = async () => {
"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27", // Kernel v0.3.0 Account Logic
"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f", // Kernel v0.3.0 Factory
"0xd703aaE79538628d27099B8c4f621bE4CCd142d5", // Kernel v0.3.0 Meta Factory
"0xBAC849bB641841b44E965fB01A4Bf5F074f84b4D", // Kernel v0.3.1 Account Logic
"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419", // Kernel v0.3.1 Factory
"0xd703aaE79538628d27099B8c4f621bE4CCd142d5", // Kernel v0.3.1 Meta Factory
"0x00004EC70002a32400f8ae005A26081065620D20", // LightAccountFactory v1.1.0
"0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba", // LightAccount v1.1.0 implementation
]);
Expand Down

0 comments on commit 4f94046

Please sign in to comment.