Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Conversation

@kaihirota
Copy link

@kaihirota kaihirota commented Oct 17, 2024

The sample game in this branch uses three collections / contracts:

  1. ERC-721 Immutable Runner Fox collection: Fox NFT minted to players when they log in. Assuming this has no intrinsic value, this collection can be moved to ERC-1155.
  2. ERC-20 Immutable Runner Token contract: Coins collected in-game are minted to the player. When a player has 3 or more coins, they can invoke craftSkin() contract function, which burns 3 of the caller's coins, and then mint a new skin in return from the collection below.
  3. ERC-721 Immutable Runner Fox Skin: The above ERC-20 contract is the minterRole of this contract. When craftSkin() is called on the ERC-20 contract above, that contract will call the mint function on this contract.

In this branch, 1 and 2 above have been replaced by a single ERC-1155 contract. TokenID=1 in this collection is equivalent to "ERC-721 Immutable Runner Fox collection", and tokenID=2 is equivalent to "ERC-20 Immutable Runner Token". The RunnerToken1155 Solidity contract has two constants (FOXTOKENID, COINTOKENID) which are used in the mintNFT and mintCoins functions.

@kaihirota kaihirota self-assigned this Oct 17, 2024
@kaihirota kaihirota force-pushed the CORE-2329-zkevm-migration branch from 8ed42d9 to 4aba971 Compare October 20, 2024 23:14
@kaihirota kaihirota force-pushed the CORE-2329-zkevm-migration-ERC-1155 branch from 7980fa8 to 9bf944c Compare October 20, 2024 23:21
@kaihirota kaihirota changed the base branch from CORE-2329-zkevm-migration to complete October 20, 2024 23:24
@kaihirota kaihirota changed the base branch from complete to CORE-2329-zkevm-migration October 20, 2024 23:24
@kaihirota kaihirota changed the base branch from CORE-2329-zkevm-migration to complete October 21, 2024 00:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant