From f3e502672857febd8c80669fded1aece6ba60ab9 Mon Sep 17 00:00:00 2001 From: Oleksiy Pyltsov Date: Sat, 13 Jul 2024 18:55:13 +0200 Subject: [PATCH] Remove examples --- contracts-modulesdk/package-lock.json | 177 ------------------ contracts-modulesdk/package.json | 17 -- contracts-modulesdk/smart-account.ts | 42 ----- contracts-modulesdk/web3-wingman.ts | 26 --- contracts-permissionless-example/abi.js | 22 --- contracts-permissionless-example/index.js | 0 .../package-lock.json | 0 contracts-permissionless-example/package.json | 0 8 files changed, 284 deletions(-) delete mode 100644 contracts-modulesdk/package-lock.json delete mode 100644 contracts-modulesdk/package.json delete mode 100644 contracts-modulesdk/smart-account.ts delete mode 100644 contracts-modulesdk/web3-wingman.ts delete mode 100644 contracts-permissionless-example/abi.js delete mode 100644 contracts-permissionless-example/index.js delete mode 100644 contracts-permissionless-example/package-lock.json delete mode 100644 contracts-permissionless-example/package.json diff --git a/contracts-modulesdk/package-lock.json b/contracts-modulesdk/package-lock.json deleted file mode 100644 index 3ec9490..0000000 --- a/contracts-modulesdk/package-lock.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "name": "test-app", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "test-app", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@rhinestone/module-sdk": "^0.1.2", - "permissionless": "^0.1.39", - "viem": "^2.17.3" - } - }, - "node_modules/@adraffy/ens-normalize": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", - "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==" - }, - "node_modules/@noble/curves": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", - "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", - "dependencies": { - "@noble/hashes": "1.4.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@rhinestone/module-sdk": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@rhinestone/module-sdk/-/module-sdk-0.1.7.tgz", - "integrity": "sha512-kQUIKjooBRzoNlAv+424Ev3aDkLPDLzrE0Mzbua+/JpRBZW5ewHT+b5hPkTgoa+iNx0pj+4Btq2IQHNtvj5jFA==", - "peerDependencies": { - "viem": "^2.0.0" - } - }, - "node_modules/@scure/base": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", - "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", - "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "dependencies": { - "@noble/curves": "~1.4.0", - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", - "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "dependencies": { - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/abitype": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.5.tgz", - "integrity": "sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw==", - "funding": { - "url": "https://github.com/sponsors/wevm" - }, - "peerDependencies": { - "typescript": ">=5.0.4", - "zod": "^3 >=3.22.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - }, - "zod": { - "optional": true - } - } - }, - "node_modules/isows": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.4.tgz", - "integrity": "sha512-hEzjY+x9u9hPmBom9IIAqdJCwNLax+xrPb51vEPpERoFlIxgmZcHzsT5jKG06nvInKOBGvReAVz80Umed5CczQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/wagmi-dev" - } - ], - "peerDependencies": { - "ws": "*" - } - }, - "node_modules/permissionless": { - "version": "0.1.39", - "resolved": "https://registry.npmjs.org/permissionless/-/permissionless-0.1.39.tgz", - "integrity": "sha512-xfJAgzyELvWFqQdm6SxmnjdL6lytUPem3aYhKqHa3jmWHDtE1liXmEVxRYTSjL51xfX0HiZ3ulXH5hIC9r4tEQ==", - "peerDependencies": { - "viem": "^2.14.1" - } - }, - "node_modules/viem": { - "version": "2.17.3", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.17.3.tgz", - "integrity": "sha512-FY/1uBQWfko4Esy8mU1RamvL64TLy91LZwFyQJ20E6AI3vTTEOctWfSn0pkMKa3okq4Gxs5dJE7q1hmWOQ7xcw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/wevm" - } - ], - "dependencies": { - "@adraffy/ens-normalize": "1.10.0", - "@noble/curves": "1.4.0", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0", - "abitype": "1.0.5", - "isows": "1.0.4", - "ws": "8.17.1" - }, - "peerDependencies": { - "typescript": ">=5.0.4" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - } - } -} diff --git a/contracts-modulesdk/package.json b/contracts-modulesdk/package.json deleted file mode 100644 index be3e12e..0000000 --- a/contracts-modulesdk/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "test-app", - "version": "1.0.0", - "description": "", - "main": "smart-account.ts", - "type": "module", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "@rhinestone/module-sdk": "^0.1.2", - "permissionless": "^0.1.39", - "viem": "^2.17.3" - } -} diff --git a/contracts-modulesdk/smart-account.ts b/contracts-modulesdk/smart-account.ts deleted file mode 100644 index 4c76ae5..0000000 --- a/contracts-modulesdk/smart-account.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { - ENTRYPOINT_ADDRESS_V07, - createSmartAccountClient, -} from "permissionless"; -import { signerToSafeSmartAccount } from "permissionless/accounts"; -import { - createPimlicoBundlerClient, -} from "permissionless/clients/pimlico"; -import { createPublicClient, getContract, http, parseEther } from "viem"; -import { sepolia } from "viem/chains"; -import { privateKeyToAccount } from "viem/accounts"; - -const signer = privateKeyToAccount(""); - -export const publicClient = createPublicClient({ - transport: http("https://rpc.ankr.com/eth_sepolia"), -}); - -export const pimlicoBundlerClient = createPimlicoBundlerClient({ - transport: http("https://api.pimlico.io/v2/sepolia/rpc?apikey="), - entryPoint: ENTRYPOINT_ADDRESS_V07, -}); - -export const safeAccount = await signerToSafeSmartAccount(publicClient, { - entryPoint: ENTRYPOINT_ADDRESS_V07, - signer: signer, - saltNonce: 0n, // optional - safeVersion: "1.4.1", -}); - -export const smartAccountClient = createSmartAccountClient({ - account: safeAccount, - entryPoint: ENTRYPOINT_ADDRESS_V07, - chain: sepolia, - bundlerTransport: http( - "https://api.pimlico.io/v2/sepolia/rpc?apikey=" - ), - middleware: { - gasPrice: async () => - (await pimlicoBundlerClient.getUserOperationGasPrice()).fast, - }, -}); \ No newline at end of file diff --git a/contracts-modulesdk/web3-wingman.ts b/contracts-modulesdk/web3-wingman.ts deleted file mode 100644 index f5d602c..0000000 --- a/contracts-modulesdk/web3-wingman.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { getWeb3Wingman } from "@rhinestone/module-sdk"; -import { privateKeyToAccount } from "viem/accounts"; -import {pimlicoBundlerClient, publicClient, safeAccount, smartAccountClient} from "./smart-account.js"; - -const nominee = privateKeyToAccount(""); - -const module = await getWeb3Wingman({ - nominee: nominee.address, - timeout: "100", // in seconds - moduleType: "validator", - account: safeAccount, - client: publicClient -}); - -const opHash = await smartAccountClient.installModule({ - type: module.type, - address: module.module, - context: module.data, -}); - -await pimlicoBundlerClient.waitForUserOperationReceipt({ - hash: opHash, - timeout: 100000, -}); - -console.log(module) diff --git a/contracts-permissionless-example/abi.js b/contracts-permissionless-example/abi.js deleted file mode 100644 index 91d43c0..0000000 --- a/contracts-permissionless-example/abi.js +++ /dev/null @@ -1,22 +0,0 @@ -export const abi = [ - { - inputs: [{ internalType: 'address', name: 'account', type: 'address' }], - name: 'config', - outputs: [ - { internalType: 'uint48', name: 'lastAccess', type: 'uint48' }, - { internalType: 'uint48', name: 'timeout', type: 'uint48' }, - { internalType: 'address', name: 'nominee', type: 'address' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'smartAccount', type: 'address' }, - ], - name: 'isInitialized', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, -] \ No newline at end of file diff --git a/contracts-permissionless-example/index.js b/contracts-permissionless-example/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/contracts-permissionless-example/package-lock.json b/contracts-permissionless-example/package-lock.json deleted file mode 100644 index e69de29..0000000 diff --git a/contracts-permissionless-example/package.json b/contracts-permissionless-example/package.json deleted file mode 100644 index e69de29..0000000