Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC-4944, a proposal for managing exactly one NFT per smart contract.
This explanation translates, summarizes, and expands on the following specification.
ERC-4944 was in Draft status as of September 14, 2023.
Overview
ERC-721 is a standard for creating non-fungible tokens (NFTs), which represent unique digital assets on Ethereum. The proposed standard associates exactly one NFT with each smart contract address.
An ERC-721 contract implementing the proposed restriction has the following characteristics.
- Total supply of one
- Only one NFT can be minted by the contract.
- Unlike fungible tokens such as ERC-20, each ERC-721 NFT is individually identifiable. ERC-4944 further restricts each contract to a single NFT, whereas ordinary ERC-721 contracts may issue multiple NFTs.
- Standard functionality
- ERC-721 contracts provide functions for transferring NFTs between owners, checking token existence (for example, by querying ownership), and retrieving the current owner of a particular NFT.
- These standard functions facilitate NFT issuance, trading, and management.
Motivation
The proposed change restricts an ERC-721 contract, which normally may issue multiple distinct NFTs, to issuing only one NFT.
This gives each NFT its own identity and contract address. Rather than requiring the combination of a token ID and a contract address, the contract address can uniquely identify the NFT itself.
The proposal also describes how this structure can give an NFT composable-token capabilities without requiring a separate standard such as ERC-998.
The central change is that a contract can no longer issue multiple distinct tokens: each contract is limited to issuing a single NFT. Consequently, each NFT has a dedicated contract address.
The NFT's contract can hold other ERC-20 tokens from the time of issuance. Those tokens could be used for operations such as self-preservation or trading with other NFTs.
This suggests a possible use for NFTs as autonomous agents capable of managing their own assets and making decisions. The first use case proposed is preserving the NFT's value by giving it a budget of its own in ERC-20 tokens, enabling automated self-preservation when suitable logic is implemented.
Specification
Constructor
The contract constructor mints the NFT at deployment.
When the contract is created, exactly one NFT is automatically minted, with ownership assigned to the contract owner. The contract issues the token at deployment and prevents further issuance.
mint Function
After the NFT has been minted, the mint function can no longer be executed. This restricts the contract to one token and prevents additional issuance.
tokenTransfer Function
This function is called by the contract owner to transfer ERC-20 tokens held by the contract to another account.
It allows the owner to use the ERC-20 tokens received by the contract, managing those holdings and performing transfers when needed.
Additional Considerations
The proposed standard maintains compatibility with ERC-721 contracts.
Backward Compatibility
No specific backward-compatibility issues are identified.
Reference Implementation
Add a variable named _minted to the contract. It is used to determine whether a token has already been minted.
bool private _minted;In the constructor, mint the first token and set _minted to true.
constructor(string memory name, string memory symbol, string memory base_uri) ERC721(name, symbol) {
baseUri = base_uri;
mint(msg.sender,0);
_minted = true;
}Add functions for interacting with assets held by the NFT contract, such as ERC-20 tokens.
modifier onlyOwner() {
require(balanceOf(msg.sender) > 0, "Caller is not the owner of the NFT");
_;
}
function transferTokens(IERC20 token, address recipient, uint256 amount) public virtual onlyOwner {
token.transfer(recipient, amount);
}
function balanceTokens(IERC20 token) public view virtual returns (uint256) {
return token.balanceOf(address(this));
}transferTokens
This function accepts an ERC-20 token contract address and invokes the target contract's transfer function to send amount tokens to the address specified by recipient.
balanceTokens
This function accepts an ERC-20 token contract address and calls the target contract's balanceOf function to determine how many tokens the NFT contract holds.
Security Considerations
The original article identifies no specific security considerations. This does not establish that every implementation is secure.
Citation
Víctor Muñoz (@victormunoz), Josep Lluis de la Rosa (@peplluis7), Andres El-Fakdi (@Bluezfish), "ERC-4944: Contract with Exactly One Non-fungible Token [DRAFT]," Ethereum Improvement Proposals, no. 4944, March 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-4944.
Conclusion
ERC-4944 proposes a mechanism for managing exactly one NFT per smart contract.
If you have questions, feel free to contact me on Twitter.
I also publish articles on the following platforms.


