Although this contract has been audited, it was developed in 2023 and its codebase may no longer be up to date.
ERC-1155 is a standard to represent multiple token types on Ethereum and EVM blockchain. A single deployed contract may include any combination of fungible tokens, non-fungible tokens or other configurations (e.g. semi-fungible tokens).
TERC-1155A aims to provide an implementation for this standard with the following functionalities:
- Proxy support (upgradeable)
- MetaTx/Gasless support with ERC-2771
- Mint functionalities:
mint
&mintBatch
- URI management:
setDefaultURI
: set the default URIsetTokenURI
: set the URI for a specific tokensetBaseURI
: set the base URI
- RBAC access control, as well as ownership with ERC-173
TERC-1155A uses OpenZeppelin v4 as the main library, more information here: docs.openzeppelin.com - erc1155
-
truffle-config.js
- Solidity v0.8.17
- EVM version: London
- Optimizer: true, 200 runs
-
Submodule
- OpenZeppelin Contracts Upgradeable: v4.9.1
- Clone the repository
Clone the git repository, with the option --recurse-submodules
to fetch the submodules:
git clone git@github.com:CMTA/CMTAT.git --recurse-submodules
- Install node modules
npm install
- Run test
npx truffle test
Before making a release, you have to update the current contract version to this new version
string public constant VERSION = "NEW_VERSION";
The TERC1155 is configured to be deployed with a transparent proxy contract. Furthermore, using a proxy allows to upgrade the contract using a standard proxy upgrade pattern.
Please see the OpenZeppelin upgradeable contracts documentation for more information about the proxy requirements applied to the contract.
Please see the OpenZeppelin Upgrades plugins for more information about upgrades plugins in general.
Note that deployment with a proxy is mandatory
The CMTAT supports client-side gasless transactions using the ERC-2771. The contract uses the OpenZeppelin contract ERC2771Context
, which allows a contract to get the original client with _msgSender()
instead of the fee payer given by msg.sender
.
At deployment, the parameter forwarderIrrevocable
inside the TERC1155 contract constructor has to be set with the defined address of the forwarder. Please note that the forwarder can not be changed after deployment.
References:
- OpenZeppelin Meta Transactions
- OpenGSN has deployed several forwarders, see their documentation to see some examples.
Initially, OpenSea didn't allow a NFT collection with a burn mechanism.
Therefore, this implementation does not implement any burn mechanism.
See OpenSea Guideline
We don’t allow NFTs that are guaranteed to be burned or burned at the full discretion of the creator. There must be an element of randomization, chance, or an event that triggers the burn
From OpenSea support - How does OpenSea handle NFTs with a burn mechanism? & OpenSea - Community Standards.
Initially, OpenSea used ownership (ERC-173) to allow an address to modify the data related to the collection on their marketplace. This contract therefore implements an ownership system, alongside an RBAC access control system.
We don't know if ownership is still used by OpenSea or not.
See also docs.opensea.io - Contract-level metadata
Please see SECURITY.md.
The contracts have been audited by ABDKConsulting, a globally recognized firm specialized in smart contracts security.
Final report is available here: ABDK_Taurus_TERC1155A_v_1_0.pdf
The original code is copyright (c) Taurus 2025, and is released under MIT license.