aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/import_tx.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-20 17:52:33 -0400
committerDeterminant <[email protected]>2020-09-20 17:52:33 -0400
commitc2bdebdce042b3c07888e2066d39b19ad3a9bbc0 (patch)
tree25706a5cca63d481e70a60d9799705e7997e43a3 /plugin/evm/import_tx.go
parente86ccf90bd33de6dc8694eb914b7b541aca53db6 (diff)
do not multiply the non AVAX asset by 10^9v0.3.3-rc.4
Diffstat (limited to 'plugin/evm/import_tx.go')
-rw-r--r--plugin/evm/import_tx.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/evm/import_tx.go b/plugin/evm/import_tx.go
index 261e68f..381d114 100644
--- a/plugin/evm/import_tx.go
+++ b/plugin/evm/import_tx.go
@@ -272,11 +272,12 @@ func (vm *VM) newImportTx(
func (tx *UnsignedImportTx) EVMStateTransfer(vm *VM, state *state.StateDB) error {
for _, to := range tx.Outs {
log.Info("crosschain X->C", "addr", to.Address, "amount", to.Amount)
- amount := new(big.Int).Mul(
- new(big.Int).SetUint64(to.Amount), x2cRate)
if to.AssetID.Equals(vm.ctx.AVAXAssetID) {
+ amount := new(big.Int).Mul(
+ new(big.Int).SetUint64(to.Amount), x2cRate)
state.AddBalance(to.Address, amount)
} else {
+ amount := new(big.Int).SetUint64(to.Amount)
state.AddBalanceMultiCoin(to.Address, to.AssetID.Key(), amount)
}
}