Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions evm/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/yu-org/yu/core/tripod"
yu_types "github.com/yu-org/yu/core/types"

"github.com/reddio-com/reddio/config"
yuConfig "github.com/reddio-com/reddio/evm/config"
"github.com/reddio-com/reddio/evm/pending_state"
"github.com/reddio-com/reddio/metrics"
Expand Down Expand Up @@ -508,20 +507,8 @@ func (s *Solidity) executeContractCall(ctx *context.WriteContext, txReq *TxReque
// logrus.Printf("before transfer: account %s balance %d \n", sender.Address(), ethState.GetBalance(sender.Address()))

code, leftOverGas, err := vmenv.Call(sender, *txReq.Address, txReq.Input, txReq.GasLimit, uint256.MustFromBig(txReq.Value))
isPureTransferTxn := false
if IsPureTransfer(sender, txReq, ethState) {
isPureTransferTxn = true
extraTransferGas := config.GlobalConfig.ExtraBalanceGas
if extraTransferGas > txReq.GasLimit {
extraTransferGas = txReq.GasLimit
}
ethState.SubBalance(sender.Address(), uint256.NewInt(extraTransferGas*txReq.GasPrice.Uint64()), tracing.BalanceChangeTransfer)
if leftOverGas >= extraTransferGas {
leftOverGas -= extraTransferGas
} else {
leftOverGas = 0
}
}
isPureTransferTxn := IsPureTransfer(sender, txReq, ethState)
ethState.SubBalance(sender.Address(), uint256.NewInt(0), tracing.BalanceChangeUnspecified)
// logrus.Printf("after transfer: account %s balance %d \n", sender.Address(), ethState.GetBalance(sender.Address()))
if err != nil {
// byt, _ := json.Marshal(txReq)
Expand Down