Coder Social home page Coder Social logo

tba's Introduction

Token Bound Accounts (TBAs)

Token bound accounts are smart wallets where the ownership of the wallet is tied to an ERC-721 token. Only the owner of the specified token can perform actions on the wallet such as sending or withdrawing tokens.

It can be thought of as a way of allowing ERC-721 tokens to hold other assets.

This template provides a way to programmatically deploy TBAs through the TokenBoundAccountFactory. Each TBA contract is ERC-4337 compliant and has the account abstraction infrastructure, such as paymasters, already set up and ready to use.

For more information on TBAs, read this blog.

Pre Requisits

  • This is a Foundry project so make sure that you have Foundry installed.
  • Git.

Getting Started

Firstly, clone this repo locally using git clone

These contracts extend the ERC-4337 compliant smart wallet Account and BaseFactory contracts provided by the thirdweb Solidity SDK in the @thirdweb-dev/contracts package.

To install the dependencies and make sure that Foundry is installed correctly run:

foundryup && forge clean && forge install

Building the project

After any changes to the contract, run:

forge build

Deploying Contracts Programatically

Firstly, we will need to deploy our TokenBoundAccountFactory to be able to distribute TBAs to token holders. Run the following command to deploy your contract:

npx thirdweb deploy

Select the TokenBoundAccountFactory contract. This will pop up a browser window where you can select a chain and fill in the constructor parameters:

  • EntryPoint: 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789

Now, deploy the TokenBoundAccount implementation contract in the same way, using the newly deployed factory contract address for the factory parameter.

Now, you can programatically create TBAs directly from the Dashboard from your factory contract OR you can build your TBAs into a frontend using our smart wallet connector.

Join our Discord!

For any questions, suggestions, join our discord at https://discord.gg/thirdweb.

tba's People

Contributors

unbanksytv 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.