Skip to content

Commit

Permalink
Added default configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Rodygin committed Nov 2, 2023
1 parent 287af1c commit b2430f7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1446,9 +1446,15 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {

cfg.FeeCurrencyDefault = ctx.GlobalFloat64(CeloFeeCurrencyDefault.Name)

defaultLimits, ok := miner.DefaultFeeCurrencyLimits[getNetworkId(ctx)]
if !ok {
defaultLimits = make(map[common.Address]float64)
}

cfg.FeeCurrencyLimits = defaultLimits

if ctx.GlobalIsSet(CeloFeeCurrencyLimits.Name) {
feeCurrencyLimits := ctx.GlobalString(CeloFeeCurrencyLimits.Name)
cfg.FeeCurrencyLimits = make(map[common.Address]float64)

for _, entry := range strings.Split(feeCurrencyLimits, ",") {
parts := strings.Split(entry, "=")
Expand Down
20 changes: 20 additions & 0 deletions miner/celo_defaults.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package miner

import (
"github.com/celo-org/celo-blockchain/common"
"github.com/celo-org/celo-blockchain/params"
)

// cStables addresses on mainnet
var cUSD_TOKEN = common.HexToAddress("0x765DE816845861e75A25fCA122bb6898B8B1282a")
var cEUR_TOKEN = common.HexToAddress("0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73")
var cREAL_TOKEN = common.HexToAddress("0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787")

// default limits configuration
var DefaultFeeCurrencyLimits = map[uint64]map[common.Address]float64{
params.MainnetNetworkId: {
cUSD_TOKEN: 0.9,
cEUR_TOKEN: 0.5,
cREAL_TOKEN: 0.1,
},
}

0 comments on commit b2430f7

Please sign in to comment.