Skip to content

Commit

Permalink
feat: add initial skeleton for 6900 account support
Browse files Browse the repository at this point in the history
  • Loading branch information
moldy530 committed Nov 14, 2023
1 parent c30760b commit 750aad0
Show file tree
Hide file tree
Showing 9 changed files with 507 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
8 changes: 8 additions & 0 deletions packages/accounts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ export type { KernelBaseValidatorParams } from "./kernel-zerodev/validator/base.
//light-account exports
export { LightSmartContractAccount } from "./light-account/account.js";
export { getDefaultLightAccountFactoryAddress } from "./light-account/utils.js";

// msca exports
export { ModularSmartContractAccount } from "./msca/account.js";
export type { ModularSmartContractAccountParams } from "./msca/account.js";
export {
MultiOwnerPlugin,
MultiOwnerPluginSigner,
} from "./msca/plugins/multi-owner/index.js";
74 changes: 74 additions & 0 deletions packages/accounts/src/msca/abis/IStandardExecutor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
export const IStandardExecutorAbi = [
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "bytes",
name: "data",
type: "bytes",
},
],
internalType: "struct Execution",
name: "execution",
type: "tuple",
},
],
name: "execute",
outputs: [
{
internalType: "bytes",
name: "",
type: "bytes",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "bytes",
name: "data",
type: "bytes",
},
],
internalType: "struct Execution[]",
name: "executions",
type: "tuple[]",
},
],
name: "executeBatch",
outputs: [
{
internalType: "bytes[]",
name: "",
type: "bytes[]",
},
],
stateMutability: "payable",
type: "function",
},
] as const;
237 changes: 237 additions & 0 deletions packages/accounts/src/msca/abis/MultiOwnerMSCAFactory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
export const MultiOwnerMSCAFactoryAbi = [
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address",
},
{
internalType: "address",
name: "multiOwnerPlugin",
type: "address",
},
{
internalType: "address",
name: "implementation",
type: "address",
},
{
internalType: "bytes32",
name: "manifestHash",
type: "bytes32",
},
{
internalType: "contract IEntryPoint",
name: "entryPoint",
type: "address",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferred",
type: "event",
},
{
inputs: [],
name: "ENTRYPOINT",
outputs: [
{
internalType: "contract IEntryPoint",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "IMPL",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "MULTI_OWNER_PLUGIN",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint32",
name: "unstakeDelay",
type: "uint32",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "addStake",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "salt",
type: "uint256",
},
{
internalType: "address[]",
name: "owners",
type: "address[]",
},
],
name: "createAccount",
outputs: [
{
internalType: "address",
name: "addr",
type: "address",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "salt",
type: "uint256",
},
{
internalType: "address[]",
name: "owners",
type: "address[]",
},
],
name: "getAddress",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "unlockStake",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address payable",
name: "to",
type: "address",
},
{
internalType: "address",
name: "token",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "withdraw",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address payable",
name: "to",
type: "address",
},
],
name: "withdrawStake",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
stateMutability: "payable",
type: "receive",
},
] as const;
Loading

0 comments on commit 750aad0

Please sign in to comment.