Commit 1406647c authored by hezhengjun's avatar hezhengjun

correct decimal when withdraw from chain33

parent 920b82f5
......@@ -514,7 +514,18 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
}
tokenAddr = common.HexToAddress(addr)
}
if ebTypes.EthNilAddr == tokenAddr.String() {
bridgeToken, _ := generated.NewBridgeToken(tokenAddr, ethRelayer.clientSpec)
opts := &bind.CallOpts{
Pending: true,
Context: context.Background(),
}
decimal, err := bridgeToken.Decimals(opts)
if err != nil {
panic(fmt.Sprintf("Can't fetch decimal from remote for symbol:%s", prophecyClaim.Symbol))
}
if decimal == 18 {
prophecyClaim.Amount = prophecyClaim.Amount.Mul(prophecyClaim.Amount, big.NewInt(int64(1e10)))
}
}
......
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