Skip to content

vechain/account-abstraction-demo

Repository files navigation

Account Abstraction Demo

Introduction

An end to end demo of account abstraction on the VechainThor blockchain.

Getting Started

Setup

  1. Initialize submodules git submodule update --init --recursive

  2. Clone latest thor and run it with flag --api-allow-custom-tracer:

    bin/thor solo --on-demand --api-allow-custom-tracer --data-dir /data/thor --api-addr 0.0.0.0:8669 --api-cors '*' --api-backtrace-limit -1 --verbosity 4
  3. Deploy Contracts

    cd account-abstraction
    yarn --ignore-engines && yarn run hardhat test test/deploy-contracts.test.ts --network vechain
    cd ..

    Sample output:

    Contract: Deployments
      TestUtils address:                 0xC0a5459871aD8Ff4c9f5EeE7b41eE394ed415EB3
      EntryPoint address:                0x1B433B67cE2CF743673a04268a088C8615413084
      SimpleAccountFactory address:      0x29D17a4bdF64EeC4f05c27e9afA7556E4a9208ff
      FakeSimpleAccountFactory address:  0xEf3d1eeD859f88215475C3d77F6503EEf7f8D985
    
  4. Build web3-providers-connex with debug_traceCall support

    cd web3-providers-connex
    npm install && npm run build
    cd ..
  5. Build hardhat-plugins with local web3-providers-connex dependency

    cd hardhat-plugins
    yarn install && yarn build
    cd ..
  6. Build bundler with local hardhat-plugins dependency

    cd bundler
    yarn && yarn preprocess
  7. Copy EntryPoint address value from the deployment output at step 2 to bundler/localconfig/bundler.config.json

  8. Run bundler

    yarn run bundler

    The bundler should now run in safe mode which supports debug_traceCall

  9. Change the config under account-abstraction/test/config.ts with your EntryPoint and SimpleAccountFactory addresses that you got in step 2.

  10. Run the funding script (make sure you change the account in the script to your SimpleAccount address, you can get that when running either Trampoline or Stackup)

cd account-abstraction
yarn run hardhat test test/test_custom.ts --network vechain
cd ..

Using Stackup as client

DISCLAIMER: Contracts should be deployed and Bundler up and running beforehand (see previous section).

  1. Navigate to the stackup directory and follow the readme

  2. Start the server by running yarn run server on a separate terminal

  3. Navigate to the demo folder and run it on a separate terminal

cd demo-eip-4337
npm install
npm start

Contributing

See CONTRIBUTING for further details on how to contribute.

License

Distrubuted under the MIT license. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •