-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into chore-improve-fungible-module-coverage
- Loading branch information
Showing
16 changed files
with
341 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
docs/cli/zetacored/zetacored_tx_crosschain_whitelist-erc20.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# tx crosschain whitelist-erc20 | ||
|
||
Add a new erc20 token to whitelist | ||
|
||
``` | ||
zetacored tx crosschain whitelist-erc20 [erc20Address] [chainID] [name] [symbol] [decimals] [gasLimit] [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-a, --account-number uint The account number of the signing account (offline mode only) | ||
--aux Generate aux signer data instead of sending a tx | ||
-b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) | ||
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) | ||
--fee-granter string Fee granter grants fees for the transaction | ||
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer | ||
--fees string Fees to pay along with transaction; eg: 10uatom | ||
--from string Name or address of private key with which to sign | ||
--gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) | ||
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) | ||
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) | ||
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) | ||
-h, --help help for whitelist-erc20 | ||
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) | ||
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used | ||
--ledger Use a connected Ledger device | ||
--node string [host]:[port] to tendermint rpc interface for this chain | ||
--note string Note to add a description to the transaction (previously --memo) | ||
--offline Offline mode (does not allow any online functionality) | ||
-o, --output string Output format (text|json) | ||
-s, --sequence uint The sequence number of the signing account (offline mode only) | ||
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature | ||
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height | ||
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator | ||
-y, --yes Skip tx broadcasting prompt confirmation | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--chain-id string The network chain ID | ||
--home string directory for config and data | ||
--log_format string The logging format (json|plain) | ||
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) | ||
--trace print out full stack trace on errors | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
docs/cli/zetacored/zetacored_tx_fungible_update-zrc20-paused-status.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# tx fungible update-zrc20-paused-status | ||
|
||
Broadcast message UpdateZRC20PausedStatus | ||
|
||
``` | ||
zetacored tx fungible update-zrc20-paused-status [contractAddress1, contractAddress2, ...] [pausedStatus] [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
zetacored tx fungible update-zrc20-paused-status "0xece40cbB54d65282c4623f141c4a8a0bE7D6AdEc, 0xece40cbB54d65282c4623f141c4a8a0bEjgksncf" 0 | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-a, --account-number uint The account number of the signing account (offline mode only) | ||
--aux Generate aux signer data instead of sending a tx | ||
-b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) | ||
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) | ||
--fee-granter string Fee granter grants fees for the transaction | ||
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer | ||
--fees string Fees to pay along with transaction; eg: 10uatom | ||
--from string Name or address of private key with which to sign | ||
--gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) | ||
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) | ||
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) | ||
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) | ||
-h, --help help for update-zrc20-paused-status | ||
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) | ||
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used | ||
--ledger Use a connected Ledger device | ||
--node string [host]:[port] to tendermint rpc interface for this chain | ||
--note string Note to add a description to the transaction (previously --memo) | ||
--offline Offline mode (does not allow any online functionality) | ||
-o, --output string Output format (text|json) | ||
-s, --sequence uint The sequence number of the signing account (offline mode only) | ||
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature | ||
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height | ||
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator | ||
-y, --yes Skip tx broadcasting prompt confirmation | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--chain-id string The network chain ID | ||
--home string directory for config and data | ||
--log_format string The logging format (json|plain) | ||
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) | ||
--trace print out full stack trace on errors | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands | ||
|
52 changes: 52 additions & 0 deletions
52
docs/cli/zetacored/zetacored_tx_fungible_update-zrc20-withdraw-fee.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# tx fungible update-zrc20-withdraw-fee | ||
|
||
Broadcast message UpdateZRC20WithdrawFee | ||
|
||
``` | ||
zetacored tx fungible update-zrc20-withdraw-fee [contractAddress] [newWithdrawFee] [newGasLimit] [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-a, --account-number uint The account number of the signing account (offline mode only) | ||
--aux Generate aux signer data instead of sending a tx | ||
-b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) | ||
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) | ||
--fee-granter string Fee granter grants fees for the transaction | ||
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer | ||
--fees string Fees to pay along with transaction; eg: 10uatom | ||
--from string Name or address of private key with which to sign | ||
--gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) | ||
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) | ||
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) | ||
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) | ||
-h, --help help for update-zrc20-withdraw-fee | ||
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) | ||
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used | ||
--ledger Use a connected Ledger device | ||
--node string [host]:[port] to tendermint rpc interface for this chain | ||
--note string Note to add a description to the transaction (previously --memo) | ||
--offline Offline mode (does not allow any online functionality) | ||
-o, --output string Output format (text|json) | ||
-s, --sequence uint The sequence number of the signing account (offline mode only) | ||
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature | ||
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height | ||
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator | ||
-y, --yes Skip tx broadcasting prompt confirmation | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--chain-id string The network chain ID | ||
--home string directory for config and data | ||
--log_format string The logging format (json|plain) | ||
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) | ||
--trace print out full stack trace on errors | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package cli | ||
|
||
import ( | ||
"fmt" | ||
"strconv" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/flags" | ||
"github.com/cosmos/cosmos-sdk/client/tx" | ||
"github.com/spf13/cobra" | ||
"github.com/zeta-chain/zetacore/x/crosschain/types" | ||
) | ||
|
||
func CmdWhitelistERC20() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "whitelist-erc20 [erc20Address] [chainID] [name] [symbol] [decimals] [gasLimit]", | ||
Short: "Add a new erc20 token to whitelist", | ||
Args: cobra.ExactArgs(6), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
clientCtx, err := client.GetClientTxContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
erc20Address := args[0] | ||
chainID, err := strconv.ParseInt(args[1], 10, 64) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
name := args[2] | ||
symbol := args[3] | ||
decimals, err := strconv.ParseUint(args[4], 10, 32) | ||
if err != nil { | ||
return err | ||
} | ||
if decimals > 128 { | ||
return fmt.Errorf("decimals must be less than 128") | ||
} | ||
|
||
gasLimit, err := strconv.ParseInt(args[5], 10, 64) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
msg := types.NewMsgWhitelistERC20( | ||
clientCtx.GetFromAddress().String(), | ||
erc20Address, | ||
chainID, | ||
name, | ||
symbol, | ||
// #nosec G701 always in range | ||
uint32(decimals), | ||
gasLimit, | ||
) | ||
|
||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) | ||
}, | ||
} | ||
|
||
flags.AddTxFlagsToCmd(cmd) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package cli | ||
|
||
import ( | ||
"strconv" | ||
"strings" | ||
|
||
cosmoserrors "cosmossdk.io/errors" | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/flags" | ||
"github.com/cosmos/cosmos-sdk/client/tx" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
"github.com/spf13/cobra" | ||
"github.com/zeta-chain/zetacore/x/fungible/types" | ||
) | ||
|
||
func CmdUpdateZRC20PausedStatus() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "update-zrc20-paused-status [contractAddress1, contractAddress2, ...] [pausedStatus]", | ||
Short: "Broadcast message UpdateZRC20PausedStatus", | ||
Example: `zetacored tx fungible update-zrc20-paused-status "0xece40cbB54d65282c4623f141c4a8a0bE7D6AdEc, 0xece40cbB54d65282c4623f141c4a8a0bEjgksncf" 0 `, | ||
Args: cobra.ExactArgs(2), | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
clientCtx, err := client.GetClientTxContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
contractAddressList := strings.Split(strings.TrimSpace(args[0]), ",") | ||
|
||
action, err := strconv.ParseUint(args[1], 10, 32) | ||
if err != nil { | ||
return err | ||
} | ||
if (action != 0) && (action != 1) { | ||
return cosmoserrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid action (%d)", action) | ||
} | ||
|
||
pausedStatus := types.UpdatePausedStatusAction_PAUSE | ||
if action == 1 { | ||
pausedStatus = types.UpdatePausedStatusAction_UNPAUSE | ||
} | ||
|
||
msg := types.NewMsgUpdateZRC20PausedStatus( | ||
clientCtx.GetFromAddress().String(), | ||
contractAddressList, | ||
pausedStatus, | ||
) | ||
|
||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) | ||
}, | ||
} | ||
|
||
flags.AddTxFlagsToCmd(cmd) | ||
|
||
return cmd | ||
} |
Oops, something went wrong.