Commit b88d528a authored by hezhengjun's avatar hezhengjun

add check of bridge token address

parent 6da06fce
......@@ -267,12 +267,17 @@ func (action *evmxgoAction) mint(mint *evmxgotypes.EvmxgoMint, tx2lock *types.Tr
return nil, err
}
// evmxgo合约,只要配置了就可以铸币
configSynbol, err := loadEvmxgoMintConfig(action.db, mint.GetSymbol())
if err != nil || configSynbol == nil {
configSymbol, err := loadEvmxgoMintConfig(action.db, mint.GetSymbol())
if err != nil || configSymbol == nil {
elog.Error("evmxgo mint ", "not config symbol", mint.GetSymbol(), "error", err)
return nil, evmxgotypes.ErrEvmxgoSymbolNotAllowedMint
}
if mint.BridgeToken != configSymbol.Address {
elog.Error("evmxgo mint ", "NotCorrectBridgeTokenAddress with address by manager", configSymbol.Address, "mint.BridgeToken", mint.BridgeToken)
return nil, evmxgotypes.ErrNotCorrectBridgeTokenAddress
}
evmxgodb = newEvmxgoDB(mint)
}
......
......@@ -9,4 +9,6 @@ var (
ErrEvmxgoSymbolNotAllowedMint = errors.New("ErrEvmxgoSymbolNotAllowedMint")
// ErrEvmxgoSymbolNotConfigValue error evmxgo symbol not config value
ErrEvmxgoSymbolNotConfigValue = errors.New("ErrEvmxgoSymbolNotConfigValue")
// ErrNotCorrectBridgeTokenAddress error Not Correct BridgeToken Address
ErrNotCorrectBridgeTokenAddress = errors.New("ErrNotCorrectBridgeTokenAddress")
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment