Skip to content

Commit

Permalink
fix: added NewAuthzLimiterDecorator on ante handler (#506)
Browse files Browse the repository at this point in the history
Co-authored-by: Omri <[email protected]>
  • Loading branch information
mtsitrin and omritoptix authored Jan 24, 2024
1 parent 4ace3d9 commit b38e65f
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 68 deletions.
4 changes: 2 additions & 2 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
// handle as *evmtypes.MsgEthereumTx
anteHandler = newEthAnteHandler(options)
case "/ethermint.types.v1.ExtensionOptionsWeb3Tx":
// Deprecated: Handle as normal Cosmos SDK tx, except signature is checked for Legacy EIP712 representation
anteHandler = NewLegacyCosmosAnteHandlerEip712(options)
// handle as normal Cosmos SDK tx, except signature is checked for EIP712 representation
anteHandler = newLegacyCosmosAnteHandlerEip712(options)
default:
return ctx, errorsmod.Wrapf(
errortypes.ErrUnknownExtensionOptions,
Expand Down
33 changes: 3 additions & 30 deletions app/ante/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante"

ethcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
Expand All @@ -37,7 +36,6 @@ import (
"github.com/evmos/ethermint/ethereum/eip712"
ethermint "github.com/evmos/ethermint/types"

ethante "github.com/evmos/ethermint/app/ante"
evmtypes "github.com/evmos/ethermint/x/evm/types"
)

Expand All @@ -49,33 +47,8 @@ func init() {
ethermintCodec = codec.NewProtoCodec(registry)
}

// Deprecated: NewLegacyCosmosAnteHandlerEip712 creates an AnteHandler to process legacy EIP-712
// transactions, as defined by the presence of an ExtensionOptionsWeb3Tx extension.
func NewLegacyCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
authante.NewSetUpContextDecorator(),
authante.NewValidateBasicDecorator(),
authante.NewTxTimeoutHeightDecorator(),
ethante.NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper),
authante.NewValidateMemoDecorator(options.AccountKeeper),
authante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
authante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, nil),
// SetPubKeyDecorator must be called before all signature verification decorators
authante.NewSetPubKeyDecorator(options.AccountKeeper),
authante.NewValidateSigCountDecorator(options.AccountKeeper),
authante.NewSigGasConsumeDecorator(options.AccountKeeper, ethante.DefaultSigVerificationGasConsumer),
// Note: signature verification uses EIP instead of the cosmos signature validator
NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
authante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
ethante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper),
)
}

// Deprecated: LegacyEip712SigVerificationDecorator Verify all signatures for a tx and return an error if any are invalid. Note,
// the LegacyEip712SigVerificationDecorator decorator will not get executed on ReCheck.
// NOTE: As of v0.20.0, EIP-712 signature verification is handled by the ethsecp256k1 public key (see ethsecp256k1.go)
// LegacyEip712SigVerificationDecorator Verify all signatures for a tx and return an error if any are invalid.
// Note, the LegacyEip712SigVerificationDecorator decorator will not get executed on ReCheck.
//
// CONTRACT: Pubkeys are set in context for all signers before this decorator runs
// CONTRACT: Tx must implement SigVerifiableTx interface
Expand All @@ -84,7 +57,7 @@ type LegacyEip712SigVerificationDecorator struct {
signModeHandler authsigning.SignModeHandler
}

// Deprecated: NewLegacyEip712SigVerificationDecorator creates a new LegacyEip712SigVerificationDecorator
// NewLegacyEip712SigVerificationDecorator creates a new LegacyEip712SigVerificationDecorator
func NewLegacyEip712SigVerificationDecorator(
ak evmtypes.AccountKeeper,
signModeHandler authsigning.SignModeHandler,
Expand Down
52 changes: 49 additions & 3 deletions app/ante/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@ package ante
import (
sdk "github.com/cosmos/cosmos-sdk/types"
ante "github.com/cosmos/cosmos-sdk/x/auth/ante"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante"
ethante "github.com/evmos/ethermint/app/ante"
txfeesante "github.com/osmosis-labs/osmosis/v15/x/txfees/ante"

vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
)

func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.NewEthSetUpContextDecorator(options.EvmKeeper), // outermost AnteDecorator. SetUpContext must be called first
ethante.NewEthSetUpContextDecorator(options.EvmKeeper),

//FIXME: need to allow universal fees for Eth as well
ethante.NewEthMempoolFeeDecorator(options.EvmKeeper), // Check eth effective gas price against minimal-gas-prices
ethante.NewEthMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper), // Check eth effective gas price against the global MinGasPrice

ethante.NewEthValidateBasicDecorator(options.EvmKeeper),
ethante.NewEthSigVerificationDecorator(options.EvmKeeper),
ethante.NewEthAccountVerificationDecorator(options.AccountKeeper, options.EvmKeeper),
Expand All @@ -24,22 +31,61 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler {
)
}

// newLegacyCosmosAnteHandlerEip712 creates an AnteHandler to process legacy EIP-712
// transactions, as defined by the presence of an ExtensionOptionsWeb3Tx extension.
func newLegacyCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler {
mempoolFeeDecorator := txfeesante.NewMempoolFeeDecorator(*options.TxFeesKeeper)
deductFeeDecorator := txfeesante.NewDeductFeeDecorator(*options.TxFeesKeeper, options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper)

return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
ethante.NewAuthzLimiterDecorator([]string{ // disable the Msg types that cannot be included on an authz.MsgExec msgs field
sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}),
sdk.MsgTypeURL(&vestingtypes.MsgCreateVestingAccount{}),
},
),
authante.NewSetUpContextDecorator(),
authante.NewValidateBasicDecorator(),
authante.NewTxTimeoutHeightDecorator(),

// Use Mempool Fee Decorator from our txfees module instead of default one from auth
mempoolFeeDecorator,
deductFeeDecorator,

authante.NewValidateMemoDecorator(options.AccountKeeper),
authante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
// SetPubKeyDecorator must be called before all signature verification decorators
authante.NewSetPubKeyDecorator(options.AccountKeeper),
authante.NewValidateSigCountDecorator(options.AccountKeeper),
authante.NewSigGasConsumeDecorator(options.AccountKeeper, ethante.DefaultSigVerificationGasConsumer),
// Note: signature verification uses EIP instead of the cosmos signature validator
NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
authante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
ethante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper),
)
}

func newCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
mempoolFeeDecorator := txfeesante.NewMempoolFeeDecorator(*options.TxFeesKeeper)
deductFeeDecorator := txfeesante.NewDeductFeeDecorator(*options.TxFeesKeeper, options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper)

return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
ethante.NewAuthzLimiterDecorator([]string{ // disable the Msg types that cannot be included on an authz.MsgExec msgs field
sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}),
sdk.MsgTypeURL(&vestingtypes.MsgCreateVestingAccount{}),
},
),
ante.NewSetUpContextDecorator(),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
// Use Mempool Fee Decorator from our txfees module instead of default one from auth
mempoolFeeDecorator,
deductFeeDecorator,
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
// ethante.NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper), //feemarket decorator
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
deductFeeDecorator,
ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, ethante.DefaultSigVerificationGasConsumer),
Expand Down
4 changes: 2 additions & 2 deletions app/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const (
// DisplayDenom is the denomination used to display the amount of tokens held
DisplayDenom = "dym"
// BaseDenomUnit is the base denom unit for the Hub
BaseDenom = "udym"
BaseDenom = "adym"

// BaseDenomUnit defines the base denomination unit for Photons.
// 1 DYM = 1x10^{BaseDenomUnit} udym
// 1 DYM = 1x10^{BaseDenomUnit} adym
BaseDenomUnit = 18

AccountAddressPrefix = "dym"
Expand Down
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ require (
)

replace (
// dragonberry
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0

// use dymension forks
github.com/evmos/ethermint => github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.3
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand All @@ -217,5 +214,4 @@ replace (
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
// use cometbft
github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.29

)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ github.com/cometbft/cometbft v0.34.29 h1:Q4FqMevP9du2pOgryZJHpDV2eA6jg/kMYxBj9ZT
github.com/cometbft/cometbft v0.34.29/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw=
github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=
github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0=
github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4=
github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak=
github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ=
github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q=
Expand All @@ -377,8 +379,6 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQ
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
github.com/cosmos/cosmos-sdk v0.46.15 h1:50QSEO4ZU9QUHJ8Ul9N/o/hn/IE5dL7DwL/OY1wcoMg=
github.com/cosmos/cosmos-sdk v0.46.15/go.mod h1:9MRixWsgoJ2UmVsCRRePtENFPP3cM+gTC5azEpxgllo=
github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k=
github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
Expand Down
4 changes: 2 additions & 2 deletions scripts/pools/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ create_asset_pool() {
# create pools and pool gauges
echo "====================="
echo "Creating pools"
echo "Creating udym/uatom pool 10K/10K"
echo "Creating adym/uatom pool 10K/10K"
create_asset_pool "$(dirname "$0")/nativeDenomPoolA.json"
echo "Creating udym/uusd pool 10K/10K"
echo "Creating adym/uusd pool 10K/10K"
create_asset_pool "$(dirname "$0")/nativeDenomPoolB.json"

# fund streamer
Expand Down
4 changes: 2 additions & 2 deletions scripts/pools/nativeDenomPoolA.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"weights": "5udym,5uatom",
"initial-deposit": "10000000000000000000000udym,10000000000uatom",
"weights": "5adym,5uatom",
"initial-deposit": "10000000000000000000000adym,10000000000uatom",
"swap-fee": "0.02",
"exit-fee": "0.0",
"future-governor": ""
Expand Down
4 changes: 2 additions & 2 deletions scripts/pools/nativeDenomPoolB.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"weights": "5udym,5uusd",
"initial-deposit": "10000000000000000000000udym,10000000000uusd",
"weights": "5adym,5uusd",
"initial-deposit": "10000000000000000000000adym,10000000000uusd",
"swap-fee": "0.02",
"exit-fee": "0.0",
"future-governor": ""
Expand Down
8 changes: 4 additions & 4 deletions scripts/pools/pools_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ exit_pool() {

swap_tokens() {
# dymd tx gamm swap --exact-amount-in=$1 --exact-amount-out=$2 --from pools --keyring-backend=test -b block --gas auto --yes
dymd tx gamm swap-exact-amount-in 50udym 50000000 --swap-route-pool-ids 1 --swap-route-denoms uatom --from user --keyring-backend test -b block
dymd tx gamm swap-exact-amount-in 50adym 50000000 --swap-route-pool-ids 1 --swap-route-denoms uatom --from user --keyring-backend test -b block
}

multi_hop_swap() {
dymd tx gamm swap-exact-amount-in 50000000uatom 20000000 --swap-route-pool-ids 1,2 --swap-route-denoms udym,uusd --from user --keyring-backend test -b block
dymd tx gamm swap-exact-amount-in 50000000uatom 20000000 --swap-route-pool-ids 1,2 --swap-route-denoms adym,uusd --from user --keyring-backend test -b block
}

echo "Creating pools"
echo "Creating udym/uatom pool"
echo "Creating adym/uatom pool"
create_asset_pool "$(dirname "$0")/nativeDenomPoolA.json"
echo "Creating udym/uusd pool"
echo "Creating adym/uusd pool"
create_asset_pool "$(dirname "$0")/nativeDenomPoolB.json"
10 changes: 5 additions & 5 deletions scripts/setup_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ API_ADDRESS=${API_ADDRESS:-"0.0.0.0:1318"}
JSONRPC_ADDRESS=${JSONRPC_ADDRESS:-"0.0.0.0:9545"}
JSONRPC_WS_ADDRESS=${JSONRPC_WS_ADDRESS:-"0.0.0.0:9546"}

TOKEN_AMOUNT=${TOKEN_AMOUNT:-"1000000000000000000000000udym"} #1M DYM (1e6dym = 1e6 * 1e18 = 1e24udym )
STAKING_AMOUNT=${STAKING_AMOUNT:-"670000000000000000000000udym"} #67% is staked (inflation goal)
TOKEN_AMOUNT=${TOKEN_AMOUNT:-"1000000000000000000000000adym"} #1M DYM (1e6dym = 1e6 * 1e18 = 1e24adym )
STAKING_AMOUNT=${STAKING_AMOUNT:-"670000000000000000000000adym"} #67% is staked (inflation goal)

# Validate dymension binary exists
export PATH=$PATH:$HOME/go/bin
Expand Down Expand Up @@ -73,7 +73,7 @@ sed -i'' -e "/\[json-rpc\]/,+9 s/address *= .*/address = \"$JSONRPC_WS_ADDRESS\"
sed -i'' -e '/\[api\]/,+3 s/enable *= .*/enable = true/' "$APP_CONFIG_FILE"
sed -i'' -e "/\[api\]/,+9 s/address *= .*/address = \"tcp:\/\/$API_ADDRESS\"/" "$APP_CONFIG_FILE"

sed -i'' -e 's/^minimum-gas-prices *= .*/minimum-gas-prices = "100000000udym"/' "$APP_CONFIG_FILE"
sed -i'' -e 's/^minimum-gas-prices *= .*/minimum-gas-prices = "100000000adym"/' "$APP_CONFIG_FILE"

sed -i'' -e "s/^chain-id *= .*/chain-id = \"$CHAIN_ID\"/" "$CLIENT_CONFIG_FILE"
sed -i'' -e "s/^keyring-backend *= .*/keyring-backend = \"test\"/" "$CLIENT_CONFIG_FILE"
Expand Down Expand Up @@ -102,9 +102,9 @@ if [ ! "$answer" != "${answer#[Nn]}" ] ;then
dymd keys add user --keyring-backend test

# Add genesis accounts and provide coins to the accounts
dymd add-genesis-account $(dymd keys show pools --keyring-backend test -a) 1000000000000000000000000udym,10000000000uatom,500000000000uusd
dymd add-genesis-account $(dymd keys show pools --keyring-backend test -a) 1000000000000000000000000adym,10000000000uatom,500000000000uusd
# Give some uatom to the local-user as well
dymd add-genesis-account $(dymd keys show user --keyring-backend test -a) 1000000000000000000000udym,10000000000uatom
dymd add-genesis-account $(dymd keys show user --keyring-backend test -a) 1000000000000000000000adym,10000000000uatom
fi


Expand Down
20 changes: 10 additions & 10 deletions scripts/src/genesis_config_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ tmp=$(mktemp)

set_gov_params() {
echo "setting gov params"
jq '.app_state.gov.deposit_params.min_deposit[0].denom = "udym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state.gov.deposit_params.min_deposit[0].denom = "adym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state.gov.deposit_params.min_deposit[0].amount = "10000000000"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state.gov.voting_params.voting_period = "1m"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
}

set_hub_params() {
echo "setting hub params"
sed -i'' -e 's/bond_denom": ".*"/bond_denom": "udym"/' "$GENESIS_FILE"
sed -i'' -e 's/mint_denom": ".*"/mint_denom": "udym"/' "$GENESIS_FILE"
sed -i'' -e 's/bond_denom": ".*"/bond_denom": "adym"/' "$GENESIS_FILE"
sed -i'' -e 's/mint_denom": ".*"/mint_denom": "adym"/' "$GENESIS_FILE"

jq '.app_state.rollapp.params.dispute_period_in_blocks = "2"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"

Expand All @@ -39,7 +39,7 @@ set_consenus_params() {
set_EVM_params() {
echo "setting EVM params"
jq '.app_state["feemarket"]["params"]["no_base_fee"] = true' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state.evm.params.evm_denom = "udym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state.evm.params.evm_denom = "adym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state.evm.params.enable_create = false' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
}

Expand Down Expand Up @@ -67,9 +67,9 @@ set_incentives_params() {

set_misc_params() {
echo "setting misc params"
jq '.app_state.crisis.constant_fee.denom = "udym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq -r '.app_state.gamm.params.pool_creation_fee[0].denom = "udym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state["txfees"]["basedenom"] = "udym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state.crisis.constant_fee.denom = "adym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq -r '.app_state.gamm.params.pool_creation_fee[0].denom = "adym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state["txfees"]["basedenom"] = "adym"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
jq '.app_state["txfees"]["params"]["epoch_identifier"] = "minute"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"

jq -r '.app_state.gamm.params.enable_global_pool_fees = true' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE"
Expand All @@ -79,11 +79,11 @@ set_bank_denom_metadata() {
echo "setting bank denom params"
jq '.app_state.bank.denom_metadata = [
{
"base": "udym",
"base": "adym",
"denom_units": [
{
"aliases": [],
"denom": "udym",
"denom": "adym",
"exponent": 0
},
{
Expand All @@ -92,7 +92,7 @@ set_bank_denom_metadata() {
"exponent": 18
}
],
"description": "Denom metadata for DYM (udym)",
"description": "Denom metadata for DYM (adym)",
"display": "DYM",
"name": "DYM",
"symbol": "DYM"
Expand Down

0 comments on commit b38e65f

Please sign in to comment.