Last active
March 12, 2019 21:06
-
-
Save trung/dbbb8c90d397e2d439378cbfe4411149 to your computer and use it in GitHub Desktop.
CodeCopy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func opCodeCopy(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { | |
var ( | |
memOffset = stack.pop() | |
codeOffset = stack.pop() | |
length = stack.pop() | |
) | |
codeCopy := getDataBig(contract.Code, codeOffset, length) | |
memory.Set(memOffset.Uint64(), length.Uint64(), codeCopy) | |
+ if length.Cmp(big.NewInt(32)) == 0 { | |
+ address := common.BytesToAddress(codeCopy) | |
+ if evm.StateDB.Exist(address) { | |
+ log.Info("Found affected contract", "address", address.Hex()) | |
+ } | |
+ } | |
evm.interpreter.intPool.put(memOffset, codeOffset, length) | |
return nil, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment