diff --git a/app/ante/eth.go b/app/ante/eth.go index d1fbb007..1688053a 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -96,7 +96,7 @@ func (emfd EthMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula minGasPrices := ctx.MinGasPrices() // check that fee provided is greater than the minimum - // NOTE: we only check if photons are present in min gas prices. It is up to the + // NOTE: we only check if aphotons are present in min gas prices. It is up to the // sender if they want to send additional fees in other denominations. var hasEnoughFees bool if fee.Amount.GTE(minGasPrices.AmountOf(emint.DenomDefault)) { diff --git a/client/testnet.go b/client/testnet.go index 387e136c..ab708b7c 100644 --- a/client/testnet.go +++ b/client/testnet.go @@ -93,7 +93,7 @@ Note, strict routability for addresses is turned off in the config file.`, cmd.Flags().String(flagNodeCLIHome, "ethermintcli", "Home directory of the node's cli configuration") cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)") cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") - cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", types.DenomDefault), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photon,0.001stake)") + cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", types.DenomDefault), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01aphoton,0.001stake)") cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") cmd.Flags().String(flagKeyAlgo, string(crypto.EthSecp256k1), "Key signing algorithm to generate keys for") return cmd diff --git a/docs/basics/README.md b/docs/basics/README.md index adf835d5..c4aa48f1 100644 --- a/docs/basics/README.md +++ b/docs/basics/README.md @@ -11,5 +11,6 @@ This repository contains reference documentation on the basic concepts of Etherm 1. [Accounts](./accounts.md) 2. [Gas and Fees](./gas.md) 3. [Lifecycle of a transaction](./transactions.md) +4. [Photon](./photon.md) After reading the basics, head on to the [Core Reference](../core/README.md) for more advanced material. diff --git a/docs/basics/gas.md b/docs/basics/gas.md index 8d49533d..db43f387 100644 --- a/docs/basics/gas.md +++ b/docs/basics/gas.md @@ -26,4 +26,4 @@ The `AnteHandler` is a special `handler` that is run for every transaction durin ## Next {hide} -Learn about the [encoding](./../core/encoding.md) formats used on Ethermint {hide} +Learn about the [Photon](./photon.md) token {hide} diff --git a/docs/basics/img/photon.png b/docs/basics/img/photon.png new file mode 100644 index 00000000..2549bd43 Binary files /dev/null and b/docs/basics/img/photon.png differ diff --git a/docs/basics/photon.md b/docs/basics/photon.md new file mode 100644 index 00000000..933849db --- /dev/null +++ b/docs/basics/photon.md @@ -0,0 +1,33 @@ + + +# Photon + +Learn about the Photon, Ethermint's staking token. {synopsis} + +## Introduction + +::: tip +The photon's initial distribution and supply is still TBD and will be announced in the future. +::: + +The photon is the staking token used in Ethermint. + +## Base Denomination + +Ethermint uses [Atto](https://en.wikipedia.org/wiki/Atto-) Photon as the base denomination to maintain parity with Ethereum. + +``` +1 photon = 1×10⁻¹⁸ aphoton +``` + +This matches Ethereum denomination of: + +``` +1 ETH = 1x10⁻¹⁸ wei +``` + +## Next {hide} + +Learn about the [encoding](./../core/encoding.md) formats used on Ethermint {hide} diff --git a/docs/guides/metamask.md b/docs/guides/metamask.md index 6c4758a7..7f00e007 100644 --- a/docs/guides/metamask.md +++ b/docs/guides/metamask.md @@ -50,7 +50,7 @@ ethermintcli keys unsafe-export-eth-key mykey Go back to the browser and select the `Private Key` option. Then paste the private key exported from the `unsafe-export-eth-key` command. -Your account balance should show up as `1 PHOTON` and do transfers as usual. +Your account balance should show up as `1 APHOTON` and do transfers as usual. ::: tip If it takes some time to load the balance of the account, change the network to `Main Ethereum @@ -63,4 +63,4 @@ to see metamask logs, go to top right circle -> settings -> advanced -> download ## Known issues -Currently, it's not possible to add custom tokens (even for Photons) unless you deploy a token contract (eg: ERC20). +Currently, it's not possible to add custom tokens (even for APhotons) unless you deploy a token contract (eg: ERC20). diff --git a/docs/quickstart/testnet.md b/docs/quickstart/testnet.md index 100c9e1c..b47d225d 100644 --- a/docs/quickstart/testnet.md +++ b/docs/quickstart/testnet.md @@ -48,7 +48,7 @@ You can edit the `$HOME/.ethermintd/config/app.toml` file in order to enable the # The minimum gas prices a validator is willing to accept for processing a # transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 10photon). +# specified in this config (e.g. 10aphoton). minimum-gas-prices = "" ``` @@ -62,7 +62,7 @@ ethermintcli keys add $KEY # Add that key into the genesis.app_state.accounts array in the genesis file # NOTE: this command lets you set the number of coins. Make sure this account has some coins # with the genesis.app_state.staking.params.bond_denom denom, the default is staking -ethermintd add-genesis-account $(ethermintcli keys show validator -a) 1000000000stake,10000000000photon +ethermintd add-genesis-account $(ethermintcli keys show validator -a) 1000000000stake,10000000000aphoton # Generate the transaction that creates your validator ethermintd gentx --name $KEY @@ -319,7 +319,7 @@ Once the ethermint daemon is up and running, you can request tokens to your addr ethermintcli q bank balances $(ethermintcli keys show -a) # send a tx to request tokens to your account address -ethermintcli tx faucet request 100photon --from +ethermintcli tx faucet request 100aphoton --from # query your balance after the request ethermintcli q bank balances $(ethermintcli keys show -a) diff --git a/docs/quickstart/validator-setup.md b/docs/quickstart/validator-setup.md index fee3f93d..5aef4fd3 100644 --- a/docs/quickstart/validator-setup.md +++ b/docs/quickstart/validator-setup.md @@ -33,7 +33,7 @@ To create your validator, just use the following command: ```bash ethermintcli tx staking create-validator \ - --amount=1000000photon \ + --amount=1000000aphoton \ --pubkey=$(ethermintd tendermint show-validator) \ --moniker= \ --chain-id= \ @@ -51,7 +51,7 @@ When specifying commission parameters, the `commission-max-change-rate` is used ::: ::: tip -`Min-self-delegation` is a stritly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A `min-self-delegation` of 1 means your validator will never have a self-delegation lower than `1000000photon` +`Min-self-delegation` is a stritly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A `min-self-delegation` of 1 means your validator will never have a self-delegation lower than `1000000aphoton` ::: You can confirm that you are in the validator set by using a third party explorer. diff --git a/init.sh b/init.sh index 320f3b61..db6b22b7 100755 --- a/init.sh +++ b/init.sh @@ -24,7 +24,7 @@ ethermintcli keys add $KEY ethermintd init $MONIKER --chain-id $CHAINID # Allocate genesis accounts (cosmos formatted addresses) -ethermintd add-genesis-account $(ethermintcli keys show $KEY -a) 1000000000000000000photon,1000000000000000000stake +ethermintd add-genesis-account $(ethermintcli keys show $KEY -a) 1000000000000000000aphoton,1000000000000000000stake # Sign genesis transaction ethermintd gentx --name $KEY --keyring-backend test @@ -37,7 +37,7 @@ cat $HOME/.ethermintd/config/genesis.json | jq '.app_state["faucet"]["enable_fa echo -e '\n\ntestnet faucet enabled' echo -e 'to transfer tokens to your account address use:' -echo -e "ethermintcli tx faucet request 100photon --from $KEY\n" +echo -e "ethermintcli tx faucet request 100aphoton --from $KEY\n" # Run this to ensure everything worked and that the genesis file is setup correctly diff --git a/scripts/integration-test-all.sh b/scripts/integration-test-all.sh index c5452229..1beb4536 100755 --- a/scripts/integration-test-all.sh +++ b/scripts/integration-test-all.sh @@ -84,7 +84,7 @@ init_func() { "$PWD"/build/ethermintcli config trust-node true --home "$DATA_CLI_DIR$i" echo "prepare genesis: Allocate genesis accounts" "$PWD"/build/ethermintd add-genesis-account \ - "$("$PWD"/build/ethermintcli keys show "$KEY$i" -a --home "$DATA_CLI_DIR$i" )" 1000000000000000000photon,1000000000000000000stake \ + "$("$PWD"/build/ethermintcli keys show "$KEY$i" -a --home "$DATA_CLI_DIR$i" )" 1000000000000000000aphoton,1000000000000000000stake \ --home "$DATA_DIR$i" --home-client "$DATA_CLI_DIR$i" echo "prepare genesis: Sign genesis transaction" "$PWD"/build/ethermintd gentx --name $KEY"$i" --keyring-backend test --home "$DATA_DIR$i" --home-client "$DATA_CLI_DIR$i" diff --git a/tests/rpc_test.go b/tests/rpc_test.go index ccf1274c..5793e577 100644 --- a/tests/rpc_test.go +++ b/tests/rpc_test.go @@ -756,7 +756,7 @@ func TestEth_EstimateGas(t *testing.T) { err := json.Unmarshal(rpcRes.Result, &gas) require.NoError(t, err) - require.Equal(t, "0xffac", gas.String()) + require.Equal(t, "0xffdf", gas.String()) } func TestEth_EstimateGas_ContractDeployment(t *testing.T) { diff --git a/types/account.go b/types/account.go index 7052a24d..4f22eccd 100644 --- a/types/account.go +++ b/types/account.go @@ -56,7 +56,7 @@ func (acc EthAccount) Balance() sdk.Int { return acc.GetCoins().AmountOf(DenomDefault) } -// SetBalance sets an account's balance of photons +// SetBalance sets an account's balance of aphotons func (acc *EthAccount) SetBalance(amt sdk.Int) { coins := acc.GetCoins() diff := amt.Sub(coins.AmountOf(DenomDefault)) diff --git a/types/params.go b/types/params.go index 1e1ea76e..020452ad 100644 --- a/types/params.go +++ b/types/params.go @@ -8,5 +8,5 @@ const ( // DenomDefault defines the single coin type/denomination supported in // Ethermint. - DenomDefault = "photon" + DenomDefault = "aphoton" ) diff --git a/x/evm/client/cli/tx.go b/x/evm/client/cli/tx.go index 80355e75..84258ac6 100644 --- a/x/evm/client/cli/tx.go +++ b/x/evm/client/cli/tx.go @@ -47,7 +47,7 @@ func GetTxCmd(cdc *codec.Codec) *cobra.Command { // GetCmdSendTx generates an Ethermint transaction (excludes create operations) func GetCmdSendTx(cdc *codec.Codec) *cobra.Command { return &cobra.Command{ - Use: "send [to_address] [amount (in photons)] []", + Use: "send [to_address] [amount (in aphotons)] []", Short: "send transaction to address (call operations included)", Args: cobra.RangeArgs(2, 3), RunE: func(cmd *cobra.Command, args []string) error { @@ -104,7 +104,7 @@ func GetCmdSendTx(cdc *codec.Codec) *cobra.Command { // GetCmdGenCreateTx generates an Ethermint transaction (excludes create operations) func GetCmdGenCreateTx(cdc *codec.Codec) *cobra.Command { return &cobra.Command{ - Use: "create [contract bytecode] []", + Use: "create [contract bytecode] []", Short: "create contract through the evm using compiled bytecode", Args: cobra.RangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) error {