diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 17a7ac193e..f9f7a83557 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -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, "=") diff --git a/miner/celo_defaults.go b/miner/celo_defaults.go new file mode 100644 index 0000000000..861209042b --- /dev/null +++ b/miner/celo_defaults.go @@ -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, + }, +}