Skip to content

Commit

Permalink
Merge pull request #96 from zerodevapp/feat/kernel-v3-ep-v0_7-integra…
Browse files Browse the repository at this point in the history
…tion

feat: kernel v3 and entrypoint v0.7 integration
  • Loading branch information
SahilVasava authored Apr 12, 2024
2 parents fbc7fd1 + 212bf13 commit a8a9ebb
Show file tree
Hide file tree
Showing 133 changed files with 8,802 additions and 2,630 deletions.
51 changes: 43 additions & 8 deletions build-all.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,70 @@
#!/bin/bash

# Define ANSI color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

# Define the list of directories containing package.json files that should be built.
# Assuming that all packages are directly under the 'packages' and 'plugins' directories.

DIRECTORIES=("packages/*" "plugins/*")

# Arrays to keep track of build statuses
SUCCEEDED=()
FAILED=()

# Loop through each directory and run 'bun run build'.
for DIR in ${DIRECTORIES[@]}; do
# Check if the directory contains a package.json file.
if [ -f "$DIR/package.json" ]; then
# Use jq to check if a build script exists in the package.json
if jq -e '.scripts.build' "$DIR/package.json" > /dev/null; then
echo "Building $DIR"
(cd $DIR && bun run build)
echo "🔨 Attempting to build $DIR"
if (cd $DIR && bun run build); then
printf "${GREEN}✅ Build succeeded for $DIR${NC}\n\n"
SUCCEEDED+=("$DIR")
else
printf "${RED}❌ Build failed for $DIR${NC}\n\n"
FAILED+=("$DIR")
fi
else
echo "No build script found in $DIR, skipping..."
echo "No build script found in $DIR, skipping...\n"
fi
else
# If the directory does not contain a package.json file, loop through its subdirectories.
for SUBDIR in $DIR/*; do
if [ -f "$SUBDIR/package.json" ]; then
# Use jq to check if a build script exists in the package.json
if jq -e '.scripts.build' "$SUBDIR/package.json" > /dev/null; then
echo "Building $SUBDIR"
(cd $SUBDIR && bun run build)
echo "🔨 Attempting to build $SUBDIR"
if (cd $SUBDIR && bun run build); then
printf "${GREEN}✅ Build succeeded for $SUBDIR${NC}\n\n"
SUCCEEDED+=("$SUBDIR")
else
printf "${RED}❌ Build failed for $SUBDIR${NC}\n\n"
FAILED+=("$SUBDIR")
fi
else
echo "No build script found in $SUBDIR, skipping..."
echo "No build script found in $SUBDIR, skipping...\n"
fi
fi
done
fi
done

echo "Build process completed."
echo "🏁 Build process completed.\n"

# Print summary
if [ ${#SUCCEEDED[@]} -ne 0 ]; then
printf "${GREEN}✅ Build succeeded for:${NC}\n"
for item in "${SUCCEEDED[@]}"; do
printf "${GREEN}- $item${NC}\n"
done
fi

if [ ${#FAILED[@]} -ne 0 ]; then
printf "\n${RED}❌ Build failed for:${NC}\n"
for item in "${FAILED[@]}"; do
printf "${RED}- $item${NC}\n"
done
fi
Binary file modified bun.lockb
Binary file not shown.
78 changes: 39 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"workspaces": [
"packages/*",
"templates/*",
"plugins/*"
],
"private": true,
"author": "ZeroDev",
"type": "module",
"sideEffects": false,
"devDependencies": {
"@ambire/signature-validator": "^1.3.1",
"@biomejs/biome": "^1.0.0",
"@changesets/changelog-git": "^0.1.14",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@size-limit/esbuild-why": "^9.0.0",
"@size-limit/preset-small-lib": "^9.0.0",
"ethers": "5",
"rimraf": "^5.0.1",
"simple-git-hooks": "^2.9.0",
"size-limit": "^9.0.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2"
},
"description": "",
"keywords": [],
"license": "MIT",
"scripts": {
"build": "sh build-all.sh",
"format": "biome format . --write",
"lint": "biome check .",
"lint:fix": "bun run lint --apply",
"changeset": "changeset",
"changeset:release": "bun run build && changeset publish",
"changeset:version": "changeset version && bun install --lockfile-only"
},
"simple-git-hooks": {
"pre-commit": "bun run format && bun run lint:fix"
}
"workspaces": [
"packages/*",
"templates/*",
"plugins/*"
],
"private": true,
"author": "ZeroDev",
"type": "module",
"sideEffects": false,
"devDependencies": {
"@ambire/signature-validator": "^1.3.1",
"@biomejs/biome": "^1.0.0",
"@changesets/changelog-git": "^0.1.14",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@size-limit/esbuild-why": "^9.0.0",
"@size-limit/preset-small-lib": "^9.0.0",
"ethers": "5",
"rimraf": "^5.0.1",
"simple-git-hooks": "^2.9.0",
"size-limit": "^9.0.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2"
},
"description": "",
"keywords": [],
"license": "MIT",
"scripts": {
"build": "sh build-all.sh",
"format": "biome format . --write",
"lint": "biome check .",
"lint:fix": "bun run lint --apply",
"changeset": "changeset",
"changeset:release": "bun run build && changeset publish",
"changeset:version": "changeset version && bun install --lockfile-only"
},
"simple-git-hooks": {
"pre-commit": "bun run format && bun run lint:fix"
}
}
4 changes: 2 additions & 2 deletions packages/core/accounts/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export {
createKernelAccount,
type KernelSmartAccount,
KERNEL_ADDRESSES,
EIP1271ABI
KERNEL_ADDRESSES
} from "./kernel/createKernelAccount.js"
export { createKernelV1Account } from "./kernel/v1/createKernelV1Account.js"
export { createKernelV2Account } from "./kernel/v2/createKernelV2Account.js"
export { KernelAccountV2Abi } from "./kernel/v2/abi/KernelAccountV2Abi.js"
export { KernelFactoryV2Abi } from "./kernel/v2/abi/KernelFactoryV2Abi.js"
export { EIP1271Abi } from "./kernel/abi/EIP1271Abi.js"
export { addressToEmptyAccount } from "./addressToEmptyAccount.js"
export * from "./utils/index.js"
33 changes: 33 additions & 0 deletions packages/core/accounts/kernel/abi/EIP1271Abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export const EIP1271Abi = [
{
type: "function",
name: "eip712Domain",
inputs: [],
outputs: [
{ name: "fields", type: "bytes1", internalType: "bytes1" },
{ name: "name", type: "string", internalType: "string" },
{ name: "version", type: "string", internalType: "string" },
{ name: "chainId", type: "uint256", internalType: "uint256" },
{
name: "verifyingContract",
type: "address",
internalType: "address"
},
{ name: "salt", type: "bytes32", internalType: "bytes32" },
{ name: "extensions", type: "uint256[]", internalType: "uint256[]" }
],
stateMutability: "view"
},
{
type: "function",
name: "isValidSignature",
inputs: [
{ name: "data", type: "bytes32", internalType: "bytes32" },
{ name: "signature", type: "bytes", internalType: "bytes" }
],
outputs: [
{ name: "magicValue", type: "bytes4", internalType: "bytes4" }
],
stateMutability: "view"
}
] as const
6 changes: 6 additions & 0 deletions packages/core/accounts/kernel/abi/SafeCreateCallAbi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { parseAbi } from "viem"

export const SafeCreateCallAbi = parseAbi([
"function performCreate(uint256 value, bytes memory deploymentData) public returns (address newContract)",
"function performCreate2(uint256 value, bytes memory deploymentData, bytes32 salt) public returns (address newContract)"
])
Loading

0 comments on commit a8a9ebb

Please sign in to comment.