From 792140d68c6686f16ae467d642156ed0bf2fab41 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Fri, 28 Jun 2024 23:01:24 +0700 Subject: [PATCH 1/7] add spec for asset module --- valset.json | 457 ++++++++++++++++++++ x/asset/spec/01_concepts.md | 26 +- x/asset/spec/02_state.md | 50 +-- x/asset/spec/03_params.md | 12 +- x/asset/spec/04_messages.md | 90 ++++ x/asset/spec/05_gov.md | 5 + x/asset/spec/06_logic.md | 56 +++ x/asset/spec/{04_events.md => 07_events.md} | 2 +- x/asset/spec/{05_client.md => 08_client.md} | 2 +- 9 files changed, 644 insertions(+), 56 deletions(-) create mode 100644 valset.json create mode 100644 x/asset/spec/04_messages.md create mode 100644 x/asset/spec/05_gov.md create mode 100644 x/asset/spec/06_logic.md rename x/asset/spec/{04_events.md => 07_events.md} (99%) rename x/asset/spec/{05_client.md => 08_client.md} (97%) diff --git a/valset.json b/valset.json new file mode 100644 index 00000000..af45b3bc --- /dev/null +++ b/valset.json @@ -0,0 +1,457 @@ +{ + "block_height": "7082809", + "validators": [ + { + "address": "7B7D688CDA3712BEA7681977629A348619FFF694", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "3+rOKbRkAs3un1h/7l7tnktZ4hlQQNrMphfp34jART8=" + }, + "voting_power": "8624093", + "proposer_priority": "21972780" + }, + { + "address": "ABCD244949D75638B1FF65BD3720AFAFDB4ABB83", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bVOEXOpPKshrZITF6iaEEMzglc65h7mUkdx3DeEIvFE=" + }, + "voting_power": "7032490", + "proposer_priority": "-20752710" + }, + { + "address": "7E6CBCDACECA7F65A8D2EEFE2F3704A4B81FBE65", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "d8RVo9JyZ3Ojhhw66Xs00Ra8oImgYoJq3rZlU17F33s=" + }, + "voting_power": "3933438", + "proposer_priority": "35223909" + }, + { + "address": "2C57CB1A9B64A3438B3095C634FE904177DEF7DD", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "f5F3voOiLw+eMmpGVV1ySoYaOqIC6715l3zjgw7i0y4=" + }, + "voting_power": "3639952", + "proposer_priority": "35184070" + }, + { + "address": "EFEC8316F4781997D54DBE651AF60BD484C1EBE6", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bGYjF1YUqqwvKCq1QPiNZ/5s08e/wFYAC4F5AtJBRhQ=" + }, + "voting_power": "3578132", + "proposer_priority": "-6003672" + }, + { + "address": "01B9A503BD87498A6D622DCB50DE9A1D3D988A18", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "A+emCaNFwL2V4QK9aupRLHF7Mr4qDnLbTvE6DMMXbHw=" + }, + "voting_power": "3493948", + "proposer_priority": "-17863571" + }, + { + "address": "6C5A0291653B44F42B4F737218A000537985C948", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "5aggyt1XTSCag/cs1H+1yiupXNuV3uL4KUS/CnsdOfI=" + }, + "voting_power": "3033925", + "proposer_priority": "-22336962" + }, + { + "address": "6BB5BBE12CB4241A1BF174BF91AC4BDC3C83E203", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Irtgsz7298m9yGFDbq/h3WykZBcYtaYA3MvgZ76ORHU=" + }, + "voting_power": "3026166", + "proposer_priority": "27393540" + }, + { + "address": "524FC3883F4E35C4DBC06B98B58504BAEBB8D3CC", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "xeWcP7eVe64045xspOTiDiuXYe9L7IpKfu+zezZs+/g=" + }, + "voting_power": "2533176", + "proposer_priority": "43494873" + }, + { + "address": "AA56D591D6CBBEACFEBE0C49B03837036549C2FA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "gQgRDkm9U8AnCFD0zyuL9RI6jzhJgucWN+R5TCGomBU=" + }, + "voting_power": "2526704", + "proposer_priority": "30510518" + }, + { + "address": "D21D299C098941E8D86212AE8FA36A1409330E72", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "UNolLiLSGbuptKgJ+09xeN3D0r7kwOoXA3q1+E/z15w=" + }, + "voting_power": "2502001", + "proposer_priority": "-21914475" + }, + { + "address": "55D30176F25B9FB86E1DD4FD6EB0DA586E494F5A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "4X3Wlxf8rxTNzikEDv8urMY9FuXP1wS5cw7h8tePoN0=" + }, + "voting_power": "2500067", + "proposer_priority": "-19965866" + }, + { + "address": "8472C36B167D47D42C95D2ECCA4AB219CD159A0D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "lJwnj6YgkHuXEpR8ryREKwFglOMUtLIe5Fahg4ELO7k=" + }, + "voting_power": "2500060", + "proposer_priority": "-20981407" + }, + { + "address": "39E8C767948D39CF9800248DD8AADF797DE1CC1C", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "JTkIuPJnRW8W22GBPBZnT4Ni8pvm9pfxegshwR+0ro0=" + }, + "voting_power": "2500001", + "proposer_priority": "33107612" + }, + { + "address": "EC00355682D02056A6B3189832651379DE9F99F0", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "Y9zU204rkpjsaDFYGHd4008iCOAklgMrqdP34hMWVv8=" + }, + "voting_power": "2116664", + "proposer_priority": "-20780344" + }, + { + "address": "F7A919546E5A2F5F7B785AECFB2B0D098A9E6221", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "O1WTJzYSQB4isaJVrF0aWegX9TrBPtokU/meF1gDJzM=" + }, + "voting_power": "1730349", + "proposer_priority": "-19695476" + }, + { + "address": "3590F1D6B8F2C48E15F5B4A3BF37B43ADC5B2990", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "t8TKgVCg8UMabwX5VOOfBIKdTHZxuFfSFSECNrTl6rw=" + }, + "voting_power": "1587031", + "proposer_priority": "21652269" + }, + { + "address": "72322D44C6DB59AD2C82142E2A17C0BD9A5D426D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "LDusfYNn2nada9h67Rv7KwGji9q8agd0jsrApTcCids=" + }, + "voting_power": "1544970", + "proposer_priority": "-11224883" + }, + { + "address": "1741FEB19C0C65E5DE890EE543D66A972A624C10", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "PERIgcgi35gI/zw9rxJ4U1Uyg+T7sPJMILpc8nIu7Tw=" + }, + "voting_power": "1242708", + "proposer_priority": "2690332" + }, + { + "address": "1F9E1FF18ADB9B9B454DF7FAED9850F98AB44EAB", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "XIzx58CGCPQ9Jag9H7QiE1YOY+Bj1osEBnWv83EGjpc=" + }, + "voting_power": "1216273", + "proposer_priority": "20131417" + }, + { + "address": "8D701B6AB3D2F4D1E603FC1740508A4ECA7021C3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ncZDvCEIc+jI2St4rSU2ppVgvaZIj/mizmrx4V1cV9Y=" + }, + "voting_power": "986805", + "proposer_priority": "29169582" + }, + { + "address": "6F69B974E029183B443DFF2E58D6DFD13B5FD3CA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "D1Op6cPC/O0yt93nXrO7KfHn4OUFe4pr94fpXcUOisk=" + }, + "voting_power": "756688", + "proposer_priority": "1625130" + }, + { + "address": "7C96FB5676178BDB5BD6081AB929E13D74048D83", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "I3I31RsIoAQtpMEbw6roGwlNHjbmh10//OMFiWWzxiA=" + }, + "voting_power": "672118", + "proposer_priority": "-2174960" + }, + { + "address": "582724FF4760B2BBBDD30D3B90BB82A70BADCF9D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "EC8wl+5/fI36QxlCM57zXBinioQvbuou8ZO4FWuRxDI=" + }, + "voting_power": "456859", + "proposer_priority": "-16993680" + }, + { + "address": "468993C9D53B06A80774466985D21C6F2B5114C4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "rd3S6cUH/5qgzZXniYiEUZL0N624oUAOsp1qV7HpQ2s=" + }, + "voting_power": "441883", + "proposer_priority": "3896883" + }, + { + "address": "5341E30A37597B82EBEDD831A0090A65B8562838", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "WpHbPLgBK0MNUfHrrsvabftyuD5SyVomD9G7N5DMufU=" + }, + "voting_power": "351391", + "proposer_priority": "25157045" + }, + { + "address": "F3FAC83AD491706DC9EF4FD3CF06207C1D6AF056", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "aDvR2lr+JJqOZx6gDNeGBswx2G+YBCd5xOqUHs3vubc=" + }, + "voting_power": "338209", + "proposer_priority": "16192173" + }, + { + "address": "03BB90DD02D1BA931248D52D12E02C1312C7A2ED", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "1G/t16KbLUrtR+Cd9siuj5nbZE/GRGjTHqqWpB7dwro=" + }, + "voting_power": "283392", + "proposer_priority": "-12687545" + }, + { + "address": "15876D87172414B9F0814FED95B0CCE04291DB7A", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "jVKhS8PeIlzCEnBy87YrGJIYmXDin522tHvVygRzJ+c=" + }, + "voting_power": "204447", + "proposer_priority": "-5734785" + }, + { + "address": "E069465373B078CEBE45675F1E97BE2FD7266E7D", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ezxmMWqrOO/O0VnJ2MKbcM7ovn4vdKrYpwtC8Ds3njg=" + }, + "voting_power": "177086", + "proposer_priority": "-7560778" + }, + { + "address": "C4428823B79C3FCC2B5EC7682A0E01400FBD7342", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "IrZOKvpsrn24MeaSo70KGfCXl1q+T8xiYdIjWONu154=" + }, + "voting_power": "166919", + "proposer_priority": "14763670" + }, + { + "address": "666E20CA1CF9F160174C3F8D32C0FB0D3ED8ADE3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "O7VSwPA/bK84G8vBHBYpodLGxtIDiBdCMSBfy8XoNt0=" + }, + "voting_power": "166102", + "proposer_priority": "-24579426" + }, + { + "address": "77FF06366686F628EE0B7CF50A63073B8AB49D4E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "h58n2zQK+RBIpQKO6vZi/lv9RFQvE6PlyE5MD6n4t6k=" + }, + "voting_power": "165961", + "proposer_priority": "-27323887" + }, + { + "address": "0F87058BA44016C260464E21A09098DE06D23539", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "/6OejaFvubGh/5DH4zHhgiUMAwyk6ZWHGLNKSBcvhUY=" + }, + "voting_power": "155084", + "proposer_priority": "11742085" + }, + { + "address": "83F569011FB35484BA770EC243E6FCAA08F684AC", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "cjQ7s2EBeRR3gbEJa51qDXQueJ7AMQMX1ylL8fRMB1Y=" + }, + "voting_power": "134814", + "proposer_priority": "1319594" + }, + { + "address": "0B0782CEEF41C1B64C9584749056EB040B4772FA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "bULCB2MAJtU+yWUhqcP7T+tpzXrXyLtUz4b7rBw8WII=" + }, + "voting_power": "126287", + "proposer_priority": "-19166274" + }, + { + "address": "825C49D54AFB814D2173DD6E506A22105A52EA03", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ftMsum17nvAMrruBS/TO5P1i/w1IY2HutKaB16RThEg=" + }, + "voting_power": "122756", + "proposer_priority": "20803606" + }, + { + "address": "C94E04DFA21278CD420E92EB126867AC1955D0CA", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "r/0QbfQ9m88v3vew+IHbzl6axFdAfuOqImiDbTsnmwY=" + }, + "voting_power": "104096", + "proposer_priority": "4142076" + }, + { + "address": "EBAAECF31EC18DC4234E01C82B749AE2CD7A9577", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "dVs+YQNud64PnYtp3xqc/A5HwfzGv9sVpnXUfe+AYfs=" + }, + "voting_power": "102938", + "proposer_priority": "-30341561" + }, + { + "address": "278E254753C713BF4E376707AB95CA86AD6E85C5", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "rj8Jtkia4OBuT/MoulTlWZS/F9/CrbFtxJhhfB19Vno=" + }, + "voting_power": "86548", + "proposer_priority": "24841172" + }, + { + "address": "2AA9B468C8A1E73F561E105D72FA81DAB29C1AC3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vFtSShlGgEAOlhuriQtVNMT3NlM+WpKPy/XqR2PLlE4=" + }, + "voting_power": "83118", + "proposer_priority": "19235380" + }, + { + "address": "2093F4460989C593B8857FA290CD7C349151B460", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "vetelOVLxY8ecRK7Y/6liJ0ncUzUPCImHHmUNLqQQbk=" + }, + "voting_power": "80527", + "proposer_priority": "-33939900" + }, + { + "address": "092CEA84707246E432CEB2CF50B3FC67D5B2233E", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "+kbpYgHoyN/m4U8wvEd1RN6dMHusVIQAhgeShOnnfdA=" + }, + "voting_power": "65901", + "proposer_priority": "-6701077" + }, + { + "address": "06CC2DE3D79183ED07B1A5F2046DB1F3231C3662", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "q9CBuASOTssMLBfwkC4Zuec/QxHcKe3U7oh8yVAfn7o=" + }, + "voting_power": "62970", + "proposer_priority": "-16260638" + }, + { + "address": "B2B7DF55B4D30344E93315EED1F303D78F9E6D06", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "KfHKsKgcgYCMexoZ6dySK+HZXhtP1I/Jhwt5Ghfzkrk=" + }, + "voting_power": "58068", + "proposer_priority": "7469892" + }, + { + "address": "2CEFDA16ECB4D195EC5FF84DE7A564612369CF9C", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "8nordlAP/6MSZDIMMvT/LSMRIhbrOW2hk5G4bjw5Awc=" + }, + "voting_power": "48224", + "proposer_priority": "7248730" + }, + { + "address": "0F49820393B9D49A99153E10810F15DD4DC672DC", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "3nUetIWMiofBqurZvwpTAJYqNpCGSymvalK8QKvCCZ0=" + }, + "voting_power": "20897", + "proposer_priority": "-244667" + }, + { + "address": "9A7C9BB640775B49D698255308F9274E8BC14F9B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ZmeNB5l86JWb55b8VDj5LDL5YhsajJSaQCb3c/gLZJ0=" + }, + "voting_power": "11955", + "proposer_priority": "-19792074" + }, + { + "address": "99F75A1EFF234CD0322AE8467AA6F22169269DB1", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "SoXJF+SD9iwm/tOgUHTkH9NC6bIWOV2oRaOTe2mMnbU=" + }, + "voting_power": "3724", + "proposer_priority": "-38502154" + }, + { + "address": "EAF767C0DCF1F39ACDA8BDEDF742E409E3FE95ED", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "DcMRiMFFRkDVcq2dCfrWy0SYUS+f8RGLPSIToqjmynI=" + }, + "voting_power": "614", + "proposer_priority": "-15445545" + } + ], + "count": "50", + "total": "50" +} \ No newline at end of file diff --git a/x/asset/spec/01_concepts.md b/x/asset/spec/01_concepts.md index 76bd9677..2bf1ba3d 100644 --- a/x/asset/spec/01_concepts.md +++ b/x/asset/spec/01_concepts.md @@ -6,28 +6,14 @@ order: 1 ## The Realio Asset Token Model -The Realio Asset module is centeredd aroumd a token model. It contains the following fields: +The Realio Asset module is centered around a token model where certain whitelisted accounts can issue their own token. A token issued by this module will be managed by a set of privileged accounts. These privileged accounts are assigned by its manager (either an account or a module/contract). -```protobuf -message Token { - string name = 1; - string symbol = 2; - int64 total = 3; - int64 decimals = 4; - bool authorizationRequired = 5; - string creator = 6; - map authorized = 7; - int64 created = 8; -} +### System of privileged accounts -``` - -### Token Authorization - -The `Token` model provides a means to whitelist users via the `authorizationRequired` and `authorized` fields -A token that has the `authorizationRequired` turned on, can maintain a whitelist map of user addresses. These addresses -are the only ones able to send/receive the token. The Realio Network is agnostic to the logic of applications that use -the whitelisting. It is up to the clients to determine when to whitelist and what to do with it. +Privileged accounts of a token are accounts that can execute certain actions for that token. There're are several types of privileges, each has its own logic to define the actions which accounts of said type can execute. We wanna decouple the logic of these privileges from the `Asset module` logic, meaning that privileges will be defined in separate packages/modules, thus, developers can customize their type of privilege without modifying the `Asset Module`. Doing this allows our privileges system to be extensible while keeping the core logic of `Asset Module` untouched and simple, avoiding complicated migration when we expand our privileges system. +In order for a privilege to integrate into the `Asset Module`. It has to implement the `Privilege` interface and has its implementation registered via calling `RegisterPrivilege`. Once that is done, we can make said privilege available onchain by executing `AddPrivilege` gov proposals. This procedure is similar to the `SoftwareUpgrade` via gov proposals, however, we don't need to worry about having to write an `upgrade handler`, just import the new privilege into `Asset Module` and we're good to go. +It's important to note that the token manager can choose what privileges it wants to disable for its token Which is specified by the token manager when creating the token. After creating the token, all the enabled privileges will be assigned to the token manager in default but the token manager can assign privileges to different accounts later on. +We have already defined basic privileges: "mint", "freeze", "clawback", "transfer_auth". These privileges will be included in the default settings of the module. \ No newline at end of file diff --git a/x/asset/spec/02_state.md b/x/asset/spec/02_state.md index bcc1e164..f05d8e87 100644 --- a/x/asset/spec/02_state.md +++ b/x/asset/spec/02_state.md @@ -4,45 +4,37 @@ order: 2 # State -## State Objects +## Store -The `x/asset` module keeps the following objects in state: +### Token Management -| State Object | Description | Key | Value | Store | -|----------------------|--------------------------------|--------------------------| --------------- |-------| -| `Token` | Token bytecode | `[]byte{1} + []byte(id)` | `[]byte{token}` | KV | -| `TokenAuthorization` | Token Authorization bytecode | `[]byte{2} + []byte(id)` | `[]byte(id)` | KV | +Map: `0x01 | {Token ID} | TokenManagement -> TokenManagement` -### Token +Token management holds these information about the token: -Allows creation of tokens with optional user authorization. +* the token's manager +* the excluded privileges (privileges that are permenantly disable) +* if we can add newly introduced privilege to the token later on ```go -type Token struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` - Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` - Decimals int64 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - AuthorizationRequired bool `protobuf:"varint,5,opt,name=authorizationRequired,proto3" json:"authorizationRequired,omitempty"` - Creator string `protobuf:"bytes,6,opt,name=creator,proto3" json:"creator,omitempty"` - Authorized map[string]*TokenAuthorization `protobuf:"bytes,7,rep,name=authorized,proto3" json:"authorized,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Created int64 `protobuf:"varint,8,opt,name=created,proto3" json:"created,omitempty"` +type TokenManagement struct { + Manager string + AddNewPrivilege bool + ExcludedPrivileges []string } ``` -### Token Authorization +### Privileged Accounts -A Token authorization struct represents a single addresses current authorization state for a token +Map: `0x02 | {Token ID} | {Privilege Name} -> Addresses` -```go -type TokenAuthorization struct { - TokenSymbol string `protobuf:"bytes,1,opt,name=tokenSymbol,proto3" json:"tokenSymbol,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Authorized bool `protobuf:"varint,3,opt,name=authorized,proto3" json:"authorized,omitempty"` -} -``` +### Privilege Store +Sub stores: `0x03 | {Token ID} | {Privilege Name}` +Since each type of privilege has its own logic, we need to leave a seprate space for each of them to store their data. A privilege should manage its own store provided by the asset module, prefixed with `0x03 | {Token ID} | {Privilege Name}` + +**Note:** We don't want to store the basic info of a token (name, symbol, decimal and description) as we want to utilize bank metadata for storing it instead. ## Genesis State @@ -51,7 +43,7 @@ The `x/asset` module's `GenesisState` defines the state necessary for initializi ```go // GenesisState defines the module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - PortId string `protobuf:"bytes,2,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` + Params Params + Tokens []Token } -``` \ No newline at end of file +``` diff --git a/x/asset/spec/03_params.md b/x/asset/spec/03_params.md index 06f1e439..a60c68eb 100644 --- a/x/asset/spec/03_params.md +++ b/x/asset/spec/03_params.md @@ -6,8 +6,10 @@ order: 3 The asset module contains the following parameters: -| Key | Type | Example | -|---------------|-----------------|------------------------| -| port | string | "ario" | -| InflationRate | string (dec) | "0.130000000000000000" | -| BlocksPerYear | string (uint64) | "6311520" | +| Key | Type | Example | +|------------|----------|-----------------| +| Privileges | []string | "freeze","mint" | + +## Details + +- Privileges: refers to the privileges that is enabled for our privilege system. Everytime a new type of privilege is introduced, we will update this param to include it. diff --git a/x/asset/spec/04_messages.md b/x/asset/spec/04_messages.md new file mode 100644 index 00000000..93ab1e10 --- /dev/null +++ b/x/asset/spec/04_messages.md @@ -0,0 +1,90 @@ + + +# Messages + +The asset module exposes the following messages: + +## MessageCreateToken + +```go +type MsgCreateToken struct { + Creator string + Manager string + Name string + Symbol string + Decimal string + ExcludedPrivileges []string + AddNewPrivileges bool +} +``` + +`MessageCreateToken` allows a whitelisted account to create a token with custom configuration. + +## MessageAllocateToken + +```go +type MsgAllocateToken struct { + Manager string + TokenID string + Balances []Balance + VestingBalances []VestingAccount +} +``` + +`MessageAllocateToken` can only be executed by the token manager once after their token is successfully created. It will allocate tokens (either vesting or liquid) to the list of accounts sepecifed in the message. + +## MessageAssignPrivilege + +```go +type MsgAssignPrivilege struct { + Manager string + TokenID string + AssignedTo []string + Privilege string +} +``` + +`MessageAssignPrivilege` allows the token manager to assign a privilege to the chosen addresses. This message will fail if the privilege is in the list of `ExcludedPrivileges` specified when creating the token. + +## MessageUnassignPrivilege + +```go +type MsgAssignPrivilege struct { + Manager string + TokenID string + UnassignedFrom []string + Privilege string +} +``` + +`MessageUnassignPrivilege` allows the token manager to unassign a privilege from the chosen addresses. + +## MessageDisablePrivilege + +```go +type MsgDisablePrivilege struct { + Manager string + TokenID string + DisabledPrivilege string +} +``` + +`MessageDisablePrivilege` allows the token manager to disable a privilege permanently, it will also unassigns all the accounts with that privilege. + +## MessageExecutePrivilege + +```go +type PrivilegeMsg interface { + Privilege() string +} + +type MsgExecute struct { + Address string + TokenID string + PrivilegeMsg PrivilegeMsg +} +``` + +`PrivilegeMsg` allows privileged accounts to execute logic of its privilege. For that reason, it has different implementations defined by each types of privilege instead of the `Asset Module`. These implementations and the logic to handle them are registered into the module via `RegisterPrivilege` method. diff --git a/x/asset/spec/05_gov.md b/x/asset/spec/05_gov.md new file mode 100644 index 00000000..6f419451 --- /dev/null +++ b/x/asset/spec/05_gov.md @@ -0,0 +1,5 @@ + + +# Client diff --git a/x/asset/spec/06_logic.md b/x/asset/spec/06_logic.md new file mode 100644 index 00000000..39715200 --- /dev/null +++ b/x/asset/spec/06_logic.md @@ -0,0 +1,56 @@ + + +# Logic + +This file describes the core logics in this module. + +## Token creation process + +This process is triggered by `MsgCreateToken`. + +Validation: + +- Check if `Creator` is whitelisted. We only allow some certain accounts to create tokens, these accounts is determined via gov proposal. +- Check if the token with the same denom has already existed. + +Flow: + +1. The denom for the token will be derived from `Creator` and `Symbol` with the format of `asset/{Manager}/{Symbol}` +2. Save the token basic information (name, symbol, decimal and description) in the x/bank metadata store +3. Save the token management info (`Manager`, `ExcludedPrivileges` and `AddNewPrivilege`) in the x/asset store. + +Note that here we prefixed the token denom with the manager address in order to allow many different creators to create token with the same symbol, differentiate their denom by including in their creator. + +## Register a privilege + +Each type of privilege enables a set of messages to be executed. + +MintPrivilege { + storeKey + mintKeeper MintKeeper + bankKeeper BankKeeper +} + +func Wrap + +```go +type handler func(ctx, store, msg) + + +MintPrivilege func Handle (ctx, store, msg) error{ + func + + +} + +type Privilege interface { + + RegisterMsgHandlers(msgType string, MsgHandler func(ctx, store, msg) ) + RegisterCodec() + RegisterQuerier(queryType string, ) + +} + +``` \ No newline at end of file diff --git a/x/asset/spec/04_events.md b/x/asset/spec/07_events.md similarity index 99% rename from x/asset/spec/04_events.md rename to x/asset/spec/07_events.md index be929e92..fc3f6391 100644 --- a/x/asset/spec/04_events.md +++ b/x/asset/spec/07_events.md @@ -1,5 +1,5 @@ # Events diff --git a/x/asset/spec/05_client.md b/x/asset/spec/08_client.md similarity index 97% rename from x/asset/spec/05_client.md rename to x/asset/spec/08_client.md index 71de1325..140a3724 100644 --- a/x/asset/spec/05_client.md +++ b/x/asset/spec/08_client.md @@ -1,5 +1,5 @@ # Client From 542672167215bf682923afde9b2bcc5ee3afee73 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Tue, 9 Jul 2024 15:32:52 +0700 Subject: [PATCH 2/7] initial spec of module --- x/asset/module.go | 1 + x/asset/spec/02_state.md | 15 +++++++++--- x/asset/spec/04_messages.md | 6 ++--- x/asset/spec/05_gov.md | 16 ++++++++++++- x/asset/spec/06_logic.md | 47 +++++++++++++++++++++---------------- 5 files changed, 58 insertions(+), 27 deletions(-) diff --git a/x/asset/module.go b/x/asset/module.go index 88ad6184..fc0ffe2f 100644 --- a/x/asset/module.go +++ b/x/asset/module.go @@ -137,6 +137,7 @@ func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/asset/spec/02_state.md b/x/asset/spec/02_state.md index f05d8e87..97bc8e4c 100644 --- a/x/asset/spec/02_state.md +++ b/x/asset/spec/02_state.md @@ -8,6 +8,17 @@ order: 2 ### Token Management +Map: `0x00 | {Token ID} -> Token` + +```go +type Token struct { + Name string + Symbol string + Decimal string + Description string +} +``` + Map: `0x01 | {Token ID} | TokenManagement -> TokenManagement` Token management holds these information about the token: @@ -17,7 +28,7 @@ Token management holds these information about the token: * if we can add newly introduced privilege to the token later on ```go -type TokenManagement struct { +type TokenManagement struct { Manager string AddNewPrivilege bool ExcludedPrivileges []string @@ -34,8 +45,6 @@ Sub stores: `0x03 | {Token ID} | {Privilege Name}` Since each type of privilege has its own logic, we need to leave a seprate space for each of them to store their data. A privilege should manage its own store provided by the asset module, prefixed with `0x03 | {Token ID} | {Privilege Name}` -**Note:** We don't want to store the basic info of a token (name, symbol, decimal and description) as we want to utilize bank metadata for storing it instead. - ## Genesis State The `x/asset` module's `GenesisState` defines the state necessary for initializing the chain from a previous exported height. It contains the module parameters and the registered token pairs : diff --git a/x/asset/spec/04_messages.md b/x/asset/spec/04_messages.md index 93ab1e10..5182317c 100644 --- a/x/asset/spec/04_messages.md +++ b/x/asset/spec/04_messages.md @@ -51,7 +51,7 @@ type MsgAssignPrivilege struct { ## MessageUnassignPrivilege ```go -type MsgAssignPrivilege struct { +type MsgUnassignPrivilege struct { Manager string TokenID string UnassignedFrom []string @@ -77,10 +77,10 @@ type MsgDisablePrivilege struct { ```go type PrivilegeMsg interface { - Privilege() string + NeedPrivilege() string } -type MsgExecute struct { +type MsgExecutePrivilege struct { Address string TokenID string PrivilegeMsg PrivilegeMsg diff --git a/x/asset/spec/05_gov.md b/x/asset/spec/05_gov.md index 6f419451..f2c7c9b9 100644 --- a/x/asset/spec/05_gov.md +++ b/x/asset/spec/05_gov.md @@ -2,4 +2,18 @@ order: 5 --> -# Client +# Gov proposals + +The asset module supports the following types of gov proposals: + +## TokenCreatorWhitelistProposal + +This proposal allows the community to decide on what addresses are allowed to create token via the asset module. + +## AddPrilegeProposal + +This proposal functioning similarly to the `SoftwareUpgradeProposal`. It specifies the `Privilege` that will be added into the privilege system. Then, It'll stop the chain at a specified height so that a new binary that contains logic for the specified `Privilege` is switched in to continue running the chain. After said process is finished, the new `Privilege` will be available on chain. + +## ExecutePrivilege + +These types of proposals is implemented as sdk.msg with respective handling methods following `gov.v1beta` standard. diff --git a/x/asset/spec/06_logic.md b/x/asset/spec/06_logic.md index 39715200..86dfb6a8 100644 --- a/x/asset/spec/06_logic.md +++ b/x/asset/spec/06_logic.md @@ -17,7 +17,7 @@ Validation: Flow: -1. The denom for the token will be derived from `Creator` and `Symbol` with the format of `asset/{Manager}/{Symbol}` +1. The denom for the token will be derived from `Creator` and `Symbol` with the format of `asset/{Creator}/{Symbol}` 2. Save the token basic information (name, symbol, decimal and description) in the x/bank metadata store 3. Save the token management info (`Manager`, `ExcludedPrivileges` and `AddNewPrivilege`) in the x/asset store. @@ -25,32 +25,39 @@ Note that here we prefixed the token denom with the manager address in order to ## Register a privilege -Each type of privilege enables a set of messages to be executed. +To intergrate with the `asset module` Each type of privilege has to implement this interface -MintPrivilege { - storeKey - mintKeeper MintKeeper - bankKeeper BankKeeper +```go +type Privilege interface { + RegisterInterfaces() + MsgHandler() MsgHandler + QueryHandler() QueryHandler + CLI() *cobra.Command } -func Wrap +type MsgHandler func(context Context, privMsg PrivilegeMsg) error -```go -type handler func(ctx, store, msg) +type QueryHandler func(context Context, privQuery PrivilegeQuery) error +``` +This interface provides all the functionality necessary for a privilege, including a message handler, query handler and cli -MintPrivilege func Handle (ctx, store, msg) error{ - func +All the `PrivilegeMsg` of a privilege should return the name of that privilege when called `NeedPrivilege()`. A message handler should handle all the `PrivilegeMsg` of that privilege. +When adding a `Privilege`, we calls `PrivilegeManager.AddPrivilege()` in `app.go` which inturn maps all the `PrivilegeMsg` of that privilege to its `MsgHandler`. This mapping logic will later be used when running a `MsgExecutePrivilege` -} +## Flow of MsgExecutePrivilege -type Privilege interface { - - RegisterMsgHandlers(msgType string, MsgHandler func(ctx, store, msg) ) - RegisterCodec() - RegisterQuerier(queryType string, ) - -} +This process is triggered by the `MsgExecutePrivilege`. + +Validation: + +- Checks if the token specified in the msg exists. +- Checks if the privilege is supported. +- Checks if the `Msg.Address` has the corresponding `Privilege` specified by `PrivilegeMsg.NeedPrivilege()` + +Flow: -``` \ No newline at end of file +- Prepare store for the privilege of the token via `MakePrivilegeStore(privilege name, token denom)`. That store is the only store accessable by the privilege's `MsgHandler`. +- `PrivilegeManager` routes the `PrivilegeMsg` to the its `MsgHandler`. +- `MsgHandler` now handles the `PrivilegeMsg`. From 8602fbdd0029a8930143ca022637baa022b97faf Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Tue, 9 Jul 2024 15:43:19 +0700 Subject: [PATCH 3/7] update spec --- x/asset/spec/01_concepts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/asset/spec/01_concepts.md b/x/asset/spec/01_concepts.md index 2bf1ba3d..c3ba4eac 100644 --- a/x/asset/spec/01_concepts.md +++ b/x/asset/spec/01_concepts.md @@ -12,8 +12,8 @@ The Realio Asset module is centered around a token model where certain whitelist Privileged accounts of a token are accounts that can execute certain actions for that token. There're are several types of privileges, each has its own logic to define the actions which accounts of said type can execute. We wanna decouple the logic of these privileges from the `Asset module` logic, meaning that privileges will be defined in separate packages/modules, thus, developers can customize their type of privilege without modifying the `Asset Module`. Doing this allows our privileges system to be extensible while keeping the core logic of `Asset Module` untouched and simple, avoiding complicated migration when we expand our privileges system. -In order for a privilege to integrate into the `Asset Module`. It has to implement the `Privilege` interface and has its implementation registered via calling `RegisterPrivilege`. Once that is done, we can make said privilege available onchain by executing `AddPrivilege` gov proposals. This procedure is similar to the `SoftwareUpgrade` via gov proposals, however, we don't need to worry about having to write an `upgrade handler`, just import the new privilege into `Asset Module` and we're good to go. +In order for a privilege to integrate into the `Asset Module`. It has to implement the `Privilege` interface and has its implementation registered via the method `AddPrivilege`. Once that is done, we can make said privilege available onchain by executing `AddPrivilegeProposal`. This procedure is similar to the `SoftwareUpgrade` via gov proposals, however, we don't need to worry about having to write an `upgrade handler`, just import the new privilege into `Asset Module` and we're good to go. It's important to note that the token manager can choose what privileges it wants to disable for its token Which is specified by the token manager when creating the token. After creating the token, all the enabled privileges will be assigned to the token manager in default but the token manager can assign privileges to different accounts later on. -We have already defined basic privileges: "mint", "freeze", "clawback", "transfer_auth". These privileges will be included in the default settings of the module. \ No newline at end of file +We have already defined basic privileges: "mint", "freeze", "clawback", "transfer_auth". These privileges will be included in the default settings of the module. From 78659e5f8a19211357810e6c2955992ddafa1a18 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Tue, 9 Jul 2024 15:47:06 +0700 Subject: [PATCH 4/7] update spec --- x/asset/spec/01_concepts.md | 2 +- x/asset/spec/05_gov.md | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/x/asset/spec/01_concepts.md b/x/asset/spec/01_concepts.md index c3ba4eac..2677b315 100644 --- a/x/asset/spec/01_concepts.md +++ b/x/asset/spec/01_concepts.md @@ -12,7 +12,7 @@ The Realio Asset module is centered around a token model where certain whitelist Privileged accounts of a token are accounts that can execute certain actions for that token. There're are several types of privileges, each has its own logic to define the actions which accounts of said type can execute. We wanna decouple the logic of these privileges from the `Asset module` logic, meaning that privileges will be defined in separate packages/modules, thus, developers can customize their type of privilege without modifying the `Asset Module`. Doing this allows our privileges system to be extensible while keeping the core logic of `Asset Module` untouched and simple, avoiding complicated migration when we expand our privileges system. -In order for a privilege to integrate into the `Asset Module`. It has to implement the `Privilege` interface and has its implementation registered via the method `AddPrivilege`. Once that is done, we can make said privilege available onchain by executing `AddPrivilegeProposal`. This procedure is similar to the `SoftwareUpgrade` via gov proposals, however, we don't need to worry about having to write an `upgrade handler`, just import the new privilege into `Asset Module` and we're good to go. +In order for a privilege to integrate into the `Asset Module`. It has to implement the `Privilege` interface and has its implementation registered via the method `AddPrivilege`. Once that is done, we can make said privilege available onchain by executing `SoftwareUpgradeProposal` like a regular chain upgrade process. It's important to note that the token manager can choose what privileges it wants to disable for its token Which is specified by the token manager when creating the token. After creating the token, all the enabled privileges will be assigned to the token manager in default but the token manager can assign privileges to different accounts later on. diff --git a/x/asset/spec/05_gov.md b/x/asset/spec/05_gov.md index f2c7c9b9..dbe1b659 100644 --- a/x/asset/spec/05_gov.md +++ b/x/asset/spec/05_gov.md @@ -10,10 +10,4 @@ The asset module supports the following types of gov proposals: This proposal allows the community to decide on what addresses are allowed to create token via the asset module. -## AddPrilegeProposal - -This proposal functioning similarly to the `SoftwareUpgradeProposal`. It specifies the `Privilege` that will be added into the privilege system. Then, It'll stop the chain at a specified height so that a new binary that contains logic for the specified `Privilege` is switched in to continue running the chain. After said process is finished, the new `Privilege` will be available on chain. - -## ExecutePrivilege - These types of proposals is implemented as sdk.msg with respective handling methods following `gov.v1beta` standard. From 8e78b86404c648606c16b3c429d25e1f9d271cb1 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Tue, 9 Jul 2024 16:09:29 +0700 Subject: [PATCH 5/7] update spec --- x/asset/spec/02_state.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x/asset/spec/02_state.md b/x/asset/spec/02_state.md index 97bc8e4c..0636f6a0 100644 --- a/x/asset/spec/02_state.md +++ b/x/asset/spec/02_state.md @@ -6,7 +6,7 @@ order: 2 ## Store -### Token Management +### Token Store Map: `0x00 | {Token ID} -> Token` @@ -19,7 +19,11 @@ type Token struct { } ``` -Map: `0x01 | {Token ID} | TokenManagement -> TokenManagement` +Note that these infos are also stored in the `metadata` store of bank module. + +### Token Management + +Map: `0x01 | {Token ID} -> TokenManagement` Token management holds these information about the token: From 4dafe9f2597f61f6f5126d939d36a153178c6f22 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Tue, 9 Jul 2024 17:48:23 +0700 Subject: [PATCH 6/7] minor --- valset.json | 457 -------------------------------------- x/asset/spec/07_events.md | 2 +- x/asset/spec/08_client.md | 2 +- 3 files changed, 2 insertions(+), 459 deletions(-) delete mode 100644 valset.json diff --git a/valset.json b/valset.json deleted file mode 100644 index af45b3bc..00000000 --- a/valset.json +++ /dev/null @@ -1,457 +0,0 @@ -{ - "block_height": "7082809", - "validators": [ - { - "address": "7B7D688CDA3712BEA7681977629A348619FFF694", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "3+rOKbRkAs3un1h/7l7tnktZ4hlQQNrMphfp34jART8=" - }, - "voting_power": "8624093", - "proposer_priority": "21972780" - }, - { - "address": "ABCD244949D75638B1FF65BD3720AFAFDB4ABB83", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "bVOEXOpPKshrZITF6iaEEMzglc65h7mUkdx3DeEIvFE=" - }, - "voting_power": "7032490", - "proposer_priority": "-20752710" - }, - { - "address": "7E6CBCDACECA7F65A8D2EEFE2F3704A4B81FBE65", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "d8RVo9JyZ3Ojhhw66Xs00Ra8oImgYoJq3rZlU17F33s=" - }, - "voting_power": "3933438", - "proposer_priority": "35223909" - }, - { - "address": "2C57CB1A9B64A3438B3095C634FE904177DEF7DD", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "f5F3voOiLw+eMmpGVV1ySoYaOqIC6715l3zjgw7i0y4=" - }, - "voting_power": "3639952", - "proposer_priority": "35184070" - }, - { - "address": "EFEC8316F4781997D54DBE651AF60BD484C1EBE6", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "bGYjF1YUqqwvKCq1QPiNZ/5s08e/wFYAC4F5AtJBRhQ=" - }, - "voting_power": "3578132", - "proposer_priority": "-6003672" - }, - { - "address": "01B9A503BD87498A6D622DCB50DE9A1D3D988A18", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "A+emCaNFwL2V4QK9aupRLHF7Mr4qDnLbTvE6DMMXbHw=" - }, - "voting_power": "3493948", - "proposer_priority": "-17863571" - }, - { - "address": "6C5A0291653B44F42B4F737218A000537985C948", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "5aggyt1XTSCag/cs1H+1yiupXNuV3uL4KUS/CnsdOfI=" - }, - "voting_power": "3033925", - "proposer_priority": "-22336962" - }, - { - "address": "6BB5BBE12CB4241A1BF174BF91AC4BDC3C83E203", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "Irtgsz7298m9yGFDbq/h3WykZBcYtaYA3MvgZ76ORHU=" - }, - "voting_power": "3026166", - "proposer_priority": "27393540" - }, - { - "address": "524FC3883F4E35C4DBC06B98B58504BAEBB8D3CC", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "xeWcP7eVe64045xspOTiDiuXYe9L7IpKfu+zezZs+/g=" - }, - "voting_power": "2533176", - "proposer_priority": "43494873" - }, - { - "address": "AA56D591D6CBBEACFEBE0C49B03837036549C2FA", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "gQgRDkm9U8AnCFD0zyuL9RI6jzhJgucWN+R5TCGomBU=" - }, - "voting_power": "2526704", - "proposer_priority": "30510518" - }, - { - "address": "D21D299C098941E8D86212AE8FA36A1409330E72", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "UNolLiLSGbuptKgJ+09xeN3D0r7kwOoXA3q1+E/z15w=" - }, - "voting_power": "2502001", - "proposer_priority": "-21914475" - }, - { - "address": "55D30176F25B9FB86E1DD4FD6EB0DA586E494F5A", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "4X3Wlxf8rxTNzikEDv8urMY9FuXP1wS5cw7h8tePoN0=" - }, - "voting_power": "2500067", - "proposer_priority": "-19965866" - }, - { - "address": "8472C36B167D47D42C95D2ECCA4AB219CD159A0D", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "lJwnj6YgkHuXEpR8ryREKwFglOMUtLIe5Fahg4ELO7k=" - }, - "voting_power": "2500060", - "proposer_priority": "-20981407" - }, - { - "address": "39E8C767948D39CF9800248DD8AADF797DE1CC1C", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "JTkIuPJnRW8W22GBPBZnT4Ni8pvm9pfxegshwR+0ro0=" - }, - "voting_power": "2500001", - "proposer_priority": "33107612" - }, - { - "address": "EC00355682D02056A6B3189832651379DE9F99F0", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "Y9zU204rkpjsaDFYGHd4008iCOAklgMrqdP34hMWVv8=" - }, - "voting_power": "2116664", - "proposer_priority": "-20780344" - }, - { - "address": "F7A919546E5A2F5F7B785AECFB2B0D098A9E6221", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "O1WTJzYSQB4isaJVrF0aWegX9TrBPtokU/meF1gDJzM=" - }, - "voting_power": "1730349", - "proposer_priority": "-19695476" - }, - { - "address": "3590F1D6B8F2C48E15F5B4A3BF37B43ADC5B2990", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "t8TKgVCg8UMabwX5VOOfBIKdTHZxuFfSFSECNrTl6rw=" - }, - "voting_power": "1587031", - "proposer_priority": "21652269" - }, - { - "address": "72322D44C6DB59AD2C82142E2A17C0BD9A5D426D", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "LDusfYNn2nada9h67Rv7KwGji9q8agd0jsrApTcCids=" - }, - "voting_power": "1544970", - "proposer_priority": "-11224883" - }, - { - "address": "1741FEB19C0C65E5DE890EE543D66A972A624C10", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "PERIgcgi35gI/zw9rxJ4U1Uyg+T7sPJMILpc8nIu7Tw=" - }, - "voting_power": "1242708", - "proposer_priority": "2690332" - }, - { - "address": "1F9E1FF18ADB9B9B454DF7FAED9850F98AB44EAB", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "XIzx58CGCPQ9Jag9H7QiE1YOY+Bj1osEBnWv83EGjpc=" - }, - "voting_power": "1216273", - "proposer_priority": "20131417" - }, - { - "address": "8D701B6AB3D2F4D1E603FC1740508A4ECA7021C3", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "ncZDvCEIc+jI2St4rSU2ppVgvaZIj/mizmrx4V1cV9Y=" - }, - "voting_power": "986805", - "proposer_priority": "29169582" - }, - { - "address": "6F69B974E029183B443DFF2E58D6DFD13B5FD3CA", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "D1Op6cPC/O0yt93nXrO7KfHn4OUFe4pr94fpXcUOisk=" - }, - "voting_power": "756688", - "proposer_priority": "1625130" - }, - { - "address": "7C96FB5676178BDB5BD6081AB929E13D74048D83", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "I3I31RsIoAQtpMEbw6roGwlNHjbmh10//OMFiWWzxiA=" - }, - "voting_power": "672118", - "proposer_priority": "-2174960" - }, - { - "address": "582724FF4760B2BBBDD30D3B90BB82A70BADCF9D", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "EC8wl+5/fI36QxlCM57zXBinioQvbuou8ZO4FWuRxDI=" - }, - "voting_power": "456859", - "proposer_priority": "-16993680" - }, - { - "address": "468993C9D53B06A80774466985D21C6F2B5114C4", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "rd3S6cUH/5qgzZXniYiEUZL0N624oUAOsp1qV7HpQ2s=" - }, - "voting_power": "441883", - "proposer_priority": "3896883" - }, - { - "address": "5341E30A37597B82EBEDD831A0090A65B8562838", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "WpHbPLgBK0MNUfHrrsvabftyuD5SyVomD9G7N5DMufU=" - }, - "voting_power": "351391", - "proposer_priority": "25157045" - }, - { - "address": "F3FAC83AD491706DC9EF4FD3CF06207C1D6AF056", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "aDvR2lr+JJqOZx6gDNeGBswx2G+YBCd5xOqUHs3vubc=" - }, - "voting_power": "338209", - "proposer_priority": "16192173" - }, - { - "address": "03BB90DD02D1BA931248D52D12E02C1312C7A2ED", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "1G/t16KbLUrtR+Cd9siuj5nbZE/GRGjTHqqWpB7dwro=" - }, - "voting_power": "283392", - "proposer_priority": "-12687545" - }, - { - "address": "15876D87172414B9F0814FED95B0CCE04291DB7A", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "jVKhS8PeIlzCEnBy87YrGJIYmXDin522tHvVygRzJ+c=" - }, - "voting_power": "204447", - "proposer_priority": "-5734785" - }, - { - "address": "E069465373B078CEBE45675F1E97BE2FD7266E7D", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "ezxmMWqrOO/O0VnJ2MKbcM7ovn4vdKrYpwtC8Ds3njg=" - }, - "voting_power": "177086", - "proposer_priority": "-7560778" - }, - { - "address": "C4428823B79C3FCC2B5EC7682A0E01400FBD7342", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "IrZOKvpsrn24MeaSo70KGfCXl1q+T8xiYdIjWONu154=" - }, - "voting_power": "166919", - "proposer_priority": "14763670" - }, - { - "address": "666E20CA1CF9F160174C3F8D32C0FB0D3ED8ADE3", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "O7VSwPA/bK84G8vBHBYpodLGxtIDiBdCMSBfy8XoNt0=" - }, - "voting_power": "166102", - "proposer_priority": "-24579426" - }, - { - "address": "77FF06366686F628EE0B7CF50A63073B8AB49D4E", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "h58n2zQK+RBIpQKO6vZi/lv9RFQvE6PlyE5MD6n4t6k=" - }, - "voting_power": "165961", - "proposer_priority": "-27323887" - }, - { - "address": "0F87058BA44016C260464E21A09098DE06D23539", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "/6OejaFvubGh/5DH4zHhgiUMAwyk6ZWHGLNKSBcvhUY=" - }, - "voting_power": "155084", - "proposer_priority": "11742085" - }, - { - "address": "83F569011FB35484BA770EC243E6FCAA08F684AC", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "cjQ7s2EBeRR3gbEJa51qDXQueJ7AMQMX1ylL8fRMB1Y=" - }, - "voting_power": "134814", - "proposer_priority": "1319594" - }, - { - "address": "0B0782CEEF41C1B64C9584749056EB040B4772FA", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "bULCB2MAJtU+yWUhqcP7T+tpzXrXyLtUz4b7rBw8WII=" - }, - "voting_power": "126287", - "proposer_priority": "-19166274" - }, - { - "address": "825C49D54AFB814D2173DD6E506A22105A52EA03", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "ftMsum17nvAMrruBS/TO5P1i/w1IY2HutKaB16RThEg=" - }, - "voting_power": "122756", - "proposer_priority": "20803606" - }, - { - "address": "C94E04DFA21278CD420E92EB126867AC1955D0CA", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "r/0QbfQ9m88v3vew+IHbzl6axFdAfuOqImiDbTsnmwY=" - }, - "voting_power": "104096", - "proposer_priority": "4142076" - }, - { - "address": "EBAAECF31EC18DC4234E01C82B749AE2CD7A9577", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "dVs+YQNud64PnYtp3xqc/A5HwfzGv9sVpnXUfe+AYfs=" - }, - "voting_power": "102938", - "proposer_priority": "-30341561" - }, - { - "address": "278E254753C713BF4E376707AB95CA86AD6E85C5", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "rj8Jtkia4OBuT/MoulTlWZS/F9/CrbFtxJhhfB19Vno=" - }, - "voting_power": "86548", - "proposer_priority": "24841172" - }, - { - "address": "2AA9B468C8A1E73F561E105D72FA81DAB29C1AC3", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "vFtSShlGgEAOlhuriQtVNMT3NlM+WpKPy/XqR2PLlE4=" - }, - "voting_power": "83118", - "proposer_priority": "19235380" - }, - { - "address": "2093F4460989C593B8857FA290CD7C349151B460", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "vetelOVLxY8ecRK7Y/6liJ0ncUzUPCImHHmUNLqQQbk=" - }, - "voting_power": "80527", - "proposer_priority": "-33939900" - }, - { - "address": "092CEA84707246E432CEB2CF50B3FC67D5B2233E", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "+kbpYgHoyN/m4U8wvEd1RN6dMHusVIQAhgeShOnnfdA=" - }, - "voting_power": "65901", - "proposer_priority": "-6701077" - }, - { - "address": "06CC2DE3D79183ED07B1A5F2046DB1F3231C3662", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "q9CBuASOTssMLBfwkC4Zuec/QxHcKe3U7oh8yVAfn7o=" - }, - "voting_power": "62970", - "proposer_priority": "-16260638" - }, - { - "address": "B2B7DF55B4D30344E93315EED1F303D78F9E6D06", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "KfHKsKgcgYCMexoZ6dySK+HZXhtP1I/Jhwt5Ghfzkrk=" - }, - "voting_power": "58068", - "proposer_priority": "7469892" - }, - { - "address": "2CEFDA16ECB4D195EC5FF84DE7A564612369CF9C", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "8nordlAP/6MSZDIMMvT/LSMRIhbrOW2hk5G4bjw5Awc=" - }, - "voting_power": "48224", - "proposer_priority": "7248730" - }, - { - "address": "0F49820393B9D49A99153E10810F15DD4DC672DC", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "3nUetIWMiofBqurZvwpTAJYqNpCGSymvalK8QKvCCZ0=" - }, - "voting_power": "20897", - "proposer_priority": "-244667" - }, - { - "address": "9A7C9BB640775B49D698255308F9274E8BC14F9B", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "ZmeNB5l86JWb55b8VDj5LDL5YhsajJSaQCb3c/gLZJ0=" - }, - "voting_power": "11955", - "proposer_priority": "-19792074" - }, - { - "address": "99F75A1EFF234CD0322AE8467AA6F22169269DB1", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "SoXJF+SD9iwm/tOgUHTkH9NC6bIWOV2oRaOTe2mMnbU=" - }, - "voting_power": "3724", - "proposer_priority": "-38502154" - }, - { - "address": "EAF767C0DCF1F39ACDA8BDEDF742E409E3FE95ED", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "DcMRiMFFRkDVcq2dCfrWy0SYUS+f8RGLPSIToqjmynI=" - }, - "voting_power": "614", - "proposer_priority": "-15445545" - } - ], - "count": "50", - "total": "50" -} \ No newline at end of file diff --git a/x/asset/spec/07_events.md b/x/asset/spec/07_events.md index fc3f6391..873ae2fe 100644 --- a/x/asset/spec/07_events.md +++ b/x/asset/spec/07_events.md @@ -1,5 +1,5 @@ # Events diff --git a/x/asset/spec/08_client.md b/x/asset/spec/08_client.md index 140a3724..7e85c8e1 100644 --- a/x/asset/spec/08_client.md +++ b/x/asset/spec/08_client.md @@ -1,5 +1,5 @@ # Client From cd7a9a21a36a20f09aeabd8ee799eafe756d3b50 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Tue, 9 Jul 2024 17:53:24 +0700 Subject: [PATCH 7/7] empty 07_events and 08_clients --- x/asset/spec/07_events.md | 19 +------------------ x/asset/spec/08_client.md | 19 +------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/x/asset/spec/07_events.md b/x/asset/spec/07_events.md index 873ae2fe..7d20483b 100644 --- a/x/asset/spec/07_events.md +++ b/x/asset/spec/07_events.md @@ -17,21 +17,4 @@ The `x/asset` module emits the following events: | Type | Attribute Key | Attribute Value | | --------------- |---------------|-----------------| -| `update_token` | `"symbol"` | `{symbol}` | - - -## Authorize address - -| Type | Attribute Key | Attribute Value | -| --------------- |--------------|------------------| -| `authorize_token` | `"symbol"` | `{symbol}` | -| `authorize_token` | `"address"` | `{sdk_address}` | - - -## Un Authorize address - -| Type | Attribute Key | Attribute Value | -| --------------- |---------------|-----------------| -| `unauthorize_token` | `"symbol"` | `{symbol}` | -| `unauthorize_token` | `"address"` | `{sdk_address}` | - +| `update_token` | `"symbol"` | `{symbol}` | \ No newline at end of file diff --git a/x/asset/spec/08_client.md b/x/asset/spec/08_client.md index 7e85c8e1..e698550e 100644 --- a/x/asset/spec/08_client.md +++ b/x/asset/spec/08_client.md @@ -6,21 +6,4 @@ order: 8 ## CLI -A user can query and interact with the `x/asset` module using the CLI. - -### Query - -The `query` commands allow users to query `x/asset` state. - -```sh -realio-networkd query mint --help -``` - -#### params - -The `params` command allow users to query the current module parameters - -```sh -realio-networkd query mint params [flags] -``` - +A user can query and interact with the `x/asset` module using the CLI. \ No newline at end of file