mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
all: clean duplicate constants in package common
This commit is contained in:
parent
468babfc3e
commit
a4c7d7f458
11 changed files with 116 additions and 185 deletions
|
|
@ -170,7 +170,7 @@ func initGenesis(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
if genesis.Config.ChainId != nil {
|
||||
common.CopyConstans(genesis.Config.ChainId.Uint64())
|
||||
common.CopyConstants(genesis.Config.ChainId.Uint64())
|
||||
}
|
||||
|
||||
// Open an initialise both full and light databases
|
||||
|
|
|
|||
|
|
@ -148,24 +148,11 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
|||
if ctx.IsSet(utils.MiningEnabledFlag.Name) {
|
||||
log.Warn("The flag --mine is deprecated and will be removed")
|
||||
}
|
||||
// if !ctx.IsSet(debug.VerbosityFlag.Name) {
|
||||
// debug.Verbosity(log.Lvl(cfg.Verbosity))
|
||||
// }
|
||||
|
||||
if !ctx.IsSet(utils.NATFlag.Name) && cfg.NAT != "" {
|
||||
ctx.Set(utils.NATFlag.Name, cfg.NAT)
|
||||
}
|
||||
|
||||
// Check testnet is enable.
|
||||
if ctx.Bool(utils.TestnetFlag.Name) {
|
||||
common.IsTestnet = true
|
||||
common.TRC21IssuerSMC = common.TRC21IssuerSMCTestNet
|
||||
cfg.Eth.NetworkId = 51
|
||||
common.RelayerRegistrationSMC = common.RelayerRegistrationSMCTestnet
|
||||
common.TIPTRC21Fee = common.TIPTRC21FeeTestnet
|
||||
common.TIPXDCXCancellationFee = common.TIPXDCXCancellationFeeTestnet
|
||||
}
|
||||
|
||||
if ctx.Bool(utils.EnableXDCPrefixFlag.Name) {
|
||||
common.Enable0xPrefix = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1393,6 +1393,21 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
|||
}
|
||||
if ctx.IsSet(NetworkIdFlag.Name) {
|
||||
cfg.NetworkId = ctx.Uint64(NetworkIdFlag.Name)
|
||||
switch cfg.NetworkId {
|
||||
case 50:
|
||||
if !ctx.IsSet(MainnetFlag.Name) {
|
||||
ctx.Set(MainnetFlag.Name, "true")
|
||||
}
|
||||
case 51:
|
||||
common.IsTestnet = true
|
||||
if !ctx.IsSet(TestnetFlag.Name) {
|
||||
ctx.Set(TestnetFlag.Name, "true")
|
||||
}
|
||||
case 551:
|
||||
if !ctx.IsSet(DevnetFlag.Name) {
|
||||
ctx.Set(DevnetFlag.Name, "true")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheDatabaseFlag.Name) {
|
||||
|
|
@ -1457,6 +1472,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
|||
}
|
||||
cfg.Genesis = core.DefaultGenesisBlock()
|
||||
case ctx.Bool(TestnetFlag.Name):
|
||||
common.IsTestnet = true
|
||||
if !ctx.IsSet(NetworkIdFlag.Name) {
|
||||
cfg.NetworkId = 51
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,13 +45,11 @@ type constant struct {
|
|||
tip2019Block *big.Int
|
||||
tipSigning *big.Int
|
||||
tipRandomize *big.Int
|
||||
tipNoHalvingMNReward *big.Int // hardfork no halving masternodes reward
|
||||
tipNoHalvingMNReward *big.Int // hard fork no halving masternodes reward
|
||||
tipXDCX *big.Int
|
||||
tipXDCXLending *big.Int
|
||||
tipXDCXCancellationFee *big.Int
|
||||
tipXDCXCancellationFeeTestnet *big.Int
|
||||
tipTRC21Fee *big.Int
|
||||
tipTRC21FeeTestnet *big.Int
|
||||
tipIncreaseMasternodes *big.Int // Upgrade MN Count at Block.
|
||||
berlinBlock *big.Int
|
||||
londonBlock *big.Int
|
||||
|
|
@ -66,22 +64,17 @@ type constant struct {
|
|||
eip1559Block *big.Int
|
||||
cancunBlock *big.Int
|
||||
|
||||
trc21IssuerSMCTestNet Address
|
||||
trc21IssuerSMC Address
|
||||
xdcxListingSMC Address
|
||||
xdcxListingSMCTestNet Address
|
||||
|
||||
relayerRegistrationSMC Address
|
||||
relayerRegistrationSMCTestnet Address
|
||||
lendingRegistrationSMC Address
|
||||
lendingRegistrationSMCTestnet Address
|
||||
trc21IssuerSMC Address
|
||||
xdcxListingSMC Address
|
||||
relayerRegistrationSMC Address
|
||||
lendingRegistrationSMC Address
|
||||
|
||||
ignoreSignerCheckBlockArray map[uint64]struct{}
|
||||
|
||||
blacklist map[Address]struct{}
|
||||
}
|
||||
|
||||
// variables for specific networks, copy values from MaintnetConstant to pass tests
|
||||
// variables for specific networks, copy values from maintnet constant to pass tests
|
||||
var (
|
||||
BlackListHFNumber = MaintnetConstant.blackListHFNumber
|
||||
MaxMasternodesV2 = MaintnetConstant.maxMasternodesV2 // Last v1 masternodes
|
||||
|
|
@ -93,9 +86,7 @@ var (
|
|||
TIPXDCX = MaintnetConstant.tipXDCX
|
||||
TIPXDCXLending = MaintnetConstant.tipXDCXLending
|
||||
TIPXDCXCancellationFee = MaintnetConstant.tipXDCXCancellationFee
|
||||
TIPXDCXCancellationFeeTestnet = MaintnetConstant.tipXDCXCancellationFeeTestnet
|
||||
TIPTRC21Fee = MaintnetConstant.tipTRC21Fee
|
||||
TIPTRC21FeeTestnet = MaintnetConstant.tipTRC21FeeTestnet
|
||||
TIPIncreaseMasternodes = MaintnetConstant.tipIncreaseMasternodes
|
||||
BerlinBlock = MaintnetConstant.berlinBlock
|
||||
LondonBlock = MaintnetConstant.londonBlock
|
||||
|
|
@ -109,15 +100,10 @@ var (
|
|||
TIPUpgradeReward = MaintnetConstant.tipUpgradeReward
|
||||
TIPEpochHalving = MaintnetConstant.tipEpochHalving
|
||||
|
||||
TRC21IssuerSMC = MaintnetConstant.trc21IssuerSMC
|
||||
TRC21IssuerSMCTestNet = MaintnetConstant.trc21IssuerSMCTestNet
|
||||
XDCXListingSMC = MaintnetConstant.xdcxListingSMC
|
||||
XDCXListingSMCTestNet = MaintnetConstant.xdcxListingSMCTestNet
|
||||
|
||||
RelayerRegistrationSMC = MaintnetConstant.relayerRegistrationSMC
|
||||
RelayerRegistrationSMCTestnet = MaintnetConstant.relayerRegistrationSMCTestnet
|
||||
LendingRegistrationSMC = MaintnetConstant.lendingRegistrationSMC
|
||||
LendingRegistrationSMCTestnet = MaintnetConstant.lendingRegistrationSMCTestnet
|
||||
TRC21IssuerSMC = MaintnetConstant.trc21IssuerSMC
|
||||
XDCXListingSMC = MaintnetConstant.xdcxListingSMC
|
||||
RelayerRegistrationSMC = MaintnetConstant.relayerRegistrationSMC
|
||||
LendingRegistrationSMC = MaintnetConstant.lendingRegistrationSMC
|
||||
|
||||
ignoreSignerCheckBlockArray = MaintnetConstant.ignoreSignerCheckBlockArray
|
||||
blacklist = MaintnetConstant.blacklist
|
||||
|
|
@ -136,9 +122,9 @@ func IsInBlacklist(address *Address) bool {
|
|||
return ok
|
||||
}
|
||||
|
||||
// CopyConstans only handles testnet, devnet, local. It does not
|
||||
// handles mainnet since the default value is from mainnet.
|
||||
func CopyConstans(chainID uint64) {
|
||||
// CopyConstants only handles testnet, devnet, local network.
|
||||
// It skips mainnet since the default value is from mainnet.
|
||||
func CopyConstants(chainID uint64) {
|
||||
var c *constant
|
||||
if chainID == TestnetConstant.chainID {
|
||||
c = &TestnetConstant
|
||||
|
|
@ -160,9 +146,7 @@ func CopyConstans(chainID uint64) {
|
|||
TIPXDCX = c.tipXDCX
|
||||
TIPXDCXLending = c.tipXDCXLending
|
||||
TIPXDCXCancellationFee = c.tipXDCXCancellationFee
|
||||
TIPXDCXCancellationFeeTestnet = c.tipXDCXCancellationFeeTestnet
|
||||
TIPTRC21Fee = c.tipTRC21Fee
|
||||
TIPTRC21FeeTestnet = c.tipTRC21FeeTestnet
|
||||
TIPIncreaseMasternodes = c.tipIncreaseMasternodes
|
||||
BerlinBlock = c.berlinBlock
|
||||
LondonBlock = c.londonBlock
|
||||
|
|
@ -177,14 +161,9 @@ func CopyConstans(chainID uint64) {
|
|||
TIPEpochHalving = c.tipEpochHalving
|
||||
|
||||
TRC21IssuerSMC = c.trc21IssuerSMC
|
||||
TRC21IssuerSMCTestNet = c.trc21IssuerSMCTestNet
|
||||
XDCXListingSMC = c.xdcxListingSMC
|
||||
XDCXListingSMCTestNet = c.xdcxListingSMCTestNet
|
||||
|
||||
RelayerRegistrationSMC = c.relayerRegistrationSMC
|
||||
RelayerRegistrationSMCTestnet = c.relayerRegistrationSMCTestnet
|
||||
LendingRegistrationSMC = c.lendingRegistrationSMC
|
||||
LendingRegistrationSMCTestnet = c.lendingRegistrationSMCTestnet
|
||||
|
||||
clear(ignoreSignerCheckBlockArray)
|
||||
maps.Copy(ignoreSignerCheckBlockArray, c.ignoreSignerCheckBlockArray)
|
||||
|
|
|
|||
|
|
@ -9,39 +9,32 @@ var DevnetConstant = constant{
|
|||
blackListHFNumber: 0,
|
||||
maxMasternodesV2: 108,
|
||||
|
||||
tip2019Block: big.NewInt(0),
|
||||
tipSigning: big.NewInt(0),
|
||||
tipRandomize: big.NewInt(0),
|
||||
tipNoHalvingMNReward: big.NewInt(0),
|
||||
tipXDCX: big.NewInt(0),
|
||||
tipXDCXLending: big.NewInt(0),
|
||||
tipXDCXCancellationFee: big.NewInt(0),
|
||||
tipXDCXCancellationFeeTestnet: big.NewInt(0),
|
||||
tipTRC21Fee: big.NewInt(13523400),
|
||||
tipTRC21FeeTestnet: big.NewInt(225000),
|
||||
tipIncreaseMasternodes: big.NewInt(0),
|
||||
berlinBlock: big.NewInt(0),
|
||||
londonBlock: big.NewInt(0),
|
||||
mergeBlock: big.NewInt(0),
|
||||
shanghaiBlock: big.NewInt(0),
|
||||
blockNumberGas50x: big.NewInt(0),
|
||||
TIPV2SwitchBlock: big.NewInt(0),
|
||||
tipXDCXMinerDisable: big.NewInt(0),
|
||||
tipXDCXReceiverDisable: big.NewInt(0),
|
||||
eip1559Block: big.NewInt(0),
|
||||
cancunBlock: big.NewInt(1702800),
|
||||
tipUpgradeReward: big.NewInt(1773000),
|
||||
tipEpochHalving: big.NewInt(9999999999),
|
||||
tip2019Block: big.NewInt(0),
|
||||
tipSigning: big.NewInt(0),
|
||||
tipRandomize: big.NewInt(0),
|
||||
tipNoHalvingMNReward: big.NewInt(0),
|
||||
tipXDCX: big.NewInt(0),
|
||||
tipXDCXLending: big.NewInt(0),
|
||||
tipXDCXCancellationFee: big.NewInt(0),
|
||||
tipTRC21Fee: big.NewInt(13523400),
|
||||
tipIncreaseMasternodes: big.NewInt(0),
|
||||
berlinBlock: big.NewInt(0),
|
||||
londonBlock: big.NewInt(0),
|
||||
mergeBlock: big.NewInt(0),
|
||||
shanghaiBlock: big.NewInt(0),
|
||||
blockNumberGas50x: big.NewInt(0),
|
||||
TIPV2SwitchBlock: big.NewInt(0),
|
||||
tipXDCXMinerDisable: big.NewInt(0),
|
||||
tipXDCXReceiverDisable: big.NewInt(0),
|
||||
eip1559Block: big.NewInt(0),
|
||||
cancunBlock: big.NewInt(1702800),
|
||||
tipUpgradeReward: big.NewInt(1773000),
|
||||
tipEpochHalving: big.NewInt(9999999999),
|
||||
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"),
|
||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||
xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"),
|
||||
|
||||
relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"),
|
||||
relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"),
|
||||
lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"),
|
||||
lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"),
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||
relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"),
|
||||
lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"),
|
||||
|
||||
ignoreSignerCheckBlockArray: map[uint64]struct{}{
|
||||
1032300: {},
|
||||
|
|
|
|||
|
|
@ -9,39 +9,32 @@ var localConstant = constant{
|
|||
maxMasternodesV2: 108,
|
||||
blackListHFNumber: 0,
|
||||
|
||||
tip2019Block: big.NewInt(0),
|
||||
tipSigning: big.NewInt(0),
|
||||
tipRandomize: big.NewInt(0),
|
||||
tipNoHalvingMNReward: big.NewInt(0),
|
||||
tipXDCX: big.NewInt(0),
|
||||
tipXDCXLending: big.NewInt(0),
|
||||
tipXDCXCancellationFee: big.NewInt(0),
|
||||
tipXDCXCancellationFeeTestnet: big.NewInt(0),
|
||||
tipTRC21Fee: big.NewInt(13523400),
|
||||
tipTRC21FeeTestnet: big.NewInt(225000),
|
||||
tipIncreaseMasternodes: big.NewInt(0),
|
||||
berlinBlock: big.NewInt(0),
|
||||
londonBlock: big.NewInt(0),
|
||||
mergeBlock: big.NewInt(0),
|
||||
shanghaiBlock: big.NewInt(0),
|
||||
blockNumberGas50x: big.NewInt(0),
|
||||
TIPV2SwitchBlock: big.NewInt(0),
|
||||
tipXDCXMinerDisable: big.NewInt(0),
|
||||
tipXDCXReceiverDisable: big.NewInt(0),
|
||||
eip1559Block: big.NewInt(0),
|
||||
cancunBlock: big.NewInt(0),
|
||||
tipUpgradeReward: big.NewInt(0),
|
||||
tipEpochHalving: big.NewInt(0),
|
||||
tip2019Block: big.NewInt(0),
|
||||
tipSigning: big.NewInt(0),
|
||||
tipRandomize: big.NewInt(0),
|
||||
tipNoHalvingMNReward: big.NewInt(0),
|
||||
tipXDCX: big.NewInt(0),
|
||||
tipXDCXLending: big.NewInt(0),
|
||||
tipXDCXCancellationFee: big.NewInt(0),
|
||||
tipTRC21Fee: big.NewInt(0),
|
||||
tipIncreaseMasternodes: big.NewInt(0),
|
||||
berlinBlock: big.NewInt(0),
|
||||
londonBlock: big.NewInt(0),
|
||||
mergeBlock: big.NewInt(0),
|
||||
shanghaiBlock: big.NewInt(0),
|
||||
blockNumberGas50x: big.NewInt(0),
|
||||
TIPV2SwitchBlock: big.NewInt(0),
|
||||
tipXDCXMinerDisable: big.NewInt(0),
|
||||
tipXDCXReceiverDisable: big.NewInt(0),
|
||||
eip1559Block: big.NewInt(0),
|
||||
cancunBlock: big.NewInt(0),
|
||||
tipUpgradeReward: big.NewInt(0),
|
||||
tipEpochHalving: big.NewInt(0),
|
||||
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"),
|
||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||
xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"),
|
||||
|
||||
relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"),
|
||||
relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"),
|
||||
lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"),
|
||||
lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"),
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||
relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"),
|
||||
lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"),
|
||||
|
||||
ignoreSignerCheckBlockArray: map[uint64]struct{}{},
|
||||
|
||||
|
|
|
|||
|
|
@ -9,39 +9,32 @@ var MaintnetConstant = constant{
|
|||
blackListHFNumber: 38383838,
|
||||
maxMasternodesV2: 108,
|
||||
|
||||
tip2019Block: big.NewInt(1),
|
||||
tipSigning: big.NewInt(3000000),
|
||||
tipRandomize: big.NewInt(3464000),
|
||||
tipNoHalvingMNReward: big.NewInt(38383838),
|
||||
tipXDCX: big.NewInt(38383838),
|
||||
tipXDCXLending: big.NewInt(38383838),
|
||||
tipXDCXCancellationFee: big.NewInt(38383838),
|
||||
tipXDCXCancellationFeeTestnet: big.NewInt(38383838),
|
||||
tipTRC21Fee: big.NewInt(38383838),
|
||||
tipTRC21FeeTestnet: big.NewInt(38383838),
|
||||
tipIncreaseMasternodes: big.NewInt(5000000),
|
||||
berlinBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
londonBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
mergeBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
shanghaiBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
blockNumberGas50x: big.NewInt(80370000), // Target 2nd Oct 2024
|
||||
TIPV2SwitchBlock: big.NewInt(80370000), // Target 2nd Oct 2024
|
||||
tipXDCXMinerDisable: big.NewInt(80370000), // Target 2nd Oct 2024
|
||||
tipXDCXReceiverDisable: big.NewInt(80370900), // Target 2nd Oct 2024, safer to release after disable miner
|
||||
eip1559Block: big.NewInt(9999999999),
|
||||
cancunBlock: big.NewInt(9999999999),
|
||||
tipUpgradeReward: big.NewInt(9999999999),
|
||||
tipEpochHalving: big.NewInt(9999999999),
|
||||
tip2019Block: big.NewInt(1),
|
||||
tipSigning: big.NewInt(3000000),
|
||||
tipRandomize: big.NewInt(3464000),
|
||||
tipNoHalvingMNReward: big.NewInt(38383838),
|
||||
tipXDCX: big.NewInt(38383838),
|
||||
tipXDCXLending: big.NewInt(38383838),
|
||||
tipXDCXCancellationFee: big.NewInt(38383838),
|
||||
tipTRC21Fee: big.NewInt(38383838),
|
||||
tipIncreaseMasternodes: big.NewInt(5000000),
|
||||
berlinBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
londonBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
mergeBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
shanghaiBlock: big.NewInt(76321000), // Target 19th June 2024
|
||||
blockNumberGas50x: big.NewInt(80370000), // Target 2nd Oct 2024
|
||||
TIPV2SwitchBlock: big.NewInt(80370000), // Target 2nd Oct 2024
|
||||
tipXDCXMinerDisable: big.NewInt(80370000), // Target 2nd Oct 2024
|
||||
tipXDCXReceiverDisable: big.NewInt(80370900), // Target 2nd Oct 2024, safer to release after disable miner
|
||||
eip1559Block: big.NewInt(9999999999),
|
||||
cancunBlock: big.NewInt(9999999999),
|
||||
tipUpgradeReward: big.NewInt(9999999999),
|
||||
tipEpochHalving: big.NewInt(9999999999),
|
||||
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"),
|
||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||
xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"),
|
||||
|
||||
relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"),
|
||||
relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"),
|
||||
lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"),
|
||||
lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"),
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||
relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"),
|
||||
lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"),
|
||||
|
||||
ignoreSignerCheckBlockArray: map[uint64]struct{}{
|
||||
1032300: {},
|
||||
|
|
|
|||
|
|
@ -16,9 +16,7 @@ var TestnetConstant = constant{
|
|||
tipXDCX: big.NewInt(23779191),
|
||||
tipXDCXLending: big.NewInt(23779191),
|
||||
tipXDCXCancellationFee: big.NewInt(23779191),
|
||||
tipXDCXCancellationFeeTestnet: big.NewInt(23779191),
|
||||
tipTRC21Fee: big.NewInt(23779191),
|
||||
tipTRC21FeeTestnet: big.NewInt(23779191),
|
||||
tipIncreaseMasternodes: big.NewInt(5000000),
|
||||
blockNumberGas50x: big.NewInt(56828700), // Target 13rd Nov 2023
|
||||
TIPV2SwitchBlock: big.NewInt(56828700), // Target 13rd Nov 2023
|
||||
|
|
@ -33,15 +31,10 @@ var TestnetConstant = constant{
|
|||
tipUpgradeReward: big.NewInt(9999999999),
|
||||
tipEpochHalving: big.NewInt(9999999999),
|
||||
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"),
|
||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||
xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"),
|
||||
|
||||
relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"),
|
||||
relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"),
|
||||
lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"),
|
||||
lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"),
|
||||
trc21IssuerSMC: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"),
|
||||
xdcxListingSMC: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"),
|
||||
relayerRegistrationSMC: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"),
|
||||
lendingRegistrationSMC: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"),
|
||||
|
||||
ignoreSignerCheckBlockArray: map[uint64]struct{}{
|
||||
1032300: {},
|
||||
|
|
|
|||
|
|
@ -261,17 +261,10 @@ func (api *API) NetworkInformation() NetworkInformation {
|
|||
info := NetworkInformation{}
|
||||
info.NetworkId = api.chain.Config().ChainId
|
||||
info.XDCValidatorAddress = common.MasternodeVotingSMCBinary
|
||||
if common.IsTestnet {
|
||||
info.LendingAddress = common.LendingRegistrationSMCTestnet
|
||||
info.RelayerRegistrationAddress = common.RelayerRegistrationSMCTestnet
|
||||
info.XDCXListingAddress = common.XDCXListingSMCTestNet
|
||||
info.XDCZAddress = common.TRC21IssuerSMCTestNet
|
||||
} else {
|
||||
info.LendingAddress = common.LendingRegistrationSMC
|
||||
info.RelayerRegistrationAddress = common.RelayerRegistrationSMC
|
||||
info.XDCXListingAddress = common.XDCXListingSMC
|
||||
info.XDCZAddress = common.TRC21IssuerSMC
|
||||
}
|
||||
info.LendingAddress = common.LendingRegistrationSMC
|
||||
info.RelayerRegistrationAddress = common.RelayerRegistrationSMC
|
||||
info.XDCXListingAddress = common.XDCXListingSMC
|
||||
info.XDCZAddress = common.TRC21IssuerSMC
|
||||
info.ConsensusConfigs = *api.XDPoS.config
|
||||
|
||||
return info
|
||||
|
|
|
|||
|
|
@ -547,15 +547,7 @@ func (tx *Transaction) IsVotingTransaction() (bool, *common.Address) {
|
|||
|
||||
func (tx *Transaction) IsXDCXApplyTransaction() bool {
|
||||
to := tx.To()
|
||||
if to == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
addr := common.XDCXListingSMC
|
||||
if common.IsTestnet {
|
||||
addr = common.XDCXListingSMCTestNet
|
||||
}
|
||||
if *to != addr {
|
||||
if to == nil || *to != common.XDCXListingSMC {
|
||||
return false
|
||||
}
|
||||
data := tx.Data()
|
||||
|
|
@ -570,15 +562,7 @@ func (tx *Transaction) IsXDCXApplyTransaction() bool {
|
|||
|
||||
func (tx *Transaction) IsXDCZApplyTransaction() bool {
|
||||
to := tx.To()
|
||||
if to == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
addr := common.TRC21IssuerSMC
|
||||
if common.IsTestnet {
|
||||
addr = common.TRC21IssuerSMCTestNet
|
||||
}
|
||||
if *to != addr {
|
||||
if to == nil || *to != common.TRC21IssuerSMC {
|
||||
return false
|
||||
}
|
||||
data := tx.Data()
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ func New(ctx *node.ServiceContext, config *ethconfig.Config, XDCXServ *XDCx.XDCX
|
|||
if networkID == 0 {
|
||||
networkID = chainConfig.ChainId.Uint64()
|
||||
}
|
||||
common.CopyConstans(networkID)
|
||||
common.CopyConstants(networkID)
|
||||
|
||||
log.Info(strings.Repeat("-", 153))
|
||||
for _, line := range strings.Split(chainConfig.Description(), "\n") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue