Skip to content

taurushq-io/TERC-721

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TERC-20

This project contains two basic ERC-721 tokens:

  • TERC721Standalone for an immutable deployment, without proxy
  • TERC721Upgradeable for an upgradeable deployment, with a compatible proxy (Transparent or Beacon)

Common characteristics

These ERC-721 tokens have the following characteristics:

Mint

  • A mint function only accessible with the MINTER role

  • A mint batch function only accessible with the MINTER role

Burn

  • A burn function only accessible with the BURNER role
  • A burn in batch function only accessible with the BURNER role

ERC721

  • At deployment, the issuer can set the name, symbol and the baseURI

  • Once deployed, it is no longer possible to modify the name and symbol except via an upgrade in the case of the proxy. A setter function is available to set the baseURI again.

Access Control

There are three roles: MINTER_ROLE, BURNER_ROLE and DEFAULT_ADMIN_ROLE

The DEFAULT_ADMIN_ROLE has all the roles by default

Schema

TERC721Standalone

Inheritance

surya_inheritance_TERC721Standalone.sol

Graph

surya_graph_TERC721Standalone.sol

TERC721 Upgradeable

Inheritance

surya_inheritance_TERC721Upgradeable.sol

Graph

surya_graph_TERC721Upgradeable.sol

Surya Description Report

Contracts Description Table

TERC721Standalone

Contract Type Bases
β”” Function Name Visibility Mutability Modifiers
TERC721Standalone Implementation TERC721Share, AccessControl, ERC721
β”” Public ❗️ πŸ›‘ ERC721
β”” mint Public ❗️ πŸ›‘ onlyRole
β”” mintBatch Public ❗️ πŸ›‘ onlyRole
β”” mintBatch Public ❗️ πŸ›‘ onlyRole
β”” burn Public ❗️ πŸ›‘ onlyRole
β”” burnBatch Public ❗️ πŸ›‘ onlyRole
β”” setBaseURI Public ❗️ πŸ›‘ onlyRole
β”” baseURI Public ❗️ NO❗️
β”” _setBaseURI Internal πŸ”’ πŸ›‘
β”” _baseURI Internal πŸ”’
β”” supportsInterface Public ❗️ NO❗️
β”” hasRole Public ❗️ NO❗️

TERC721Upgradeable

Contract Type Bases
β”” Function Name Visibility Mutability Modifiers
TERC721Upgradeable Implementation Initializable, ERC721Upgradeable, AccessControlUpgradeable, TERC721Share
β”” Public ❗️ πŸ›‘ NO❗️
β”” initialize Public ❗️ πŸ›‘ initializer
β”” __TERC721Upgradeable_init_unchained Internal πŸ”’ πŸ›‘ onlyInitializing
β”” mint Public ❗️ πŸ›‘ onlyRole
β”” mintBatch Public ❗️ πŸ›‘ onlyRole
β”” mintBatch Public ❗️ πŸ›‘ onlyRole
β”” burn Public ❗️ πŸ›‘ onlyRole
β”” burnBatch Public ❗️ πŸ›‘ onlyRole
β”” setBaseURI Public ❗️ πŸ›‘ onlyRole
β”” baseURI Public ❗️ NO❗️
β”” _setBaseURI Internal πŸ”’ πŸ›‘
β”” _baseURI Internal πŸ”’
β”” hasRole Public ❗️ NO❗️
β”” supportsInterface Public ❗️ NO❗️
β”” _getTERC721UpgradeableStorage Private πŸ”

Legend

Symbol Meaning
πŸ›‘ Function can modify state
πŸ’΅ Function is payable

Dependencies

The toolchain includes the following components, where the versions are the latest ones that we tested:

  • Foundry
  • Solidity 0.8.28 (via solc-js)
  • OpenZeppelin Contracts (submodule) v5.2.0
  • OpenZeppelin Contracts upgradeable (submodule) v5.2.0

Audit

See slither

Tools

Prettier

npx prettier --write --plugin=prettier-plugin-solidity 'src/**/*.sol'
npx prettier --write --plugin=prettier-plugin-solidity 'test/**/*.sol'

Slither

slither .  --checklist --filter-paths "openzeppelin-contracts|openzeppelin-contracts-upgradeable|test|forge-std" > slither-report.md

Surya

See ./doc/script

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Usage

Explain how it works.

Toolchain installation

The contracts are developed and tested with Foundry, a smart contract development toolchain.

To install the Foundry suite, please refer to the official instructions in the Foundry book.

Initialization

You must first initialize the submodules, with

forge install

See also the command's documentation.

Later you can update all the submodules with:

forge update

See also the command's documentation.

Compilation

The official documentation is available in the Foundry website

 forge build

Testing

You can run the tests with

forge test

To run a specific test, use

forge test --match-contract <contract name> --match-test <function name>

See also the test framework's official documentation, and that of the test commands.

Coverage

  • Perform a code coverage
forge coverage
  • Generate LCOV report
forge coverage --report lcov
  • Generate index.html
forge coverage --ffi --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage

See Solidity Coverage in VS Code with Foundry & Foundry forge coverage

Documentation

https://book.getfoundry.sh/

Intellectual property

The original code is copyright (c) Taurus 2025, and is released under MIT license.