# Review of Blockchain Tokens Creation and Valuation
## 3 Blockchain Tokens Development
### Creation
#### 3.3.3 ERC-1155 Multi Token  
ERC1155 appeared more recently, and it represents a multi-token standard that can be used to create FTs/NFTs through a single smart contract [103]. This flexibility enables more efficient management of complex token systems, where a single contract can govern multiple tokens, each having different characteristics. Another key innovation of this standard is that it allows for batch transfers, which was a major downfall of the ERC721 standard since the lack of this functionality implies higher gas costs on the blockchain. Supporting the idea of semi-fungibility, this token standard has been developed with gaming and asset management as core usages. Semi-fungibility means that tokens can share properties while also maintaining individual characteristics. Ultimately, this standard came as the industry needed improvements over the last standards and it efficiently addresses the limitations of previous tokens.  
Algorithm 5 shows a token implementation using the ERC1155 standard. One needs to import the smart contract that provides the functional interface of ERC115 and must specify a token identification number for each asset represented. For example, lines 5-9 state that there are five assets that this smart contract will model with its supply, specified in the constructor (see lines 11-15). These tokens can be fungible or non-fungible and are initially minted in the wallet of the owner of the smart contract.  
```
1://SPDX-License-Identifier:MIT
2:pragma solidity '0.8.20;
3:import {ERC1155} from \"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\";
4:contract DemoTokenERC1155 is ERC1155 {
5:uint256 public constant GOLD = 0;
6:uint256 public constant SILVER = 1;
7:uint256 public constant THORS_HAMMER = 2;
8:uint256 public constant SWORD = 3;
9:uint256 public constant SHIELD = 4;
10:constructor() ERC1155(\"DemoERC1155\") {
11:_mint(msg.sender, GOLD, 10**18, \"\");
12:_mint(msg.sender, SILVER, 10**27, \"\");
13:_mint(msg.sender, THORS_HAMMER, 1, \"\");
14:_mint(msg.sender, SWORD, 10**9, \"\");
15:_mint(msg.sender, SHIELD, 10**9, \"\");
16: }
17: }
```  
**Algorithm 6**Smart Contract 6--IERC1155.  
Algorithm 6 shows the functions defined in the ERC1155 standard interface. The methods are similar to those provided by the other standards, albeit slightly optimized in terms of gas consumption. The innovation over the previous standards is the usage of multiple tokens with values higher than 1 in all methods in the interface and the addition of methods that allow us to transfer and get the balance of multiple tokens at once (see lines 5 and 9).  
```
1:pragma solidity '0.8.20;
2:
3:Interface IERC1155 {
4:function balanceOf(address owner, uint256 id) external view returns (uint256 balance);
5:function balanceOfBatch(addres[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);
6:function safeTransferFrom(address from, address to, uint256 id, uint256 value) external;
7:function isApprovedForAll(address account, address operator) external view returns (bool);
8:function setApprovalForAll(address operator, bool approved) external;
9:function safeBatchTransferFrom(address from, address, to, uint256[] calldata ids, uint256[] calldata values) external;
10: }
```  
**Algorithm 7**Smart Contract 6--IERC1155.