Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

change photon to aphoton #476

Merged
merged 6 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/ante/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion client/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]:46656, [email protected]: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
Expand Down
1 change: 1 addition & 0 deletions docs/basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion docs/basics/gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Binary file added docs/basics/img/photon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions docs/basics/photon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
order: 4
-->

# 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}
4 changes: 2 additions & 2 deletions docs/guides/metamask.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
6 changes: 3 additions & 3 deletions docs/quickstart/testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
```
Expand All @@ -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
Expand Down Expand Up @@ -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 <mykey> -a)

# send a tx to request tokens to your account address
ethermintcli tx faucet request 100photon --from <mykey>
ethermintcli tx faucet request 100aphoton --from <mykey>

# query your balance after the request
ethermintcli q bank balances $(ethermintcli keys show <mykey> -a)
Expand Down
4 changes: 2 additions & 2 deletions docs/quickstart/validator-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<ethermint_validator> \
--chain-id=<chain_id> \
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/integration-test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ const (

// DenomDefault defines the single coin type/denomination supported in
// Ethermint.
DenomDefault = "photon"
DenomDefault = "aphoton"
)
4 changes: 2 additions & 2 deletions x/evm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)] [<data>]",
Use: "send [to_address] [amount (in aphotons)] [<data>]",
Short: "send transaction to address (call operations included)",
Args: cobra.RangeArgs(2, 3),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -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] [<amount (in photons)>]",
Use: "create [contract bytecode] [<amount (in aphotons)>]",
Short: "create contract through the evm using compiled bytecode",
Args: cobra.RangeArgs(1, 2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down