AlphaWallet / AlphaWallet/alpha-wallet-android
ERC1155 Info
- 主要言語
- Java
- スター
- 646
- フォーク
- 579
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
@hboon Some notes on ERC1155 specifically for tracking balances and URI I made:
Check the Ethereum standard [https://eips.ethereum.org/EIPS/eip-1155](https://eips.ethereum.org/EIPS/eip-1155)
Token name and symbol are usually the same as ERC20/ERC721:
```
string public name;
string public symbol;
```
However the ERC1155 spec in openzeppelin doesn't indicate these are required. Name is also supplied in the contractURI:
Here is an example of an overall contract URI metadata, however this route may or may not be present.
```
function contractURI() returns(string metaData)
```
-->
```
{
"id": "0x3ec057be60db3a2d416e14a6e3ab7f37ffccd7b8",
"name": "GenSys.X",
"image": "ipfs://ipfs/QmdAyBpWz1iYdw7o8LYfryogBWus2jEribC8jva8EcNoKP",
"external_link": "https://app.rarible.com/collection/0x3ec057be60db3a2d416e14a6e3ab7f37ffccd7b8"
}
```
From the Ethereum standard:
```
{
"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."
}
}
}
```
### Note the ```decimals``` field above!
Note that ```image``` is the equivalent of the token image in ERC721, so in the example of a print run of 50, the ```image``` is the actual print.
Here is an example of specific tokenUri
```
function uri(1) returns(string token Description Metadata for token index 1)
```
-->
```
{
"name": "Queen iShoTas1.37",
"description": "Queen iShoTas.1.37 was put into power during the Great Oracle War of 2023 by the powerful mystic, GoLd.eFi, who is her half sister. As queen of the New World, iShoTas fell in love with the General of the Imperials Army, angering GoLd.eFi, who wanted her to remain loyal to Cohort, whose physicists had first communicated with the Mystik race. The Queen turned her back on her half sister GoLd.eFi choosing love over blood and vowing to destroy Cohorts and her half sister for casting her out and to take control of the Oracle from “The Entity”.",
"image": "ipfs://ipfs/QmVG9wXaEsQCEdBb6oweW7mSUYu3HtxmpPKtaTpkiZyaTs/image.png",
"external_url": "https://app.rarible.com/token/0x3ec057be60db3a2d416e14a6e3ab7f37ffccd7b8:1",
"attributes": [
{
"key": "Artist",
"trait_type": "Artist",
"value": "AnRKey X"
},
{
"key": "Rarity",
"trait_type": "Rarity",
"value": "1 of 33"
},
{
"key": "Set",
"trait_type": "Set",
"value": "GenSys.X"
},
{
"key": "Power",
"trait_type": "Power",
"value": "300,000"
},
{
"key": "6DoS",
"trait_type": "6DoS",
"value": "1º"
},
{
"key": "Year",
"trait_type": "Year",
"value": "2020"
}
]
}
```
Balance events:
```
event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value);
```
```_operator```: the sender of the transaction
```_from```, ```_to``` : as expected
```_id```: token Identifier
```_value```: as expected
```
event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values);
```
As above, but note the array fields for ```_ids``` and ```_values```
```
event URI(string _value, uint256 indexed _id);
```
Is emitted when the URI for a token changes. TODO: Find out if the unindexed string gives the actual string or is the hash value. If it's the actual string then it can be used to re-load the metadata.
### Interface spec
```
/*
bytes4(keccak256("safeTransferFrom(address,address,uint256,uint256,bytes)")) ^
bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)")) ^
bytes4(keccak256("balanceOf(address,uint256)")) ^
bytes4(keccak256("balanceOfBatch(address[],uint256[])")) ^
bytes4(keccak256("setApprovalForAll(address,bool)")) ^
bytes4(keccak256("isApprovedForAll(address,address)"));
*/
bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26;
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。