diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 5f17bb236..298c5387b 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -723,7 +723,7 @@ bool State::call(Address _receiveAddress, Address _sendAddress, u256 _value, u25 h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas, bytesConstRef _code, bytesConstRef _init) { - Address newAddress = left160(sha3(rlpList(_sender, transactionsFrom(_sender)))); + Address newAddress = left160(sha3(rlpList(_sender, transactionsFrom(_sender) - 1))); while (isContractAddress(newAddress) || isNormalAddress(newAddress)) newAddress = (u160)newAddress + 1; @@ -735,9 +735,6 @@ h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas, ExtVM evm(*this, newAddress, _sender, _endowment, _gasPrice, bytesConstRef(), _init); bool revert = false; - // Increment associated nonce for sender. - noteSending(_sender); - try { /*auto out =*/ vm.go(evm); diff --git a/libethereum/VM.h b/libethereum/VM.h index 374d0a2c2..a011abba6 100644 --- a/libethereum/VM.h +++ b/libethereum/VM.h @@ -93,6 +93,10 @@ template eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps) unsigned newTempSize = (unsigned)m_temp.size(); switch (inst) { + case Instruction::STOP: + runGas = 0; + break; + case Instruction::SSTORE: require(2); if (!_ext.store(m_stack.back()) && m_stack[m_stack.size() - 2])