Giter Site home page Giter Site logo

aa-dapp's Introduction

AA-dapp

Account Abstraction を学習するリポジトリです。

コマンド系

  • 初期設定ファイルの生成
yarn run init
"scripts": {
    "lint": "eslint . && tsc --noEmit",
    "lint:fix": "eslint . --fix",
    "prettier": "prettier --check --ignore-path ./.eslintignore '**'",
    "prettier:fix": "prettier --write --ignore-path ./.eslintignore '**'",
    "init": "ts-node scripts/init.ts",
    "simpleAccount:address": "ts-node scripts/simpleAccount/address.ts",
    "simpleAccount:transfer": "ts-node scripts/simpleAccount/transfer.ts",
    "simpleAccount:erc20Transfer": "ts-node scripts/simpleAccount/erc20Transfer.ts",
    "simpleAccount:batchTransfer": "ts-node scripts/simpleAccount/batchTransfer.ts",
    "simpleAccount:batchErc20Transfer": "ts-node scripts/simpleAccount/batchErc20Transfer.ts"
}
  • simpleAccount アドレスの生成
yarn run simpleAccount:address

結果

SimpleAccount address: 0x100cD9e97EdAEe0950d97f75251313e45213C8Fb
✨  Done in 1.56s.
  • MATIC の送金コマンド
yarn run simpleAccount:transfer 0x1431ea8af860C3862A919968C71f901aEdE1910E 0.03

結果

Signed UserOperation: {
  "sender": "0x100cD9e97EdAEe0950d97f75251313e45213C8Fb",
  "nonce": "0x0",
  "initCode": "0xe19e9755942bb0bd0cccce25b1742596b8a8250b3bf2c3e700000000000000000000000078d4f01f56b982a3b03c4e127a5d3afa8ebee68600000000000000000000000051908f598a5e0d8f1a3babfa6df76f9704dad0720000000000000000000000000000000000000000000000000000000000000000",
  "callData": "0x80c5c7d00000000000000000000000001431ea8af860c3862a919968c71f901aede1910e000000000000000000000000000000000000000000000000006a94d74f43000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
  "callGasLimit": "0x5580",
  "verificationGasLimit": "0x129727",
  "maxFeePerGas": "0xa2c22e83",
  "maxPriorityFeePerGas": "0xa2c22e65",
  "paymasterAndData": "0x",
  "preVerificationGas": "0xc644",
  "signature": "0xff954fe43538bf8fff0f928aa03f58c62b7c28d9b14912c4e1b452853124bd622053de4915a85e55697f714e80bf7668670e043467d2116df33979a1c2fd2f551b"
}
UserOpHash: 0x854c14b08bd913b7960edc3d4cbef6d65666e20e1494c4a0831a46cb18829fd1
Waiting for transaction...
Transaction hash: 0xc561b6a5410ffc8c10bd36b4102a08e57dc92040e4706526c3acedc42143d20d
✨  Done in 13.44s.
  • ERC20 規格のトークンを送金するコマンド
yarn run simpleAccount:erc20Transfer 0x326C977E6efc84E512bB9C30f76E30c160eD06FB 0x1431ea8af860C3862A919968C71f901aEdE1910E 0.04

結果

Transferring 0.04 LINK...
Signed UserOperation: {
  "sender": "0x100cD9e97EdAEe0950d97f75251313e45213C8Fb",
  "nonce": "0x1",
  "initCode": "0x",
  "callData": "0x80c5c7d0000000000000000000000000326c977e6efc84e512bb9c30f76e30c160ed06fb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000001431ea8af860c3862a919968c71f901aede1910e000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000000000000",
  "callGasLimit": "0xe6fc",
  "verificationGasLimit": "0x186a0",
  "maxFeePerGas": "0xca0f4bb3",
  "maxPriorityFeePerGas": "0xca0f4b95",
  "paymasterAndData": "0x",
  "preVerificationGas": "0xc37c",
  "signature": "0x06bcf3dcded028a8c42ef90c72f4fea98e54ecd4da2366288cb50851ee60ee0512d6f74a998633109d9352ad0453e3665aa3171147bcf8a876676449499eeef61b"
}
UserOpHash: 0xade156da0c2b036926618ed914b2f87dca006d14ba4de29e949326be89cc4096
Waiting for transaction...
Transaction hash: 0xdc695a878c6bbfa8e149ea19fddcaad782f98707971d81201d4954113810dd2c
✨  Done in 13.16s.
  • MATIC のバッチ送金コマンド
yarn run simpleAccount:batchTransfer 0x51908F598A5e0d8F1A3bAbFa6DF76F9704daD072,0x1431ea8af860C3862A919968C71f901aEdE1910E 0.25

結果

Signed UserOperation: {
  "sender": "0x100cD9e97EdAEe0950d97f75251313e45213C8Fb",
  "nonce": "0x0",
  "initCode": "0x",
  "callData": "0x80c5c7d0000000000000000000000000100cd9e97edaee0950d97f75251313e45213c8fb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000204d0cb75fa000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000100cd9e97edaee0950d97f75251313e45213c8fb000000000000000000000000100cd9e97edaee0950d97f75251313e45213c8fb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044a9059cbb00000000000000000000000051908f598a5e0d8f1a3babfa6df76f9704dad07200000000000000000000000000000000000000000000000003782dace9d90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000001431ea8af860c3862a919968c71f901aede1910e00000000000000000000000000000000000000000000000003782dace9d900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "callGasLimit": "0xe31a",
  "verificationGasLimit": "0x186a0",
  "maxFeePerGas": "0x7d7a574e",
  "maxPriorityFeePerGas": "0x7d7a5730",
  "paymasterAndData": "0x",
  "preVerificationGas": "0xd56c",
  "signature": "0x804964cc35c21fcb0fd1b4c4fe854a9deb5c7ea9117d68c31b4948914d282fdc53812ebb003ee542e35af8793b60917b0600be54fd05192598a6df396c6c47a81b"
}
UserOpHash: 0x77b6dd28dbd8691ea0ae23cc63bbd32f18889723e1c31f04cf534ae7e47569e5
Waiting for transaction...
Transaction hash: 0x381f4d559a033559d38370b24280ecad09017bf657f41e6eb277a0691cf5f248
✨  Done in 16.04s.
  • ERC20 規格のトークンのバッチ送金コマンド
yarn run simpleAccount:batchErc20Transfer 0x326C977E6efc84E512bB9C30f76E30c160eD06FB 0x1431ea8af860C3862A919968C71f901aEdE1910E,0x51908F598A5e0d8F1A3bAbFa6DF76F9704daD072 0.04

結果

Batch transferring 0.04 LINK to 2 recipients...
Signed UserOperation: {
  "sender": "0x100cD9e97EdAEe0950d97f75251313e45213C8Fb",
  "nonce": "0x2",
  "initCode": "0x",
  "callData": "0x80c5c7d0000000000000000000000000100cd9e97edaee0950d97f75251313e45213c8fb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000204d0cb75fa000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000326c977e6efc84e512bb9c30f76e30c160ed06fb000000000000000000000000326c977e6efc84e512bb9c30f76e30c160ed06fb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000001431ea8af860c3862a919968c71f901aede1910e000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044a9059cbb00000000000000000000000051908f598a5e0d8f1a3babfa6df76f9704dad072000000000000000000000000000000000000000000000000008e1bc9bf0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "callGasLimit": "0xea85",
  "verificationGasLimit": "0x186a0",
  "maxFeePerGas": "0x99adc148",
  "maxPriorityFeePerGas": "0x99adc12a",
  "paymasterAndData": "0x",
  "preVerificationGas": "0xd560",
  "signature": "0x9efbbce4eedb58268350032f6033db120bfe54d34ca920bb15ff72c46f681a2032b2609cb910b646abb5cd87b65a5e1d1e86205bcc64e60d971fff210e72cd611c"
}
UserOpHash: 0x856e6d3741c710a76eb4e300fee208b8a33f93425f59be5ed3fea4a35ace9db9
Waiting for transaction...
Transaction hash: 0xab22e6bf970c6784aa6d9aa0e44a19adf428999b28370fbe4390fdcc63a31c63
✨  Done in 16.64s.

参考文献

  1. Stackup
  2. EIP-4337: Account Abstraction using alt mempool
  3. Stackup Docs
  4. Stackup QuickStart
  5. Stackup QuickStart Video
  6. 【GitHub】erc-4337-examples
  7. 【Mumbai】entrypoint Contract
  8. stackup-bundler
  9. Stackup dashboard

aa-dapp's People

Contributors

mashharuki avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.