Giter VIP home page Giter VIP logo

tba's Introduction

ERC-6551 Reference Implementation on Starknet

This repository contains the reference implementation of ERC-6551 on Starknet.

NB: This project is under active development and may undergo changes until SNIP-72 is finalized.

The Tokenbound Standard

This proposal defines a system which assigns contract accounts to Non-fungible tokens (ERC-721s).

These accounts are referred to as token bound accounts and they allow NFTs to own assets and interact with applications, without requiring changes to existing smart contracts or infrastructure.

For more information, you could reference the original EIP proposed by Jayden Windle, Benny Giang and a few others.

Repository Structure

This Repository contains reference implementation of:

  1. A singleton registry contract
  2. An account contract

The Registry Contract

The registry serves as a single entry point for all token bound account address queries. It has three functions:

  1. create_account - creates the token bound account for an NFT given an implementation_hash, public_key, token_contract, token_id and salt.

  2. get_account - computes the token bound account address for an NFT given an implementation_hash, public_key, token_contract, token_id and salt.

  3. total_deployed_accounts - returns the number of deployed token bound accounts for a particular NFT using the registry.

The Account Contract

The Account Contract provides a minimal reference implementation for a TBA. Thanks to native account abstraction on Starknet, it can be easily tweaked to contain as much use case as needed.

All token bound accounts must at least implement all functions contained within the reference account.

Development Setup

You will need to have Scarb and Starknet Foundry installed on your system. Refer to the documentations below:

To use this repository, first clone it:

git clone [email protected]:Starknet-Africa-Edu/TBA.git
cd TBA

Building contracts

To build the contracts, run the command:

scarb build

Running Tests

To run the tests contained within the tests folder, run the command:

snforge test

For more information on writing and running tests, refer to the Starknet-Foundry documentation

tba's People

Contributors

darlington02 avatar teddynotbear avatar codewhizperer 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.