Coder Social home page Coder Social logo

alchemy-mego-smart-account's Introduction

Alchemy Smart Account x MEGO

This is a boilerplate for creating a smart account using Alchemy's smart contract Account Kit. It includes few scripts to help you get started with your smart account and a guide to use MEGO to interact with it.

Prerequisites

  • Create an account on Alchemy and get your API key.
  • Create a Policy on Sepolia Optimism and get the policy id.
  • Create two different EOA private keys.
  • (Optional) Create an account on MEGO and get your email and password.

Save everything in a .env file in the root of the project, following the .env.example file.

Install dependencies

yarn

Available scripts

yarn local:get-address --> Get the address of the smart account
yarn local:get-address --key SPONSORED_KEY --> Get the address of the sponsored account (or any other key you define)
yarn local:send-tx --value 0.0001 --to 0x4009D3B945164cF0c8F66Bd0f800044813422821 --> Sponsor an ETH transfer from the smart account to the receiver address, specify a different key with --key parameter (only local)
yarn local:interact-tx --to 0x4009D3B945164cF0c8F66Bd0f800044813422821 --calldata 0x --> Sponsor an interaction from the smart account to the receiver address, pass calldata to the transaction with --calldata parameter

Use MEGO to interact with the smart account

First create an account on MEGO using email and password (Social login will arrive ASAP).

Then add MEGO_PWD and MEGO_EMAIL to your .env file.

The you can use the same scripts as before, just change local with mego.

ENJOY!

Conclusion

This boilerplate is a good starting point to create your own smart account logic using Alchemy's Account Kit or use MEGO. It includes a few scripts to help you interact with your smart account and sponsored account. Feel free to modify it to fit your needs.

You can see the results of a successful interaction here: https://optimism-sepolia.blockscout.com/address/0x4E3556E7EE54e37E2B392Ce823BEfB13dEeA079e?tab=user_ops

alchemy-mego-smart-account's People

Contributors

turinglabsorg avatar

Watchers

 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.