Standard templates.
Three contract templates cover most token and NFT launches. Each one is built on a widely used standard, and you can read the full source below. Deploying opens when Launch goes live.
Fungible token
A standard token with a name, a symbol and a supply. Use it for community coins, rewards, in-app currencies and utility tokens.
You set
- Name and symbol
- Initial supply
- Mintable or fixed supply
Built in
- Transfers and approvals
- Burning
- Owner controls you can hand off
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract ClassicToken is ERC20, ERC20Burnable, Ownable {
constructor(
string memory name_,
string memory symbol_,
uint256 supply
) ERC20(name_, symbol_) Ownable(msg.sender) {
_mint(msg.sender, supply * 10 ** decimals());
}
// Removed from fixed-supply launches
function mint(address to, uint256 amount) external onlyOwner {
_mint(to, amount);
}
}
NFT collection
One-of-one items that each have their own ID and metadata. Use it for art, collectibles, membership cards and tickets.
You set
- Collection name and symbol
- Maximum number of items
- Metadata location
- Royalty receiver and rate
Built in
- Safe minting
- Hard supply cap
- Royalty info (ERC-2981)
- Owner controls you can hand off
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract ClassicCollection is ERC721, ERC2981, Ownable {
uint256 public immutable maxSupply;
uint256 public totalMinted;
string private baseURI_;
constructor(
string memory name_,
string memory symbol_,
uint256 max,
string memory uri_,
address royaltyTo,
uint96 royaltyBps
) ERC721(name_, symbol_) Ownable(msg.sender) {
maxSupply = max;
baseURI_ = uri_;
_setDefaultRoyalty(royaltyTo, royaltyBps);
}
function mint(address to) external onlyOwner {
require(totalMinted < maxSupply, "Sold out");
_safeMint(to, ++totalMinted);
}
function _baseURI() internal view override returns (string memory) {
return baseURI_;
}
function supportsInterface(bytes4 id)
public view override(ERC721, ERC2981) returns (bool)
{
return super.supportsInterface(id);
}
}
Multi-token contract
Many token types in one contract, fungible or not. Use it for game items, passes, and editions where each piece has a quantity.
You set
- Metadata location
- Token IDs and quantities
- Royalty receiver and rate
Built in
- Single and batch minting
- Batch transfers
- Royalty info (ERC-2981)
- Owner controls you can hand off
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract ClassicEditions is ERC1155, ERC2981, Ownable {
constructor(string memory uri_, address royaltyTo, uint96 royaltyBps)
ERC1155(uri_) Ownable(msg.sender)
{
_setDefaultRoyalty(royaltyTo, royaltyBps);
}
function mint(address to, uint256 id, uint256 amount) external onlyOwner {
_mint(to, id, amount, "");
}
function mintBatch(
address to,
uint256[] calldata ids,
uint256[] calldata amounts
) external onlyOwner {
_mintBatch(to, ids, amounts, "");
}
function supportsInterface(bytes4 id)
public view override(ERC1155, ERC2981) returns (bool)
{
return super.supportsInterface(id);
}
}
How we will manage the library.
Templates are the product, so we plan to treat them like one.
Open source
Every template's source is readable before you deploy it, and again on the explorer after.
Versioned
Changes ship as new versions. A contract you deployed never changes underneath you.
Standards first
We build on established, widely used standards and extend them only when the network needs it.