Coder Social home page Coder Social logo

alblancc / erc721soulbound Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kassandraoftroy/erc721soulbound

0.0 0.0 0.0 165 KB

Soulbound extension to the ERC721 standard for non-fungible assets 'bound' to a parent ERC721

Shell 0.08% TypeScript 34.89% Solidity 65.03%

erc721soulbound's Introduction

ERC721Soulbound

Here is a simple ERC721 extension for nfts that want to forever be tied to a base nft collection. For example, maybe you want to give non-fungible rights or some auxiliary NFT (e.g. an in-game item) to a specific CryptoPunk or ENS domain, in such a way that the owner of said CryptoPunk or ENS name will always be able to assert/take ownership of the asset.

Thus, soulbound. Inspired by Vitalik's blogpost

The IERC721Soulbound interface extends IERC721 with a few new methods:

    function soul() external view returns (address);

    function boundTo(uint256 tokenId) external view returns (uint256);
 
    function soulOwner(uint256 tokenId) external view returns (address);

    function reclaim(address claimant, uint256 tokenId) external;

    function canReclaim(address claimant, uint256 tokenId) external view returns (bool);

soul() Address of the 'soul' ERC721 collection.

boundTo(uint256 tokenId) The tokenId of the soul collection that this token is bound to.

soulOwner(uint256 tokenId) The rightful owner of the token which may differ from ownerOf(tokenId). The soulOwner can reclaim the token if they are not currently the holder.

reclaim(address claimant, uint256 tokenId) Reclaim tokenId to the soulOwner.

canReclaim(address claimant, uint256 tokenId) Check if an address can reclaim a token.

test

Set up .env file by copying the example and adding your alchemy key:

$ cp .env.example .env

Install dependencies:

yarn

Compile:

yarn compile

Test:

yarn test

erc721soulbound's People

Contributors

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