Skip to main content

Deploy an ERC-1155 Token

OpenZeppelin provides secure, community-vetted smart contract templates that follow best practices for ERC-1155 multi-token contracts. ERC-1155 enables you to deploy multiple fungible and non-fungible tokens from a single contract — ideal for gaming, collectibles, and multi-asset systems.

Step 0: Setup Foundry

If your Foundry project isn’t set up yet, please go to the Foundry setup section before proceeding.

Step 1: Create the ERC-1155 Contract

Create a contract script in src/MyERC721.sol. Run:
Add the contract code:
This contract:
  • Inherits OpenZeppelin’s ERC1155
  • Supports multiple token types
  • Sets a metadata URI using {id} placeholders
  • Implements single & batch minting
  • Mints initial supply on deployment
The URI string uses {id} as a placeholder that will be replaced automatically by compatible metadata servers.

Step 2: Compile the Contract

Step 3: Prepare Signer for Deployment

Create a Foundry keystore:
Be sure to store your keystore password securely — it cannot be recovered.
Retrieve your wallet address:
Visit the sFUEL Station, toggle testnet, and fill up your SKALE deployer wallet.
Always toggle testnet first when using testnet chains!

Step 4: Deploy the Contract

The --legacy flag is required for SKALE deployments.
Example output:

Step 5: Verify Your Smart Contract