aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2018-08-14 23:30:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-14 23:30:42 +0800
commite0e0e53401e93733d921338b6d794162c40a7883 (patch)
tree99c25ef0e0a691c59aa3cfd2c85e81849a8af212 /core/vm
parent97887d98da703a31040bceee13bce9ee77fca673 (diff)
downloaddexon-e0e0e53401e93733d921338b6d794162c40a7883.tar
dexon-e0e0e53401e93733d921338b6d794162c40a7883.tar.gz
dexon-e0e0e53401e93733d921338b6d794162c40a7883.tar.bz2
dexon-e0e0e53401e93733d921338b6d794162c40a7883.tar.lz
dexon-e0e0e53401e93733d921338b6d794162c40a7883.tar.xz
dexon-e0e0e53401e93733d921338b6d794162c40a7883.tar.zst
dexon-e0e0e53401e93733d921338b6d794162c40a7883.zip
crypto: change formula for create2 (#17393)
Diffstat (limited to 'core/vm')
-rw-r--r--core/vm/evm.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/vm/evm.go b/core/vm/evm.go
index a2722537d..a24f6f386 100644
--- a/core/vm/evm.go
+++ b/core/vm/evm.go
@@ -427,7 +427,7 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
// Create2 creates a new contract using code as deployment code.
//
-// The different between Create2 with Create is Create2 uses sha3(msg.sender ++ salt ++ init_code)[12:]
+// The different between Create2 with Create is Create2 uses sha3(0xff ++ msg.sender ++ salt ++ sha3(init_code))[12:]
// instead of the usual sender-and-nonce-hash as the address where the contract is initialized at.
func (evm *EVM) Create2(caller ContractRef, code []byte, gas uint64, endowment *big.Int, salt *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) {
contractAddr = crypto.CreateAddress2(caller.Address(), common.BigToHash(salt), code)