Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unify denom as BNB
Browse files Browse the repository at this point in the history
Keefe Liu committed Feb 16, 2023
1 parent 92a4481 commit 7158ecc
Showing 6 changed files with 17 additions and 14 deletions.
3 changes: 3 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package app
import (
"fmt"
"io"
"math/big"
"net/http"
"os"
"path/filepath"
@@ -185,6 +186,8 @@ func init() {
}

DefaultNodeHome = filepath.Join(userHomeDir, "."+ShortName)

sdk.DefaultPowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil))
}

// App extends an ABCI application, but with most of its parameters exported.
12 changes: 6 additions & 6 deletions deployment/localup/.env
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## BASIC CONFIG
CHAIN_ID=greenfield_9000-121
STAKING_BOND_DENOM=bnb
BASIC_DENOM=bnb
STAKING_BOND_AMOUNT=10000000000
STAKING_BOND_DENOM=BNB
BASIC_DENOM=BNB
STAKING_BOND_AMOUNT=10000000000000000000000000
SNAPSHOT_INTERVAL=10
SNAPSHOT_KEEP_RECENT=0
KPASS=12345678
GENESIS_ACCOUNT_BALANCE=100000000000
GENESIS_ACCOUNT_BALANCE=100000000000000000000000000
COMMISSION_MAX_CHANGE_RATE=0.01
COMMISSION_MAX_RATE=1.0
COMMISSION_RATE=0.07
NATIVE_COIN_DESC='{"description":"The native staking token of the Greenfield.","denom_units":[{"denom":"weibnb","exponent":0,"aliases":["ether"]},{"denom":"gweibnb","exponent":9,"aliases":["gwei"]},{"denom":"bnb","exponent":18 }],"base":"wei","display":"bnb"}'
NATIVE_COIN_DESC='{"description":"The native staking token of the Greenfield.","denom_units":[{"denom":"BNB","exponent":0,"aliases":["wei"]}],"base":"BNB","display":"BNB"}'
DEPOSIT_VOTE_PERIOD=300s
MIN_DEPOSIT_AMOUNT=100
GOV_MIN_DEPOSIT_AMOUNT=1000000000000000000

## CROSS CHAIN
SRC_CHAIN_ID=18
6 changes: 3 additions & 3 deletions deployment/localup/create_sp.json
Original file line number Diff line number Diff line change
@@ -15,13 +15,13 @@
"approval_address": "0x78FeF615b06251ecfA9Ba01B7DB2BFA892722dDC",
"endpoint": "sp0.greenfield.io",
"deposit":{
"denom":"bnb",
"amount":"10000"
"denom":"BNB",
"amount":"10000000000000000000000"
},
"creator":"0x7b5Fe22B5446f7C62Ea27B8BD71CeF94e03f3dF2"
}
],
"metadata": "4pIMOgIGx1vZGU=",
"deposit": "1bnb"
"deposit": "1000000000000000000BNB"
}

3 changes: 1 addition & 2 deletions deployment/localup/localup.sh
Original file line number Diff line number Diff line change
@@ -133,8 +133,7 @@ function generate_genesis() {
sed -i -e "s/\"reserve_time\": \"15552000\"/\"reserve_time\": \"600\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/\"forced_settle_time\": \"86400\"/\"forced_settle_time\": \"100\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/172800s/${DEPOSIT_VOTE_PERIOD}/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/\"10000000\"/\"${MIN_DEPOSIT_AMOUNT}\"/g" ${workspace}/.local/validator${i}/config/genesis.json

sed -i -e "s/\"10000000\"/\"${GOV_MIN_DEPOSIT_AMOUNT}\"/g" ${workspace}/.local/validator${i}/config/genesis.json
done

# enable swagger API for validator0
2 changes: 1 addition & 1 deletion x/payment/types/params.go
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ var (
DefaultForcedSettleTime uint64 = 24 * 60 * 60 // 1 day
DefaultPaymentAccountCountLimit uint64 = 200
DefaultMaxAutoForceSettleNum uint64 = 100
DefaultFeeDenom string = "bnb"
DefaultFeeDenom string = "BNB"
)

// ParamKeyTable the param key table for launch module
5 changes: 3 additions & 2 deletions x/sp/types/params.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package types
import (
"errors"
fmt "fmt"
"math/big"
"strings"

"cosmossdk.io/math"
@@ -16,11 +17,11 @@ const (
// Default maximum number of SP
DefaultMaxStorageProviders uint32 = 100
// Dafault deposit denom
DefaultDepositDenom = "bnb"
DefaultDepositDenom = "BNB"
)

// DefaultMinDeposit defines the minimum deposit amount for all storage provider
var DefaulMinDeposit math.Int = math.NewInt(10000)
var DefaulMinDeposit = math.NewIntFromBigInt(new(big.Int).Mul(big.NewInt(10000), big.NewInt(1e18)))

var (
KeyMaxStorageProviders = []byte("MaxStorageProviders")

0 comments on commit 7158ecc

Please sign in to comment.