26 #include <boost/optional.hpp> 128 h256 const& _blockHash,
130 h256 const& _transactionHash,
131 unsigned _transactionIndex,
136 blockHash(_blockHash),
137 blockNumber(_blockNumber),
138 transactionHash(_transactionHash),
139 transactionIndex(_transactionIndex),
148 unsigned transactionIndex = 0;
149 unsigned logIndex = 0;
152 bool isSpecial =
false;
161 for (
auto const& l: _logs)
212 m_number(_current.number()),
213 m_author(_current.author()),
214 m_timestamp(_current.timestamp()),
215 m_difficulty(_current.difficulty()),
219 m_gasLimit(_current.gasLimit().convert_to<int64_t>()),
225 m_number(_current.number()),
226 m_author(_current.author()),
227 m_timestamp(_current.timestamp()),
228 m_difficulty(_current.difficulty()),
232 m_gasLimit(_current.gasLimit().convert_to<int64_t>()),
304 virtual boost::optional<owning_bytes_ref> call(
CallParameters&) = 0;
310 h256 blockHash(
u256 _number) {
return _number < envInfo().number() && _number >= (std::max<u256>(256, envInfo().number()) - 256) ? envInfo().lastHashes()[(unsigned)(envInfo().number() - 1 - _number)] :
h256(); }
LastHashes const & lastHashes() const
virtual bytes const & codeAt(Address)
Read address's code.
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
#define function(a, b, c, d, k, s)
SubState & operator+=(SubState const &_s)
A modifiable reference to an existing object or vector in memory.
u256 const & timestamp() const
LocalisedLogEntry(LogEntry const &_le, h256 const &_blockHash, BlockNumber _blockNumber, h256 const &_transactionHash, unsigned _transactionIndex, unsigned _logIndex, BlockPolarity _polarity=BlockPolarity::Unknown)
std::vector< T > toVector(int _flags=LaissezFaire) const
boost::multiprecision::number< boost::multiprecision::cpp_int_backend<>> bigint
virtual size_t codeSizeAt(Address)
u256 value
Value (in Wei) that was passed to this address.
owning_bytes_ref(bytes &&_bytes, size_t _begin, size_t _size)
h160 Address
An Ethereum address: 20 bytes.
Address const & author() const
EnvInfo const & envInfo() const
Get the execution environment information.
std::hash for asio::adress
u256 const & gasUsed() const
void setGasLimit(int64_t _v)
h256 codeHash
SHA3 hash of the executing code.
u256 const & number() const
FixedHash & shiftBloom(FixedHash< M > const &_h)
LocalisedLogEntry(LogEntry const &_le, h256 _special)
virtual h160 create(u256, u256 &, bytesConstRef, OnOpFunc const &)
Create a new (contract) account.
std::vector< LocalisedLogEntry > LocalisedLogEntries
u256 refunds
Refund counter of SSTORE nonzero->zero.
void retarget(byte const *_d, size_t _s)
owning_bytes_ref()=default
LogEntry(Address const &_address, h256s const &_ts, bytes &&_d)
std::vector< h256 > LastHashes
Address caller
Address which sent the message (either equal to origin or a contract).
virtual bool exists(Address)
Does the account exist?
EnvInfo const & m_envInfo
h256 blockHash(u256 _number)
Hash of a block if within the last 256 blocks, or h256() otherwise.
void setLastHashes(LastHashes &&_lh)
void setTimestamp(u256 const &_v)
std::vector< byte > bytes
std::vector< unsigned char > toBytes() const
std::function< void(uint64_t, uint64_t, Instruction, bigint, bigint, bigint, VM *, ExtVMFace const *)> OnOpFunc
RLPStream & appendList(size_t _items)
Appends a list.
u256 const & difficulty() const
void setNumber(u256 const &_v)
void streamRLP(RLPStream &_s) const
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
Instruction
Virtual machine bytecode instruction.
EnvInfo(BlockHeader const &_current, LastHashes &&_lh, u256 const &_gasUsed=u256())
virtual void setStore(u256, u256)
Write a value in storage.
u256 gasPrice
Price of gas (that we already paid).
std::set< Address > suicides
Any accounts that have suicided.
Interface and null implementation of the class for specifying VM externalities.
bytes code
Current code that is executing.
Address myAddress
Address associated with executing code (a contract, or contract-to-be).
byte const * data() const
Address origin
Original transactor.
Reference to a slice of buffer that also owns the buffer.
virtual EVMSchedule const & evmSchedule() const
Return the EVM gas-price schedule for this execution context.
LocalisedLogEntry(LogEntry const &_le)
owning_bytes_ref & operator=(owning_bytes_ref const &)=delete
bool sha3(bytesConstRef _input, bytesRef o_output)
Calculate SHA3-256 hash of the given input and load it into the given output.
virtual void suicide(Address)
Suicide the associated contract and give proceeds to the given address.
EnvInfo(BlockHeader const &_current, LastHashes const &_lh=LastHashes(), u256 const &_gasUsed=u256())
void setAuthor(Address const &_v)
SubState sub
Sub-band VM state (suicides, refund counter, logs).
virtual void log(h256s &&_topics, bytesConstRef _data)
Revert any changes made (by any of the other calls).
virtual u256 balance(Address)
Read address's balance.
struct evm_uint160be address(struct evm_env *env)
bytesConstRef data
Current input data.
void setDifficulty(u256 const &_v)
virtual u256 store(u256)
Read storage location.
std::vector< h256 > h256s
Class for writing to an RLP bytestream.
Class for interpreting Recursive Linear-Prefix Data.
bytes toBytes(int _flags=LaissezFaire) const
Converts to bytearray.
std::vector< LogEntry > LogEntries
LogBloom bloom(LogEntries const &_logs)