Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Jun 4, 2024
1 parent a49e5de commit b555d7e
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 27 deletions.
4 changes: 2 additions & 2 deletions docs/cli/zetacored/zetacored_tx_authority.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ zetacored tx authority [flags]
### SEE ALSO

* [zetacored tx](zetacored_tx.md) - Transactions subcommands
* [zetacored tx authority add-authorization](zetacored_tx_authority_add-authorization.md) - add a new authorization or update the policy of an existing authorization.Policy type can be 0 for groupEmergency, 1 for groupOperational, 2 for groupAdmin
* [zetacored tx authority add-authorization](zetacored_tx_authority_add-authorization.md) - Add a new authorization or update the policy of an existing authorization. Policy type can be 0 for groupEmergency, 1 for groupOperational, 2 for groupAdmin.
* [zetacored tx authority remove-authorization](zetacored_tx_authority_remove-authorization.md) - removes an existing authorization
* [zetacored tx authority update-chain-info](zetacored_tx_authority_update-chain-info.md) - Update the chain info
* [zetacored tx authority update-policies](zetacored_tx_authority_update-policies.md) - Update the policies
* [zetacored tx authority update-policies](zetacored_tx_authority_update-policies.md) - Update policies to values provided in the JSON file.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tx authority add-authorization

add a new authorization or update the policy of an existing authorization.Policy type can be 0 for groupEmergency, 1 for groupOperational, 2 for groupAdmin
Add a new authorization or update the policy of an existing authorization. Policy type can be 0 for groupEmergency, 1 for groupOperational, 2 for groupAdmin.

```
zetacored tx authority add-authorization [msg-url] [authorized-policy] [flags]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tx authority update-policies

Update the policies
Update policies to values provided in the JSON file.

```
zetacored tx authority update-policies [policies-json-file] [flags]
Expand Down
10 changes: 10 additions & 0 deletions docs/spec/authority/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## MsgUpdatePolicies

UpdatePolicies updates policies

```proto
message MsgUpdatePolicies {
string creator = 1;
Expand All @@ -11,6 +13,9 @@ message MsgUpdatePolicies {

## MsgUpdateChainInfo

UpdateChainInfo updates the chain info structure that adds new static chain info or overwrite existing chain info
on the hard-coded chain info

```proto
message MsgUpdateChainInfo {
string creator = 1;
Expand All @@ -20,6 +25,9 @@ message MsgUpdateChainInfo {

## MsgAddAuthorization

AddAuthorization defines a method to add an authorization.If the authorization already exists, it will be overwritten with the provided policy.
This should be called by the admin policy account.

```proto
message MsgAddAuthorization {
string creator = 1;
Expand All @@ -30,6 +38,8 @@ message MsgAddAuthorization {

## MsgRemoveAuthorization

RemoveAuthorization removes the authorization from the list. It should be called by the admin policy account.

```proto
message MsgRemoveAuthorization {
string creator = 1;
Expand Down
121 changes: 121 additions & 0 deletions docs/spec/crosschain/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## MsgAddOutboundTracker

AddOutboundTracker adds a new record to the outbound transaction tracker.
only the admin policy account and the observer validators are authorized to broadcast this message without proof.
If no pending cctx is found, the tracker is removed, if there is an existed tracker with the nonce & chainID.

```proto
message MsgAddOutboundTracker {
string creator = 1;
Expand All @@ -16,6 +20,8 @@ message MsgAddOutboundTracker {

## MsgAddInboundTracker

AddInboundTracker adds a new record to the inbound transaction tracker.

```proto
message MsgAddInboundTracker {
string creator = 1;
Expand All @@ -30,6 +36,10 @@ message MsgAddInboundTracker {

## MsgRemoveOutboundTracker

RemoveOutboundTracker removes a record from the outbound transaction tracker by chain ID and nonce.

Authorized: admin policy group 1.

```proto
message MsgRemoveOutboundTracker {
string creator = 1;
Expand All @@ -40,6 +50,12 @@ message MsgRemoveOutboundTracker {

## MsgVoteGasPrice

VoteGasPrice submits information about the connected chain's gas price at a specific block
height. Gas price submitted by each validator is recorded separately and a
median index is updated.

Only observer validators are authorized to broadcast this message.

```proto
message MsgVoteGasPrice {
string creator = 1;
Expand All @@ -52,6 +68,48 @@ message MsgVoteGasPrice {

## MsgVoteOutbound

VoteOutbound casts a vote on an outbound transaction observed on a connected chain (after
it has been broadcasted to and finalized on a connected chain). If this is
the first vote, a new ballot is created. When a threshold of votes is
reached, the ballot is finalized. When a ballot is finalized, the outbound
transaction is processed.

If the observation is successful, the difference between zeta burned
and minted is minted by the bank module and deposited into the module
account.

If the observation is unsuccessful, the logic depends on the previous
status.

If the previous status was `PendingOutbound`, a new revert transaction is
created. To cover the revert transaction fee, the required amount of tokens
submitted with the CCTX are swapped using a Uniswap V2 contract instance on
ZetaChain for the ZRC20 of the gas token of the receiver chain. The ZRC20
tokens are then
burned. The nonce is updated. If everything is successful, the CCTX status is
changed to `PendingRevert`.

If the previous status was `PendingRevert`, the CCTX is aborted.

```mermaid
stateDiagram-v2
state observation <<choice>>
state success_old_status <<choice>>
state fail_old_status <<choice>>
PendingOutbound --> observation: Finalize outbound
observation --> success_old_status: Observation succeeded
success_old_status --> Reverted: Old status is PendingRevert
success_old_status --> OutboundMined: Old status is PendingOutbound
observation --> fail_old_status: Observation failed
fail_old_status --> PendingRevert: Old status is PendingOutbound
fail_old_status --> Aborted: Old status is PendingRevert
PendingOutbound --> Aborted: Finalize outbound error
```

Only observer validators are authorized to broadcast this message.

```proto
message MsgVoteOutbound {
string creator = 1;
Expand All @@ -71,6 +129,48 @@ message MsgVoteOutbound {

## MsgVoteInbound

VoteInbound casts a vote on an inbound transaction observed on a connected chain. If this
is the first vote, a new ballot is created. When a threshold of votes is
reached, the ballot is finalized. When a ballot is finalized, a new CCTX is
created.

If the receiver chain is ZetaChain, `HandleEVMDeposit` is called. If the
tokens being deposited are ZETA, `MintZetaToEVMAccount` is called and the
tokens are minted to the receiver account on ZetaChain. If the tokens being
deposited are gas tokens or ERC20 of a connected chain, ZRC20's `deposit`
method is called and the tokens are deposited to the receiver account on
ZetaChain. If the message is not empty, system contract's `depositAndCall`
method is also called and an omnichain contract on ZetaChain is executed.
Omnichain contract address and arguments are passed as part of the message.
If everything is successful, the CCTX status is changed to `OutboundMined`.

If the receiver chain is a connected chain, the `FinalizeInbound` method is
called to prepare the CCTX to be processed as an outbound transaction. To
cover the outbound transaction fee, the required amount of tokens submitted
with the CCTX are swapped using a Uniswap V2 contract instance on ZetaChain
for the ZRC20 of the gas token of the receiver chain. The ZRC20 tokens are
then burned. The nonce is updated. If everything is successful, the CCTX
status is changed to `PendingOutbound`.

```mermaid
stateDiagram-v2
state evm_deposit_success <<choice>>
state finalize_inbound <<choice>>
state evm_deposit_error <<choice>>
PendingInbound --> evm_deposit_success: Receiver is ZetaChain
evm_deposit_success --> OutboundMined: EVM deposit success
evm_deposit_success --> evm_deposit_error: EVM deposit error
evm_deposit_error --> PendingRevert: Contract error
evm_deposit_error --> Aborted: Internal error, invalid chain, gas, nonce
PendingInbound --> finalize_inbound: Receiver is connected chain
finalize_inbound --> Aborted: Finalize inbound error
finalize_inbound --> PendingOutbound: Finalize inbound success
```

Only observer validators are authorized to broadcast this message.

```proto
message MsgVoteInbound {
string creator = 1;
Expand All @@ -92,6 +192,11 @@ message MsgVoteInbound {

## MsgWhitelistERC20

WhitelistERC20 deploys a new zrc20, create a foreign coin object for the ERC20
and emit a crosschain tx to whitelist the ERC20 on the external chain

Authorized: admin policy group 1.

```proto
message MsgWhitelistERC20 {
string creator = 1;
Expand All @@ -106,6 +211,8 @@ message MsgWhitelistERC20 {

## MsgUpdateTssAddress

UpdateTssAddress updates the TSS address.

```proto
message MsgUpdateTssAddress {
string creator = 1;
Expand All @@ -115,6 +222,8 @@ message MsgUpdateTssAddress {

## MsgMigrateTssFunds

MigrateTssFunds migrates the funds from the current TSS to the new TSS

```proto
message MsgMigrateTssFunds {
string creator = 1;
Expand All @@ -125,6 +234,9 @@ message MsgMigrateTssFunds {

## MsgAbortStuckCCTX

AbortStuckCCTX aborts a stuck CCTX
Authorized: admin policy group 2

```proto
message MsgAbortStuckCCTX {
string creator = 1;
Expand All @@ -134,6 +246,12 @@ message MsgAbortStuckCCTX {

## MsgRefundAbortedCCTX

RefundAbortedCCTX refunds the aborted CCTX.
It verifies if the CCTX is aborted and not refunded, and if the refund address is valid.
It refunds the amount to the refund address and sets the CCTX as refunded.
Refer to documentation for GetRefundAddress for the refund address logic.
Refer to documentation for GetAbortedAmount for the aborted amount logic.

```proto
message MsgRefundAbortedCCTX {
string creator = 1;
Expand All @@ -144,6 +262,9 @@ message MsgRefundAbortedCCTX {

## MsgUpdateRateLimiterFlags

UpdateRateLimiterFlags updates the rate limiter flags.
Authorized: admin policy operational.

```proto
message MsgUpdateRateLimiterFlags {
string creator = 1;
Expand Down
8 changes: 8 additions & 0 deletions docs/spec/emissions/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## MsgUpdateParams

UpdateParams defines a governance operation for updating the x/emissions module parameters.
The authority is hard-coded to the x/gov module account.

```proto
message MsgUpdateParams {
string authority = 1;
Expand All @@ -11,6 +14,11 @@ message MsgUpdateParams {

## MsgWithdrawEmission

WithdrawEmission allows the user to withdraw from their withdrawable emissions.
on a successful withdrawal, the amount is transferred from the undistributed rewards pool to the user's account.
if the amount to be withdrawn is greater than the available withdrawable emission, the max available amount is withdrawn.
if the pool does not have enough balance to process this request, an error is returned.

```proto
message MsgWithdrawEmission {
string creator = 1;
Expand Down
Loading

0 comments on commit b555d7e

Please sign in to comment.