Skip to content

Commit

Permalink
arrange state spec, nit
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Jan 8, 2025
1 parent 833a1f0 commit 2bfccc3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
3 changes: 1 addition & 2 deletions x/asset/spec/01_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ It's important to note that the token manager can choose what functionalities it

### EVM enable

While it is useful to represent the token in bank module, enabling the token to be in action in evm environment is very convenient and pave the possibility of integrating new features into the ecosystem.
While it is useful to represent the token in bank module, enabling the token to be in action in evm environment is very convenient and pave the possibility of integrating new features into the ecosystem.

Each token can be enabled to work in the evm environment by the token manager, which means user can interact with the token through evm side like metamask or anyother evm wallet and more other protocol integrated in the future. Note that, token manager can disable or enable the token to be used in the evm environment.

23 changes: 7 additions & 16 deletions x/asset/spec/02_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,25 @@ type TokenManager struct{
### TokenDistributor

```go
type TokenManager struct{
type TokenDistributor struct{
Distributors []string `protobuf:"bytes,8,rep,name=distributors,proto3" json:"distributors,omitempty"`
DistributionSettings DistributionSettings `protobuf:"bytes,12,opt,name=distribution_settings,json=distributionSettings,proto3" json:"distribution_settings"`
}
```

By setting `allow_new_fuctionalities`, `issuer` can specify whether they accept new functionalities or not when creating a new token. If he permits it, when upgrading the chain, the new features will be automatically added to the `functionalities_list`and the `manager` can then modify the `functionalities_list` as he sees fit. Otherwise, the `manager` can not chaing the `functionalities_list`.

### TokenDistributor

```protobuf
message TokenDistributor{
[]address distributor_addresses = 2;
DistributionSettings distribution_settings = 5;
}
```

### DistributionSettings

```protobuf
message DistributionSettings {
string max_supply = 1[(gogoproto.customtype) = "cosmossdk.io/math.Int"];
string max_ratelimit = 2[(gogoproto.customtype) = "cosmossdk.io/math.Int"];
```go
type DistributionSettings struct{
MaxSupply string
MaxRatelimit string
}
```

`max_supply` defines the maximum number of tokens can be minted.

`MaxSupply` defines the maximum number of tokens can be minted.
`MaxRatelimit` defines the ratelimit of tokens can be minted per epoch (each epoch last 1 day).

### FreezedAddress

Expand Down
10 changes: 6 additions & 4 deletions x/asset/spec/03_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ order: 3

The asset module contains the following parameters:

| Key | Type | Example |
|----------------------|----------|------------------------|
| AllowFunctionalities | []string | ["burn","freeze"] |
| WhitelistAddresses | []address| ["realio1..."] |
| Key | Type | Example |
|----------------------|---------------|------------------------|
| AllowFunctionalities | []string | ["burn","freeze"] |
| RatelimitDuration | time.Duration | "86400s" |
| WhitelistAddresses | []address | ["realio1..."] |

## Details

- AllowFunctionalities: list of functionalities that the module provides. They can be update after the chain upgrade to enable new functionality add-on to the module.
- RatelimitDuration: duration of ratelimit for `mint` functionality.
- WhitelistAddresses: list of the address that's allow to create new token.

0 comments on commit 2bfccc3

Please sign in to comment.