Skip to content

Commit

Permalink
fix value for Delegate call
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyaniarun1993 committed Jan 11, 2024
1 parent 306266f commit 61c3eae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ func (evm *EVM) call(typ OpCode, caller ContractRef, addr libcommon.Address, inp
v := value
if typ == STATICCALL {
v = nil
} else if typ == DELEGATECALL {
// NOTE: caller must, at all times be a contract. It should never happen
// that caller is something other than a Contract.
parent := caller.(*Contract)
// DELEGATECALL inherits value from parent call
v = parent.value
}
evm.captureBegin(depth == 0, typ, caller.Address(), addr, isPrecompile, input, gas, v, code)
defer func(startGas uint64) {
Expand Down

0 comments on commit 61c3eae

Please sign in to comment.