diff --git a/content/en/docs/develop/core-modules/evm.md b/content/en/docs/develop/core-modules/evm.md index dec3e20..42c54d7 100644 --- a/content/en/docs/develop/core-modules/evm.md +++ b/content/en/docs/develop/core-modules/evm.md @@ -768,7 +768,7 @@ type Params struct { The evm denomination parameter defines the token denomination used on the EVM state transitions and gas consumption for EVM messages. -For example, on Ethereum, the `evm_denom` would be `Xpla`. In the case of Ethermint, the default denomination is the **atto photon**(used on the default denom). In terms of precision, the `PHOTON` and `Xpla` share the same value, *i.e* `1 Xpla = 10^18 axpla` and `1 ETH = 10^18 wei`. +For example, on Ethereum, the `evm_denom` would be `XPLA`. In the case of Ethermint, the default denomination is the **atto photon**(used on the default denom). In terms of precision, the `PHOTON` and `XPLA` share the same value, *i.e* `1 XPLA = 10^18 axpla` and `1 ETH = 10^18 wei`. {{< alert >}} Note: SDK applications that want to import the EVM module as a dependency will need to set their own `evm_denom` (i.e not `"aphoton"`). diff --git a/content/en/docs/develop/core-modules/governance.md b/content/en/docs/develop/core-modules/governance.md index 2d366a0..a564df6 100644 --- a/content/en/docs/develop/core-modules/governance.md +++ b/content/en/docs/develop/core-modules/governance.md @@ -24,7 +24,7 @@ The governance process is divided in a few steps that are outlined below: - **Proposal submission:** Proposal is submitted to the blockchain with a deposit. - **Vote:** Once deposit reaches a certain value (`MinDeposit`), proposal is - confirmed and vote opens. Bonded Xpla holders can then send `TxGovVote` + confirmed and vote opens. Bonded XPLA holders can then send `TxGovVote` transactions to vote on the proposal. - If the proposal involves a software upgrade: - **Signal:** Validators start signaling that they are ready to switch to the @@ -36,7 +36,7 @@ The governance process is divided in a few steps that are outlined below: #### Right to submit a proposal -Any Xpla holder, whether bonded or unbonded, can submit proposals by sending a +Any XPLA holder, whether bonded or unbonded, can submit proposals by sending a `TxGovProposal` transaction. Once a proposal is submitted, it is identified by its unique `proposalID`. @@ -87,20 +87,20 @@ When a the a proposal finalized, the coins from the deposit are either refunded #### Participants _Participants_ are users that have the right to vote on proposals. On the -XPLA Chain, participants are bonded Xpla holders. Unbonded Xpla holders and +XPLA Chain, participants are bonded XPLA holders. Unbonded XPLA holders and other users do not get the right to participate in governance. However, they can submit and deposit on proposals. Note that some _participants_ can be forbidden to vote on a proposal under a certain validator if: -- _participant_ bonded or unbonded Xplas to said validator after proposal +- _participant_ bonded or unbonded XPLAs to said validator after proposal entered voting period. - _participant_ became validator after proposal entered voting period. -This does not prevent _participant_ to vote with Xplas bonded to other -validators. For example, if a _participant_ bonded some Xplas to validator A -before a proposal entered voting period and other Xplas to validator B after +This does not prevent _participant_ to vote with XPLAs bonded to other +validators. For example, if a _participant_ bonded some XPLAs to validator A +before a proposal entered voting period and other XPLAs to validator B after proposal entered voting period, only the vote under validator B will be forbidden. @@ -424,7 +424,7 @@ The subspace for the Governance module is `gov`. type DepositParams struct { // Minimum deposit for a proposal to enter voting period. MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_deposit,omitempty" yaml:"min_deposit"` - // Maximum period for Xpla holders to deposit on a proposal. Initial value: 2 + // Maximum period for XPLA holders to deposit on a proposal. Initial value: 2 // months. MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty" yaml:"max_deposit_period"` } diff --git a/content/en/docs/develop/core-modules/xatp.md b/content/en/docs/develop/core-modules/xatp.md new file mode 100644 index 0000000..37eedd2 --- /dev/null +++ b/content/en/docs/develop/core-modules/xatp.md @@ -0,0 +1,159 @@ +--- +title: XATP +weight: 200 +--- + +The XATP(XPLA Alternative Transaction Protocol) module supports fee payment in CW20 tokens. + +## Concepts + +The XATP module allows tokens other than XPLA to be paid as transaction fees on the XPLA Chain. This feature aims to help users who do not hold XPLA to participate in the network and new projects to get onboarded into the ecosystem more seamlessly. + +The module works through the following steps: + +1. The token is registered through a proposal +2. The XATP module owns an account(hereafter the module account) holding XPLA to pay fees +3. When a user generates a transaction, the module pays its fee corresponding to the increased value by `TaxRate` with the registered token +4. The paid fees are sent to the XATP module, which pays the fee in XPLA by the module account. +5. After subtracting the fee transferred to the fee pool, the remainder is distributed to the `community pool`, `reserve account`, and `reward pool` according to the ratios in [parameters]({{< ref "xatp#parameters" >}}). + +## State + +### XATP + +XATP objects are stored and accessed by the denom. + +- Xatps: `0x11 | DenomLen (1 byte) | Denom -> ProtocolBuffer(XATP)` + +```go +type XATP struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Pair string `protobuf:"bytes,3,opt,name=pair,proto3" json:"pair,omitempty"` + Decimals int32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` +} +``` + +#### Denom + +- type: `string` + +`Denom` is highly recommended using a prefix that matches the number of decimal places. e.g. CTXT, which decimal point is 6, is uCTXT. + +#### Token + +- type: `string` + +`Token` is the contract address of CW20. + +#### Pair + +- type: `string` + +AMMs(Automated Market Makers)' pair contract address should be a trading pair including XPLA and be able to query the ratio of its pool. + +#### Decimals + +- type: `int32` + +Indicates the number of decimal places and must be the same as the token information. + +## Proposals + +### RegisterXatpProposal +```go +type RegisterXatpProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Xatp *XATP `protobuf:"bytes,3,opt,name=xatp,proto3" json:"xatp,omitempty"` +} +``` + +Register XATP Proposal is a special type of proposal which, once passed, will automatically go into effect by allowing `Xatp` to be used as a transaction fee. + +{{< alert context="warning" >}} +**Note** + +The denom already registered to the module will be overwritten. +{{< /alert >}} + + +### UnregisterXatpProposal +```go +type UnregisterXatpProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` +} +``` + +Unregister XATP Proposal is a special type of proposal which, once passed, will automatically go into effect by preventing the token that `Denom` represents to be used as a transaction fee. + + +## Transitions + +### InitGenesis + +`InitGenesis` initializes the XATP module genesis state by setting the `GenesisState` fields to the store. In particular, it sets the [parameters]({{< ref "xatp#parameters" >}}) and XATPs. + +### ExportGenesis + +The `ExportGenesis` ABCI function exports the genesis state of the XATP module. In particular, it retrieves all the XATPs information. + +## Parameters + +The XATP module contains the following parameters: + +### Params +```go +type Params struct { + TaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=tax_rate,json=taxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"tax_rate" yaml:"tax_rate"` + FeePoolRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fee_pool_rate,json=feePoolRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_pool_rate" yaml:"fee_pool_rate"` + CommunityPoolRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=community_pool_rate,json=communityPoolRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_pool_rate" yaml:"community_pool_rate"` + ReserveRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=reserve_rate,json=reserveRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reserve_rate" yaml:"reserve_rate"` + RewardPoolRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=reward_pool_rate,json=rewardPoolRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_pool_rate" yaml:"reward_pool_rate"` + ReserveAccount string `protobuf:"bytes,6,opt,name=reserve_account,json=reserveAccount,proto3" json:"reserve_account,omitempty"` +} +``` + +### TaxRate + +- type: `sdk.Dec` +- default: `0.2` + +The ratio of tax charged when paying in XATP denom compared to the default denom. + +### FeePoolRate + +- type: `sdk.Dec` +- default: `1` + +The distribution ratio of received fees to be sent to the fee pool + +### CommunityPoolRate + +- type: `sdk.Dec` +- default: `0.158` + +The distribution ratio of received fees to be sent to the community pool + +### ReserveRate + +- type: `sdk.Dec` +- default: `0.04` + +The distribution ratio of received fees to be sent to the reserve account + +### RewardPoolRate + +- type: `sdk.Dec` +- default: `0.002` + +The distribution ratio of received fees to be sent to the reward pool + +### ReserveAccount + +- type: `string` +- default: `` + +The reserve account address