Are swords and sheild a NFT or Fungible Token

I was going through the openZeppelin document explain ERC1155 standard

They have specified new token which are being minted in the contructor.

constructor() public ERC1155("https://game.example/api/item/{id}.json") {
        _mint(msg.sender, GOLD, 10**18, "");
        _mint(msg.sender, SILVER, 10**27, "");
        _mint(msg.sender, THORS_HAMMER, 1, "");
        _mint(msg.sender, SWORD, 10**9, "");
        _mint(msg.sender, SHIELD, 10**9, "");
    }

They have specified gold and silver as an fungible token and Thors_hammer as an Non-fungible token.

Are Swords and Shield a fungible or a non-fungible token? Is there a way to diffretiate between the fungible and non-fungible token in ERC1155 token standard?

Edit, removed incorrect information.

Although i can't find the information on the EIP-1155 page that specifies the supply :confused:

You can also recognize an non-fungable by requesting the URI metadata using the function uri(_id).
A non-fungable token should use the ERC721 Metadata JSON Schema:

{
	"name": "Asset Name",
	"description": "Lorem ipsum...",
	"image": "https:\/\/s3.amazonaws.com\/your-bucket\/images\/{id}.png",
	"properties": {
		"simple_property": "example value",
		"rich_property": {
			"name": "Name",
			"value": "123",
			"display_value": "123 Example Value",
			"class": "emphasis",
			"css": {
				"color": "#ffffff",
				"font-weight": "bold",
				"text-decoration": "underline"
			}
		},
		"array_property": {
			"name": "Name",
			"value": [1,2,3,4],
			"class": "emphasis"
		}
	}
}

Where as the fungable Token should use:

{
    "title": "Token Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this token represents"
        },
        "decimals": {
            "type": "integer",
            "description": "The number of decimal places that the token amount should display - e.g. 18, means to divide the token amount by 1000000000000000000 to get its user representation."
        },
        "description": {
            "type": "string",
            "description": "Describes the asset to which this token represents"
        },
        "image": {
            "type": "string",
            "description": "A URI pointing to a resource with mime type image/* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
        },
        "properties": {
            "type": "object",
            "description": "Arbitrary properties. Values may be strings, numbers, object or arrays."
        }
    }
}

1 Like

Someone at discord community mentioned that, constructors third value is supply,
if that is the case, then i need a way to get supply of token by its ID.

Yeah apparent the ERC-1155 didn't specify a function for total supply.
OpenZeppelin does have a contract with an extension for it but it's not an part of the official specification and therefor not supported by all ERC-1155 implementations.

however openzeppelin states that a supply of 1 doesn't mean automatically its an NFT.