Code Monkey home page Code Monkey logo

abt's Introduction

Foundry Developed

Account Bound Tokens

ABT or Soul Bound tokens are non-transferrable tokens that - once assigned cannot be transferred to any other accounts. The holder of the token can burn the token. These tokens can be used to represent identity.

Interfaces used:

  1. IERC165
  2. IERC721Metadata
  3. IERC4973

Functions

Constructor

Name Type Description
_name string Name for the token
_symbol string Symbol for the token

Registers the IERC4973, IERC721Metadata interface ID to the ERC165Storage contract and sets the deployer of the contract as the admin.

Name

function name() public view returns(string memory)

Returns the name of the token.

Symbol

function symbol() public view returns(string memory)

Returns the symbol of the token.

TokenId

function tokenId() public view returns(uint256)

Returns the current tokenId that is minted.

Admin

function admin() public view returns(address)

Returns the current admin of the contract.

ChangeAdmin

function changeAdmin(address newAdmin) external onlyAdmin
Name Type Description
newAdmin address New address for the admin

Allows the admin of the contract to change the current admin role.

Mint

function mint(address _to, string memory _uri) external onlyAdmin
Name Type Description
_to address Address to mint the token to
_uri string URI for the token

Allows the admin of the contract to mint new token to the _to address.

Burn

function burn(uint256 _tokenId) external
Name Type Description
_tokenId uint256 Token Id to burn

Allows the admin of the contract or the owner of the token to burn the token.

OwnerOf

function ownerOf(uint256 _tokenId) public view returns (address)
Name Type Description
_tokenId uint256 Token Id

Returns the owner of particular token if it exits.

OwnerOf

function tokenURI(uint256 _tokenId) external view returns (string memory)
Name Type Description
_tokenId uint256 Token Id

Returns the uri of particular token if it exits.

Testing

Run forge tests

forge test

Deployemnt

Run forge scripts

forge script script/SFT.s.sol --rpc-url $RINKEBY_RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv

abt's People

Contributors

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