Browse Source

Merge branch 'develop' into crypto

Conflicts:
	test/crypto.cpp
cl-refactor
subtly 10 years ago
parent
commit
0ce945accd
  1. 4
      alethzero/MainWin.cpp
  2. 2
      libdevcore/Common.cpp
  3. 4
      libethcore/CommonEth.cpp
  4. 9
      libethereum/Executive.cpp
  5. 34
      libethereum/State.cpp
  6. 10
      libethereum/Transaction.cpp
  7. 96
      libethereum/Transaction.h
  8. 14
      libserpent/bignum.cpp
  9. 12
      libserpent/bignum.h
  10. 212
      libserpent/compiler.cpp
  11. 102
      libserpent/opcodes.h
  12. 53
      libserpent/parser.cpp
  13. 870
      libserpent/rewriter.cpp
  14. 2
      libserpent/tokenize.cpp
  15. 22
      libserpent/util.cpp
  16. 6
      libserpent/util.h
  17. 22
      test/crypto.cpp
  18. 9
      test/vm.cpp
  19. 226
      test/vmArithmeticTestFiller.json
  20. 354
      test/vmBitwiseLogicOperationTestFiller.json
  21. 80
      test/vmIOandFlowOperationsTestFiller.json
  22. 134
      test/vmPushDupSwapTestFiller.json
  23. 59
      test/vmSha3TestFiller.json

4
alethzero/MainWin.cpp

@ -946,7 +946,7 @@ static bool blockMatch(string const& _f, dev::eth::BlockDetails const& _b, h256
static bool transactionMatch(string const& _f, Transaction const& _t) static bool transactionMatch(string const& _f, Transaction const& _t)
{ {
string info = toHex(_t.receiveAddress().ref()) + " " + toHex(_t.sha3(true).ref()) + " " + toHex(_t.sha3(false).ref()) + " " + toHex(_t.sender().ref()); string info = toHex(_t.receiveAddress().ref()) + " " + toHex(_t.sha3().ref()) + " " + toHex(_t.sha3(eth::WithoutSignature).ref()) + " " + toHex(_t.sender().ref());
if (info.find(_f) != string::npos) if (info.find(_f) != string::npos)
return true; return true;
return false; return false;
@ -1266,7 +1266,7 @@ void Main::on_blocks_currentItemChanged()
s << "<br/>V: <b>" << hex << nouppercase << (int)tx.signature().v << "</b>"; s << "<br/>V: <b>" << hex << nouppercase << (int)tx.signature().v << "</b>";
s << "<br/>R: <b>" << hex << nouppercase << tx.signature().r << "</b>"; s << "<br/>R: <b>" << hex << nouppercase << tx.signature().r << "</b>";
s << "<br/>S: <b>" << hex << nouppercase << tx.signature().s << "</b>"; s << "<br/>S: <b>" << hex << nouppercase << tx.signature().s << "</b>";
s << "<br/>Msg: <b>" << tx.sha3(false) << "</b>"; s << "<br/>Msg: <b>" << tx.sha3(eth::WithoutSignature) << "</b>";
if (tx.isCreation()) if (tx.isCreation())
{ {
if (tx.data().size()) if (tx.data().size())

2
libdevcore/Common.cpp

@ -27,7 +27,7 @@ using namespace dev;
namespace dev namespace dev
{ {
char const* Version = "0.7.8"; char const* Version = "0.7.9";
} }

4
libethcore/CommonEth.cpp

@ -34,8 +34,8 @@ namespace dev
namespace eth namespace eth
{ {
const unsigned c_protocolVersion = 38; const unsigned c_protocolVersion = 39;
const unsigned c_databaseVersion = 3; const unsigned c_databaseVersion = 4;
static const vector<pair<u256, string>> g_units = static const vector<pair<u256, string>> g_units =
{ {

9
libethereum/Executive.cpp

@ -184,15 +184,10 @@ bool Executive::go(OnOpFunc const& _onOp)
{ {
return false; return false;
} }
catch (OutOfGas const& /*_e*/)
{
clog(StateChat) << "Out of Gas! Reverting.";
revert = true;
}
catch (VMException const& _e) catch (VMException const& _e)
{ {
clog(StateChat) << "VM Exception: " << diagnostic_information(_e); clog(StateChat) << "Safe VM Exception: " << diagnostic_information(_e);
m_endGas = m_vm->gas(); m_endGas = 0;//m_vm->gas();
revert = true; revert = true;
} }
catch (Exception const& _e) catch (Exception const& _e)

34
libethereum/State.cpp

@ -1126,7 +1126,7 @@ u256 State::execute(bytesConstRef _rlp, bytes* o_output, bool _commit)
#if ETH_PARANOIA #if ETH_PARANOIA
ctrace << "Executing" << e.t() << "on" << h; ctrace << "Executing" << e.t() << "on" << h;
ctrace << toHex(e.t().rlp(true)); ctrace << toHex(e.t().rlp());
#endif #endif
e.go(); e.go();
@ -1213,32 +1213,29 @@ bool State::call(Address _receiveAddress, Address _codeAddress, Address _senderA
*o_sub += evm.sub; *o_sub += evm.sub;
if (o_ms) if (o_ms)
o_ms->output = out.toBytes(); o_ms->output = out.toBytes();
} *_gas = vm.gas();
catch (OutOfGas const& /*_e*/)
{
clog(StateChat) << "Out of Gas! Reverting.";
revert = true;
} }
catch (VMException const& _e) catch (VMException const& _e)
{ {
clog(StateChat) << "VM Exception: " << diagnostic_information(_e); clog(StateChat) << "Safe VM Exception: " << diagnostic_information(_e);
revert = true; revert = true;
*_gas = 0;
} }
catch (Exception const& _e) catch (Exception const& _e)
{ {
clog(StateChat) << "Exception in VM: " << diagnostic_information(_e); cwarn << "Unexpected exception in VM: " << diagnostic_information(_e) << ". This is exceptionally bad.";
// TODO: use fallback known-safe VM.
} }
catch (std::exception const& _e) catch (std::exception const& _e)
{ {
clog(StateChat) << "std::exception in VM: " << _e.what(); cwarn << "Unexpected exception in VM: " << _e.what() << ". This is exceptionally bad.";
// TODO: use fallback known-safe VM.
} }
// Write state out only in the case of a non-excepted transaction. // Write state out only in the case of a non-excepted transaction.
if (revert) if (revert)
evm.revert(); evm.revert();
*_gas = vm.gas();
return !revert; return !revert;
} }
else else
@ -1281,16 +1278,13 @@ h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas,
o_ms->output = out.toBytes(); o_ms->output = out.toBytes();
if (o_sub) if (o_sub)
*o_sub += evm.sub; *o_sub += evm.sub;
} *_gas = vm.gas();
catch (OutOfGas const& /*_e*/)
{
clog(StateChat) << "Out of Gas! Reverting.";
revert = true;
} }
catch (VMException const& _e) catch (VMException const& _e)
{ {
clog(StateChat) << "VM Exception: " << diagnostic_information(_e); clog(StateChat) << "Safe VM Exception: " << diagnostic_information(_e);
revert = true; revert = true;
*_gas = 0;
} }
catch (Exception const& _e) catch (Exception const& _e)
{ {
@ -1317,8 +1311,6 @@ h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas,
if (addressInUse(newAddress)) if (addressInUse(newAddress))
m_cache[newAddress].setCode(out); m_cache[newAddress].setCode(out);
*_gas = vm.gas();
return newAddress; return newAddress;
} }
@ -1380,7 +1372,7 @@ std::ostream& dev::eth::operator<<(std::ostream& _out, State const& _s)
stringstream contout; stringstream contout;
if ((cache && cache->codeBearing()) || (!cache && r && !r[3].isEmpty())) if ((cache && cache->codeBearing()) || (!cache && r && (h256)r[3] != EmptySHA3))
{ {
std::map<u256, u256> mem; std::map<u256, u256> mem;
std::set<u256> back; std::set<u256> back;
@ -1409,7 +1401,7 @@ std::ostream& dev::eth::operator<<(std::ostream& _out, State const& _s)
else else
contout << r[2].toHash<h256>(); contout << r[2].toHash<h256>();
if (cache && cache->isFreshCode()) if (cache && cache->isFreshCode())
contout << " $" << cache->code(); contout << " $" << toHex(cache->code());
else else
contout << " $" << (cache ? cache->codeHash() : r[3].toHash<h256>()); contout << " $" << (cache ? cache->codeHash() : r[3].toHash<h256>());

10
libethereum/Transaction.cpp

@ -47,7 +47,7 @@ Transaction::Transaction(bytesConstRef _rlpData, bool _checkSender)
if (_checkSender) if (_checkSender)
m_sender = sender(); m_sender = sender();
} }
catch (Exception & _e) catch (Exception& _e)
{ {
_e << errinfo_name("invalid transaction format") << BadFieldError(field,toHex(rlp[field].data().toBytes())); _e << errinfo_name("invalid transaction format") << BadFieldError(field,toHex(rlp[field].data().toBytes()));
throw; throw;
@ -71,7 +71,7 @@ Address Transaction::sender() const
{ {
if (!m_sender) if (!m_sender)
{ {
auto p = recover(*(Signature const*)&m_vrs, sha3(false)); auto p = recover(*(Signature const*)&m_vrs, sha3(WithoutSignature));
if (!p) if (!p)
BOOST_THROW_EXCEPTION(InvalidSignature()); BOOST_THROW_EXCEPTION(InvalidSignature());
m_sender = right160(dev::sha3(bytesConstRef(p.data(), sizeof(p)))); m_sender = right160(dev::sha3(bytesConstRef(p.data(), sizeof(p))));
@ -81,12 +81,14 @@ Address Transaction::sender() const
void Transaction::sign(Secret _priv) void Transaction::sign(Secret _priv)
{ {
auto sig = dev::sign(_priv, sha3(false)); auto sig = dev::sign(_priv, sha3(WithoutSignature));
m_vrs = *(SignatureStruct const*)&sig; m_vrs = *(SignatureStruct const*)&sig;
} }
void Transaction::streamRLP(RLPStream& _s, bool _sig) const void Transaction::streamRLP(RLPStream& _s, IncludeSignature _sig) const
{ {
if (m_type == NullTransaction)
return;
_s.appendList((_sig ? 3 : 0) + 6); _s.appendList((_sig ? 3 : 0) + 6);
_s << m_nonce << m_gasPrice << m_gas; _s << m_nonce << m_gasPrice << m_gas;
if (m_type == MessageCall) if (m_type == MessageCall)

96
libethereum/Transaction.h

@ -30,52 +30,104 @@ namespace dev
namespace eth namespace eth
{ {
/// Named-boolean type to encode whether a signature be included in the serialisation process.
enum IncludeSignature
{
WithoutSignature = 0, ///< Do not include a signature.
WithSignature = 1, ///< Do include a signature.
};
/// Encodes a transaction, ready to be exported to or freshly imported from RLP.
class Transaction class Transaction
{ {
public: public:
enum Type /// Constructs a null transaction.
{
NullTransaction,
ContractCreation,
MessageCall
};
Transaction() {} Transaction() {}
/// Constructs a signed message-call transaction.
Transaction(u256 _value, u256 _gasPrice, u256 _gas, Address const& _dest, bytes const& _data, u256 _nonce, Secret const& _secret): m_type(MessageCall), m_nonce(_nonce), m_value(_value), m_receiveAddress(_dest), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) { sign(_secret); } Transaction(u256 _value, u256 _gasPrice, u256 _gas, Address const& _dest, bytes const& _data, u256 _nonce, Secret const& _secret): m_type(MessageCall), m_nonce(_nonce), m_value(_value), m_receiveAddress(_dest), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) { sign(_secret); }
/// Constructs a signed contract-creation transaction.
Transaction(u256 _value, u256 _gasPrice, u256 _gas, bytes const& _data, u256 _nonce, Secret const& _secret): m_type(ContractCreation), m_nonce(_nonce), m_value(_value), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) { sign(_secret); } Transaction(u256 _value, u256 _gasPrice, u256 _gas, bytes const& _data, u256 _nonce, Secret const& _secret): m_type(ContractCreation), m_nonce(_nonce), m_value(_value), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) { sign(_secret); }
/// Constructs an unsigned message-call transaction.
Transaction(u256 _value, u256 _gasPrice, u256 _gas, Address const& _dest, bytes const& _data): m_type(MessageCall), m_value(_value), m_receiveAddress(_dest), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) {} Transaction(u256 _value, u256 _gasPrice, u256 _gas, Address const& _dest, bytes const& _data): m_type(MessageCall), m_value(_value), m_receiveAddress(_dest), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) {}
/// Constructs an unsigned contract-creation transaction.
Transaction(u256 _value, u256 _gasPrice, u256 _gas, bytes const& _data): m_type(ContractCreation), m_value(_value), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) {} Transaction(u256 _value, u256 _gasPrice, u256 _gas, bytes const& _data): m_type(ContractCreation), m_value(_value), m_gasPrice(_gasPrice), m_gas(_gas), m_data(_data) {}
Transaction(bytesConstRef _rlp, bool _checkSender = false);
Transaction(bytes const& _rlp, bool _checkSender = false): Transaction(&_rlp, _checkSender) {}
/// Constructs a transaction from the given RLP.
explicit Transaction(bytesConstRef _rlp, bool _checkSender = false);
/// Constructs a transaction from the given RLP.
explicit Transaction(bytes const& _rlp, bool _checkSender = false): Transaction(&_rlp, _checkSender) {}
/// Checks equality of transactions.
bool operator==(Transaction const& _c) const { return m_type == _c.m_type && (m_type == ContractCreation || m_receiveAddress == _c.m_receiveAddress) && m_value == _c.m_value && m_data == _c.m_data; } bool operator==(Transaction const& _c) const { return m_type == _c.m_type && (m_type == ContractCreation || m_receiveAddress == _c.m_receiveAddress) && m_value == _c.m_value && m_data == _c.m_data; }
/// Checks inequality of transactions.
bool operator!=(Transaction const& _c) const { return !operator==(_c); } bool operator!=(Transaction const& _c) const { return !operator==(_c); }
Address safeSender() const noexcept; ///< Like sender() but will never throw. @returns a null Address if the signature is invalid. /// @returns sender of the transaction from the signature (and hash).
Address sender() const; ///< Determine the sender of the transaction from the signature (and hash). Address sender() const;
/// Like sender() but will never throw. @returns a null Address if the signature is invalid.
Address safeSender() const noexcept;
/// @returns true if transaction is non-null.
operator bool() const { return m_type != NullTransaction; }
/// @returns true if transaction is contract-creation.
bool isCreation() const { return m_type == ContractCreation; } bool isCreation() const { return m_type == ContractCreation; }
void streamRLP(RLPStream& _s, bool _sig = true) const; /// @returns true if transaction is message-call.
bool isMessageCall() const { return m_type == MessageCall; }
bytes rlp(bool _sig = true) const { RLPStream s; streamRLP(s, _sig); return s.out(); } /// Serialises this transaction to an RLPStream.
std::string rlpString(bool _sig = true) const { return asString(rlp(_sig)); } void streamRLP(RLPStream& _s, IncludeSignature _sig = WithSignature) const;
h256 sha3(bool _sig = true) const { RLPStream s; streamRLP(s, _sig); return dev::sha3(s.out()); }
bytes sha3Bytes(bool _sig = true) const { RLPStream s; streamRLP(s, _sig); return dev::sha3Bytes(s.out()); }
Type type() const { return m_type; } /// @returns the RLP serialisation of this transaction.
u256 nonce() const { return m_nonce; } bytes rlp(IncludeSignature _sig = WithSignature) const { RLPStream s; streamRLP(s, _sig); return s.out(); }
/// @returns the SHA3 hash of the RLP serialisation of this transaction.
h256 sha3(IncludeSignature _sig = WithSignature) const { RLPStream s; streamRLP(s, _sig); return dev::sha3(s.out()); }
/// @returns the amount of ETH to be transferred by this (message-call) transaction, in Wei. Synonym for endowment().
u256 value() const { return m_value; } u256 value() const { return m_value; }
Address receiveAddress() const { return m_receiveAddress; } /// @returns the amount of ETH to be endowed by this (contract-creation) transaction, in Wei. Synonym for value().
u256 endowment() const { return m_value; }
/// @returns the base fee and thus the implied exchange rate of ETH to GAS.
u256 gasPrice() const { return m_gasPrice; } u256 gasPrice() const { return m_gasPrice; }
/// @returns the total gas to convert, paid for from sender's account. Any unused gas gets refunded once the contract is ended.
u256 gas() const { return m_gas; } u256 gas() const { return m_gas; }
/// @returns the receiving address of the message-call transaction (undefined for contract-creation transactions).
Address receiveAddress() const { return m_receiveAddress; }
/// @returns the data associated with this (message-call) transaction. Synonym for initCode().
bytes const& data() const { return m_data; } bytes const& data() const { return m_data; }
/// @returns the initialisation code associated with this (contract-creation) transaction. Synonym for data().
bytes const& initCode() const { return m_data; }
/// @returns the transaction-count of the sender.
u256 nonce() const { return m_nonce; }
/// @returns the signature of the transaction. Encodes the sender.
SignatureStruct const& signature() const { return m_vrs; } SignatureStruct const& signature() const { return m_vrs; }
private: private:
/// Type of transaction.
enum Type
{
NullTransaction, ///< Null transaction.
ContractCreation, ///< Transaction to create contracts - receiveAddress() is ignored.
MessageCall ///< Transaction to invoke a message call - receiveAddress() is used.
};
void sign(Secret _priv); ///< Sign the transaction. void sign(Secret _priv); ///< Sign the transaction.
Type m_type = NullTransaction; ///< True if this is a contract-creation transaction. F Type m_type = NullTransaction; ///< Is this a contract-creation transaction or a message-call transaction?
u256 m_nonce; ///< The transaction-count of the sender. u256 m_nonce; ///< The transaction-count of the sender.
u256 m_value; ///< The amount of ETH to be transferred by this transaction. Called 'endowment' for contract-creation transactions. u256 m_value; ///< The amount of ETH to be transferred by this transaction. Called 'endowment' for contract-creation transactions.
Address m_receiveAddress; ///< The receiving address of the transaction. Address m_receiveAddress; ///< The receiving address of the transaction.
@ -84,11 +136,13 @@ private:
bytes m_data; ///< The data associated with the transaction, or the initialiser if it's a creation transaction. bytes m_data; ///< The data associated with the transaction, or the initialiser if it's a creation transaction.
SignatureStruct m_vrs; ///< The signature of the transaction. Encodes the sender. SignatureStruct m_vrs; ///< The signature of the transaction. Encodes the sender.
mutable Address m_sender; mutable Address m_sender; ///< Cached sender, determined from signature.
}; };
/// Nice name for vector of Transaction.
using Transactions = std::vector<Transaction>; using Transactions = std::vector<Transaction>;
/// Simple human-readable stream-shift operator.
inline std::ostream& operator<<(std::ostream& _out, Transaction const& _t) inline std::ostream& operator<<(std::ostream& _out, Transaction const& _t)
{ {
_out << "{"; _out << "{";

14
libserpent/bignum.cpp

@ -48,6 +48,20 @@ std::string decimalMul(std::string a, std::string b) {
return o; return o;
} }
//Modexp
std::string decimalModExp(std::string b, std::string e, std::string m) {
if (e == "0") return "1";
else if (e == "1") return b;
else if (decimalMod(e, "2") == "0") {
std::string o = decimalModExp(b, decimalDiv(e, "2"), m);
return decimalMod(decimalMul(o, o), m);
}
else {
std::string o = decimalModExp(b, decimalDiv(e, "2"), m);
return decimalMod(decimalMul(decimalMul(o, o), b), m);
}
}
//Is a greater than b? Flag allows equality //Is a greater than b? Flag allows equality
bool decimalGt(std::string a, std::string b, bool eqAllowed) { bool decimalGt(std::string a, std::string b, bool eqAllowed) {
if (a == b) return eqAllowed; if (a == b) return eqAllowed;

12
libserpent/bignum.h

@ -7,10 +7,16 @@ const std::string tt256 =
"115792089237316195423570985008687907853269984665640564039457584007913129639936" "115792089237316195423570985008687907853269984665640564039457584007913129639936"
; ;
const std::string tt255 = const std::string tt256m1 =
"57896044618658097711785492504343953926634992332820282019728792003956564819968" "115792089237316195423570985008687907853269984665640564039457584007913129639935"
; ;
const std::string tt255 =
"57896044618658097711785492504343953926634992332820282019728792003956564819968";
const std::string tt176 =
"95780971304118053647396689196894323976171195136475136";
std::string unsignedToDecimal(unsigned branch); std::string unsignedToDecimal(unsigned branch);
std::string decimalAdd(std::string a, std::string b); std::string decimalAdd(std::string a, std::string b);
@ -23,6 +29,8 @@ std::string decimalDiv(std::string a, std::string b);
std::string decimalMod(std::string a, std::string b); std::string decimalMod(std::string a, std::string b);
std::string decimalModExp(std::string b, std::string e, std::string m);
bool decimalGt(std::string a, std::string b, bool eqAllowed=false); bool decimalGt(std::string a, std::string b, bool eqAllowed=false);
unsigned decimalToUnsigned(std::string a); unsigned decimalToUnsigned(std::string a);

212
libserpent/compiler.cpp

@ -8,10 +8,18 @@
struct programAux { struct programAux {
std::map<std::string, std::string> vars; std::map<std::string, std::string> vars;
int nextVarMem;
bool allocUsed; bool allocUsed;
bool calldataUsed; bool calldataUsed;
int step; int step;
int labelLength; int labelLength;
int functionCount;
};
struct programVerticalAux {
int height;
std::map<std::string, int> dupvars;
std::map<std::string, int> funvars;
}; };
struct programData { struct programData {
@ -25,6 +33,16 @@ programAux Aux() {
o.allocUsed = false; o.allocUsed = false;
o.calldataUsed = false; o.calldataUsed = false;
o.step = 0; o.step = 0;
o.nextVarMem = 32;
o.functionCount = 0;
return o;
}
programVerticalAux verticalAux() {
programVerticalAux o;
o.height = 0;
o.dupvars = std::map<std::string, int>();
o.funvars = std::map<std::string, int>();
return o; return o;
} }
@ -57,28 +75,28 @@ Node popwrap(Node node) {
// Turns LLL tree into tree of code fragments // Turns LLL tree into tree of code fragments
programData opcodeify(Node node, programData opcodeify(Node node,
programAux aux=Aux(), programAux aux=Aux(),
int height=0, programVerticalAux vaux=verticalAux()) {
std::map<std::string, int> dupvars=
std::map<std::string, int>()) {
std::string symb = "_"+mkUniqueToken(); std::string symb = "_"+mkUniqueToken();
Metadata m = node.metadata; Metadata m = node.metadata;
// Numbers // Numbers
if (node.type == TOKEN) { if (node.type == TOKEN) {
return pd(aux, nodeToNumeric(node), 1); return pd(aux, nodeToNumeric(node), 1);
} }
else if (node.val == "ref" || node.val == "get" || node.val == "set") { else if (node.val == "ref" || node.val == "get" ||
node.val == "set" || node.val == "declare") {
std::string varname = node.args[0].val; std::string varname = node.args[0].val;
if (!aux.vars.count(varname)) { if (!aux.vars.count(varname)) {
aux.vars[varname] = unsignedToDecimal(aux.vars.size() * 32); aux.vars[varname] = unsignedToDecimal(aux.nextVarMem);
aux.nextVarMem += 32;
} }
if (varname == "'msg.data") aux.calldataUsed = true; if (varname == "'msg.data") aux.calldataUsed = true;
// Set variable // Set variable
if (node.val == "set") { if (node.val == "set") {
programData sub = opcodeify(node.args[1], aux, height, dupvars); programData sub = opcodeify(node.args[1], aux, vaux);
if (!sub.outs) if (!sub.outs)
err("Value to set variable must have nonzero arity!", m); err("Value to set variable must have nonzero arity!", m);
if (dupvars.count(node.args[0].val)) { if (vaux.dupvars.count(node.args[0].val)) {
int h = height - dupvars[node.args[0].val]; int h = vaux.height - vaux.dupvars[node.args[0].val];
if (h > 16) err("Too deep for stack variable (max 16)", m); if (h > 16) err("Too deep for stack variable (max 16)", m);
Node nodelist[] = { Node nodelist[] = {
sub.code, sub.code,
@ -96,8 +114,8 @@ programData opcodeify(Node node,
} }
// Get variable // Get variable
else if (node.val == "get") { else if (node.val == "get") {
if (dupvars.count(node.args[0].val)) { if (vaux.dupvars.count(node.args[0].val)) {
int h = height - dupvars[node.args[0].val]; int h = vaux.height - vaux.dupvars[node.args[0].val];
if (h > 16) err("Too deep for stack variable (max 16)", m); if (h > 16) err("Too deep for stack variable (max 16)", m);
return pd(aux, token("DUP"+unsignedToDecimal(h)), 1); return pd(aux, token("DUP"+unsignedToDecimal(h)), 1);
} }
@ -106,36 +124,157 @@ programData opcodeify(Node node,
return pd(aux, multiToken(nodelist, 2, m), 1); return pd(aux, multiToken(nodelist, 2, m), 1);
} }
// Refer variable // Refer variable
else { else if (node.val == "ref") {
if (dupvars.count(node.args[0].val)) if (vaux.dupvars.count(node.args[0].val))
err("Cannot ref stack variable!", m); err("Cannot ref stack variable!", m);
return pd(aux, token(aux.vars[varname], m), 1); return pd(aux, token(aux.vars[varname], m), 1);
} }
// Declare variable
else {
Node nodelist[] = { };
return pd(aux, multiToken(nodelist, 0, m), 0);
}
}
// Define functions (TODO: eventually move to rewriter.cpp, keep
// compiler pure LLL)
if (node.val == "def") {
std::vector<std::string> varNames;
std::vector<int> varSizes;
bool useLt32 = false;
int totalSz = 0;
if (node.args.size() != 2)
err("Malformed def!", m);
// Collect the list of variable names and variable byte counts
for (unsigned i = 0; i < node.args[0].args.size(); i++) {
if (node.args[0].args[i].val == "kv") {
if (node.args[0].args[i].args.size() != 2)
err("Malformed def!", m);
varNames.push_back(node.args[0].args[i].args[0].val);
varSizes.push_back(
decimalToUnsigned(node.args[0].args[i].args[1].val));
if (varSizes.back() > 32)
err("Max argument width: 32 bytes", m);
useLt32 = true;
}
else {
varNames.push_back(node.args[0].args[i].val);
varSizes.push_back(32);
}
aux.vars[varNames.back()] = unsignedToDecimal(aux.nextVarMem + 32 * i);
totalSz += varSizes.back();
}
int functionCount = aux.functionCount;
int nextVarMem = aux.nextVarMem;
aux.nextVarMem += 32 * varNames.size();
aux.functionCount += 1;
programData inner;
// If we're only using 32-byte variables, then great, just copy
// over the calldata!
if (!useLt32) {
programData sub = opcodeify(node.args[1], aux, vaux);
Node nodelist[] = {
token(unsignedToDecimal(totalSz), m),
token("1", m),
token(unsignedToDecimal(nextVarMem), m),
token("CALLDATACOPY", m),
sub.code
};
inner = pd(sub.aux, multiToken(nodelist, 5, m), 0);
}
else {
std::vector<Node> innerList;
int cum = 1;
for (unsigned i = 0; i < varNames.size();) {
// If we get a series of 32-byte values, we calldatacopy them
if (varSizes[i] == 32) {
unsigned until = i+1;
while (until < varNames.size() && varSizes[until] == 32)
until += 1;
innerList.push_back(token(unsignedToDecimal((until - i) * 32), m));
innerList.push_back(token(unsignedToDecimal(cum), m));
innerList.push_back(token(unsignedToDecimal(nextVarMem + i * 32), m));
innerList.push_back(token("CALLDATACOPY", m));
cum += (until - i) * 32;
i = until;
}
// Otherwise, we do a clever trick to extract the value
else {
innerList.push_back(token(unsignedToDecimal(32 - varSizes[i]), m));
innerList.push_back(token("256", m));
innerList.push_back(token("EXP", m));
innerList.push_back(token(unsignedToDecimal(cum), m));
innerList.push_back(token("CALLDATALOAD", m));
innerList.push_back(token("DIV", m));
innerList.push_back(token(unsignedToDecimal(nextVarMem + i * 32), m));
innerList.push_back(token("MSTORE", m));
cum += varSizes[i];
i += 1;
}
}
// If caller == origin, then it's from a tx, so unpack, otherwise
// plain copy
programData sub = opcodeify(node.args[1], aux, vaux);
Node ilnode = astnode("", innerList, m);
Node nodelist[] = {
token(unsignedToDecimal(32 * varNames.size()), m),
token("1", m),
token(unsignedToDecimal(nextVarMem), m),
token("CALLDATACOPY", m),
token("CALLER", m),
token("ORIGIN", m),
token("EQ", m),
token("ISZERO", m),
token("$maincode"+symb, m),
token("JUMPI", m),
ilnode,
token("~maincode"+symb, m),
token("JUMPDEST", m),
sub.code
};
inner = pd(sub.aux, multiToken(nodelist, 14, m), 0);
}
// Check if the function call byte is the same
Node nodelist2[] = {
token("0", m),
token("CALLDATALOAD", m),
token("0", m),
token("BYTE", m),
token(unsignedToDecimal(functionCount), m),
token("EQ", m),
token("ISZERO", m),
token("$endcode"+symb, m),
token("JUMPI", m),
inner.code,
token("~endcode"+symb, m),
token("JUMPDEST", m),
};
return pd(inner.aux, multiToken(nodelist2, 12, m), 0);
} }
// Code blocks // Code blocks
if (node.val == "lll" && node.args.size() == 2) { if (node.val == "lll" && node.args.size() == 2) {
if (node.args[1].val != "0") aux.allocUsed = true; if (node.args[1].val != "0") aux.allocUsed = true;
std::vector<Node> o; std::vector<Node> o;
o.push_back(finalize(opcodeify(node.args[0]))); o.push_back(finalize(opcodeify(node.args[0])));
programData sub = opcodeify(node.args[1], aux, height, dupvars); programData sub = opcodeify(node.args[1], aux, vaux);
Node code = astnode("____CODE", o, m); Node code = astnode("____CODE", o, m);
Node nodelist[] = { Node nodelist[] = {
token("$begincode"+symb+".endcode"+symb, m), token("DUP1", m), token("$begincode"+symb+".endcode"+symb, m), token("DUP1", m),
token("$begincode"+symb, m), sub.code, token("CODECOPY", m), token("$begincode"+symb, m), sub.code, token("CODECOPY", m),
token("$endcode"+symb, m), token("JUMP", m), token("$endcode"+symb, m), token("JUMP", m),
token("~begincode"+symb, m), code, token("~endcode"+symb, m), token("~begincode"+symb, m), code,
token("JUMPDEST", m) token("~endcode"+symb, m), token("JUMPDEST", m)
}; };
return pd(sub.aux, multiToken(nodelist, 11, m), 1); return pd(sub.aux, multiToken(nodelist, 11, m), 1);
} }
// Stack variables // Stack variables
if (node.val == "with") { if (node.val == "with") {
std::map<std::string, int> dupvars2 = dupvars; programData initial = opcodeify(node.args[1], aux, vaux);
dupvars2[node.args[0].val] = height; programVerticalAux vaux2 = vaux;
programData initial = opcodeify(node.args[1], aux, height, dupvars); vaux2.dupvars[node.args[0].val] = vaux.height;
vaux2.height += 1;
if (!initial.outs) if (!initial.outs)
err("Initial variable value must have nonzero arity!", m); err("Initial variable value must have nonzero arity!", m);
programData sub = opcodeify(node.args[2], initial.aux, height + 1, dupvars2); programData sub = opcodeify(node.args[2], initial.aux, vaux2);
Node nodelist[] = { Node nodelist[] = {
initial.code, initial.code,
sub.code sub.code
@ -151,7 +290,7 @@ programData opcodeify(Node node,
std::vector<Node> children; std::vector<Node> children;
int lastOut = 0; int lastOut = 0;
for (unsigned i = 0; i < node.args.size(); i++) { for (unsigned i = 0; i < node.args.size(); i++) {
programData sub = opcodeify(node.args[i], aux, height, dupvars); programData sub = opcodeify(node.args[i], aux, vaux);
aux = sub.aux; aux = sub.aux;
if (sub.outs == 1) { if (sub.outs == 1) {
if (i < node.args.size() - 1) sub.code = popwrap(sub.code); if (i < node.args.size() - 1) sub.code = popwrap(sub.code);
@ -163,8 +302,8 @@ programData opcodeify(Node node,
} }
// 2-part conditional (if gets rewritten to unless in rewrites) // 2-part conditional (if gets rewritten to unless in rewrites)
else if (node.val == "unless" && node.args.size() == 2) { else if (node.val == "unless" && node.args.size() == 2) {
programData cond = opcodeify(node.args[0], aux, height, dupvars); programData cond = opcodeify(node.args[0], aux, vaux);
programData action = opcodeify(node.args[1], cond.aux, height, dupvars); programData action = opcodeify(node.args[1], cond.aux, vaux);
aux = action.aux; aux = action.aux;
if (!cond.outs) err("Condition of if/unless statement has arity 0", m); if (!cond.outs) err("Condition of if/unless statement has arity 0", m);
if (action.outs) action.code = popwrap(action.code); if (action.outs) action.code = popwrap(action.code);
@ -178,9 +317,9 @@ programData opcodeify(Node node,
} }
// 3-part conditional // 3-part conditional
else if (node.val == "if" && node.args.size() == 3) { else if (node.val == "if" && node.args.size() == 3) {
programData ifd = opcodeify(node.args[0], aux, height, dupvars); programData ifd = opcodeify(node.args[0], aux, vaux);
programData thend = opcodeify(node.args[1], ifd.aux, height, dupvars); programData thend = opcodeify(node.args[1], ifd.aux, vaux);
programData elsed = opcodeify(node.args[2], thend.aux, height, dupvars); programData elsed = opcodeify(node.args[2], thend.aux, vaux);
aux = elsed.aux; aux = elsed.aux;
if (!ifd.outs) if (!ifd.outs)
err("Condition of if/unless statement has arity 0", m); err("Condition of if/unless statement has arity 0", m);
@ -191,7 +330,7 @@ programData opcodeify(Node node,
if (elsed.outs > outs) elsed.code = popwrap(elsed.code); if (elsed.outs > outs) elsed.code = popwrap(elsed.code);
Node nodelist[] = { Node nodelist[] = {
ifd.code, ifd.code,
token("NOT", m), token("ISZERO", m),
token("$else"+symb, m), token("JUMPI", m), token("$else"+symb, m), token("JUMPI", m),
thend.code, thend.code,
token("$endif"+symb, m), token("JUMP", m), token("$endif"+symb, m), token("JUMP", m),
@ -203,8 +342,8 @@ programData opcodeify(Node node,
} }
// While (rewritten to this in rewrites) // While (rewritten to this in rewrites)
else if (node.val == "until") { else if (node.val == "until") {
programData cond = opcodeify(node.args[0], aux, height, dupvars); programData cond = opcodeify(node.args[0], aux, vaux);
programData action = opcodeify(node.args[1], cond.aux, height, dupvars); programData action = opcodeify(node.args[1], cond.aux, vaux);
aux = action.aux; aux = action.aux;
if (!cond.outs) if (!cond.outs)
err("Condition of while/until loop has arity 0", m); err("Condition of while/until loop has arity 0", m);
@ -215,13 +354,13 @@ programData opcodeify(Node node,
token("$end"+symb, m), token("JUMPI", m), token("$end"+symb, m), token("JUMPI", m),
action.code, action.code,
token("$beg"+symb, m), token("JUMP", m), token("$beg"+symb, m), token("JUMP", m),
token("~end"+symb, m), token("JUMPDEST", m) token("~end"+symb, m), token("JUMPDEST", m),
}; };
return pd(aux, multiToken(nodelist, 10, m)); return pd(aux, multiToken(nodelist, 10, m));
} }
// Memory allocations // Memory allocations
else if (node.val == "alloc") { else if (node.val == "alloc") {
programData bytez = opcodeify(node.args[0], aux, height, dupvars); programData bytez = opcodeify(node.args[0], aux, vaux);
aux = bytez.aux; aux = bytez.aux;
if (!bytez.outs) if (!bytez.outs)
err("Alloc input has arity 0", m); err("Alloc input has arity 0", m);
@ -251,7 +390,9 @@ programData opcodeify(Node node,
for (unsigned i = 0; i < node.args.size(); i++) { for (unsigned i = 0; i < node.args.size(); i++) {
Metadata m2 = node.args[i].metadata; Metadata m2 = node.args[i].metadata;
nodes.push_back(token("DUP1", m2)); nodes.push_back(token("DUP1", m2));
programData sub = opcodeify(node.args[i], aux, height + 2, dupvars); programVerticalAux vaux2 = vaux;
vaux2.height += 2;
programData sub = opcodeify(node.args[i], aux, vaux2);
if (!sub.outs) if (!sub.outs)
err("Array_lit item " + unsignedToDecimal(i) + " has zero arity", m2); err("Array_lit item " + unsignedToDecimal(i) + " has zero arity", m2);
aux = sub.aux; aux = sub.aux;
@ -276,10 +417,9 @@ programData opcodeify(Node node,
err("Invalid arity for "+node.val, m); err("Invalid arity for "+node.val, m);
} }
for (int i = node.args.size() - 1; i >= 0; i--) { for (int i = node.args.size() - 1; i >= 0; i--) {
programData sub = opcodeify(node.args[i], programVerticalAux vaux2 = vaux;
aux, vaux2.height = vaux.height - i - 1 + node.args.size();
height - i - 1 + node.args.size(), programData sub = opcodeify(node.args[i], aux, vaux2);
dupvars);
aux = sub.aux; aux = sub.aux;
if (!sub.outs) if (!sub.outs)
err("Input "+unsignedToDecimal(i)+" has arity 0", sub.code.metadata); err("Input "+unsignedToDecimal(i)+" has arity 0", sub.code.metadata);
@ -305,7 +445,7 @@ Node finalize(programData c) {
if ((c.aux.allocUsed || c.aux.calldataUsed) && c.aux.vars.size() > 0) { if ((c.aux.allocUsed || c.aux.calldataUsed) && c.aux.vars.size() > 0) {
Node nodelist[] = { Node nodelist[] = {
token("0", m), token("0", m),
token(unsignedToDecimal(c.aux.vars.size() * 32 - 1)), token(unsignedToDecimal(c.aux.nextVarMem - 1)),
token("MSTORE8", m) token("MSTORE8", m)
}; };
bottom.push_back(multiToken(nodelist, 3, m)); bottom.push_back(multiToken(nodelist, 3, m));

102
libserpent/opcodes.h

@ -1,20 +1,3 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ETHSERP_OPCODES #ifndef ETHSERP_OPCODES
#define ETHSERP_OPCODES #define ETHSERP_OPCODES
@ -24,7 +7,7 @@
#include <map> #include <map>
class Mapping { class Mapping {
public: public:
Mapping(std::string Op, int Opcode, int In, int Out) { Mapping(std::string Op, int Opcode, int In, int Out) {
op = Op; op = Op;
opcode = Opcode; opcode = Opcode;
@ -46,18 +29,21 @@ Mapping mapping[] = {
Mapping("SDIV", 0x05, 2, 1), Mapping("SDIV", 0x05, 2, 1),
Mapping("MOD", 0x06, 2, 1), Mapping("MOD", 0x06, 2, 1),
Mapping("SMOD", 0x07, 2, 1), Mapping("SMOD", 0x07, 2, 1),
Mapping("EXP", 0x08, 2, 1), Mapping("ADDMOD", 0x08, 3, 1),
Mapping("NEG", 0x09, 1, 1), Mapping("MULMOD", 0x09, 3, 1),
Mapping("LT", 0x0a, 2, 1), Mapping("EXP", 0x0a, 2, 1),
Mapping("GT", 0x0b, 2, 1), Mapping("SIGNEXTEND", 0x0b, 2, 1),
Mapping("SLT", 0x0c, 2, 1), Mapping("LT", 0x10, 2, 1),
Mapping("SGT", 0x0d, 2, 1), Mapping("GT", 0x11, 2, 1),
Mapping("EQ", 0x0e, 2, 1), Mapping("SLT", 0x12, 2, 1),
Mapping("NOT", 0x0f, 1, 1), Mapping("SGT", 0x13, 2, 1),
Mapping("AND", 0x10, 2, 1), Mapping("EQ", 0x14, 2, 1),
Mapping("OR", 0x11, 2, 1), Mapping("ISZERO", 0x15, 1, 1),
Mapping("XOR", 0x12, 2, 1), Mapping("AND", 0x16, 2, 1),
Mapping("BYTE", 0x13, 2, 1), Mapping("OR", 0x17, 2, 1),
Mapping("XOR", 0x18, 2, 1),
Mapping("NOT", 0x19, 1, 1),
Mapping("BYTE", 0x1a, 2, 1),
Mapping("ADDMOD", 0x14, 3, 1), Mapping("ADDMOD", 0x14, 3, 1),
Mapping("MULMOD", 0x15, 3, 1), Mapping("MULMOD", 0x15, 3, 1),
Mapping("SIGNEXTEND", 0x16, 2, 1), Mapping("SIGNEXTEND", 0x16, 2, 1),
@ -80,17 +66,22 @@ Mapping mapping[] = {
Mapping("DIFFICULTY", 0x44, 0, 1), Mapping("DIFFICULTY", 0x44, 0, 1),
Mapping("GASLIMIT", 0x45, 0, 1), Mapping("GASLIMIT", 0x45, 0, 1),
Mapping("POP", 0x50, 1, 0), Mapping("POP", 0x50, 1, 0),
Mapping("MLOAD", 0x53, 1, 1), Mapping("MLOAD", 0x51, 1, 1),
Mapping("MSTORE", 0x54, 2, 0), Mapping("MSTORE", 0x52, 2, 0),
Mapping("MSTORE8", 0x55, 2, 0), Mapping("MSTORE8", 0x53, 2, 0),
Mapping("SLOAD", 0x56, 1, 1), Mapping("SLOAD", 0x54, 1, 1),
Mapping("SSTORE", 0x57, 2, 0), Mapping("SSTORE", 0x55, 2, 0),
Mapping("JUMP", 0x58, 1, 0), Mapping("JUMP", 0x56, 1, 0),
Mapping("JUMPI", 0x59, 2, 0), Mapping("JUMPI", 0x57, 2, 0),
Mapping("PC", 0x5a, 0, 1), Mapping("PC", 0x58, 0, 1),
Mapping("MSIZE", 0x5b, 0, 1), Mapping("MSIZE", 0x59, 0, 1),
Mapping("GAS", 0x5c, 0, 1), Mapping("GAS", 0x5a, 0, 1),
Mapping("JUMPDEST", 0x5d, 0, 0), Mapping("JUMPDEST", 0x5b, 0, 0),
Mapping("LOG0", 0xa0, 2, 0),
Mapping("LOG1", 0xa1, 3, 0),
Mapping("LOG2", 0xa2, 4, 0),
Mapping("LOG3", 0xa3, 5, 0),
Mapping("LOG4", 0xa4, 6, 0),
Mapping("CREATE", 0xf0, 3, 1), Mapping("CREATE", 0xf0, 3, 1),
Mapping("CALL", 0xf1, 7, 1), Mapping("CALL", 0xf1, 7, 1),
Mapping("RETURN", 0xf2, 2, 0), Mapping("RETURN", 0xf2, 2, 0),
@ -103,25 +94,24 @@ std::map<std::string, std::vector<int> > opcodes;
std::map<int, std::string> reverseOpcodes; std::map<int, std::string> reverseOpcodes;
// Fetches everything EXCEPT PUSH1..32 // Fetches everything EXCEPT PUSH1..32
std::pair<std::string, std::vector<int> > _opdata(std::string ops, int opi) std::pair<std::string, std::vector<int> > _opdata(std::string ops, int opi) {
{ if (!opcodes.size()) {
if (!opcodes.size())
{
int i = 0; int i = 0;
while (mapping[i].op != "---END---") while (mapping[i].op != "---END---") {
{
Mapping mi = mapping[i]; Mapping mi = mapping[i];
opcodes[mi.op] = triple(mi.opcode, mi.in, mi.out); opcodes[mi.op] = triple(mi.opcode, mi.in, mi.out);
i++; i++;
} }
for (i = 1; i <= 16; i++) for (i = 1; i <= 16; i++) {
{
opcodes["DUP"+unsignedToDecimal(i)] = triple(0x7f + i, i, i+1); opcodes["DUP"+unsignedToDecimal(i)] = triple(0x7f + i, i, i+1);
opcodes["SWAP"+unsignedToDecimal(i)] = triple(0x8f + i, i+1, i+1); opcodes["SWAP"+unsignedToDecimal(i)] = triple(0x8f + i, i+1, i+1);
} }
for (std::map<std::string, std::vector<int> >::iterator it=opcodes.begin(); it != opcodes.end(); it++) for (std::map<std::string, std::vector<int> >::iterator it=opcodes.begin();
it != opcodes.end();
it++) {
reverseOpcodes[(*it).second[0]] = (*it).first; reverseOpcodes[(*it).second[0]] = (*it).first;
} }
}
std::string op; std::string op;
std::vector<int> opdata; std::vector<int> opdata;
op = reverseOpcodes.count(opi) ? reverseOpcodes[opi] : ""; op = reverseOpcodes.count(opi) ? reverseOpcodes[opi] : "";
@ -129,23 +119,19 @@ std::pair<std::string, std::vector<int> > _opdata(std::string ops, int opi)
return std::pair<std::string, std::vector<int> >(op, opdata); return std::pair<std::string, std::vector<int> >(op, opdata);
} }
int opcode(std::string op) int opcode(std::string op) {
{
return _opdata(op, -1).second[0]; return _opdata(op, -1).second[0];
} }
int opinputs(std::string op) int opinputs(std::string op) {
{
return _opdata(op, -1).second[1]; return _opdata(op, -1).second[1];
} }
int opoutputs(std::string op) int opoutputs(std::string op) {
{
return _opdata(op, -1).second[2]; return _opdata(op, -1).second[2];
} }
std::string op(int opcode) std::string op(int opcode) {
{
return _opdata("", opcode).first; return _opdata("", opcode).first;
} }

53
libserpent/parser.cpp

@ -9,20 +9,21 @@
// Extended BEDMAS precedence order // Extended BEDMAS precedence order
int precedence(Node tok) { int precedence(Node tok) {
std::string v = tok.val; std::string v = tok.val;
if (v == "!" || v == "not") return 0; if (v == ".") return -1;
else if (v=="^" || v == "**") return 1; else if (v == "!" || v == "not") return 1;
else if (v=="*" || v=="/" || v=="@/" || v=="%" || v=="@%") return 2; else if (v=="^" || v == "**") return 2;
else if (v=="+" || v=="-") return 3; else if (v=="*" || v=="/" || v=="@/" || v=="%" || v=="@%") return 3;
else if (v=="<" || v==">" || v=="<=" || v==">=") return 4; else if (v=="+" || v=="-") return 4;
else if (v=="@<" || v=="@>" || v=="@<=" || v=="@>=") return 4; else if (v=="<" || v==">" || v=="<=" || v==">=") return 5;
else if (v=="&" || v=="|" || v=="xor" || v=="==" || v == "!=") return 5; else if (v=="@<" || v=="@>" || v=="@<=" || v=="@>=") return 5;
else if (v=="&&" || v=="and") return 6; else if (v=="&" || v=="|" || v=="xor" || v=="==" || v == "!=") return 6;
else if (v=="||" || v=="or") return 7; else if (v=="&&" || v=="and") return 7;
else if (v==":") return 8; else if (v=="||" || v=="or") return 8;
else if (v==":") return 9;
else if (v=="=") return 10; else if (v=="=") return 10;
else if (v=="+=" || v=="-=" || v=="*=" || v=="/=" || v=="%=") return 10; else if (v=="+=" || v=="-=" || v=="*=" || v=="/=" || v=="%=") return 10;
else if (v=="@/=" || v=="@%=") return 10; else if (v=="@/=" || v=="@%=") return 10;
else return -1; else return 0;
} }
// Token classification for shunting-yard purposes // Token classification for shunting-yard purposes
@ -32,8 +33,9 @@ int toktype(Node tok) {
if (v == "(" || v == "[" || v == "{") return LPAREN; if (v == "(" || v == "[" || v == "{") return LPAREN;
else if (v == ")" || v == "]" || v == "}") return RPAREN; else if (v == ")" || v == "]" || v == "}") return RPAREN;
else if (v == ",") return COMMA; else if (v == ",") return COMMA;
else if (v == "!" || v == "not" || v == "neg") return UNARY_OP; else if (v == "!" || v == "~" || v == "not") return UNARY_OP;
else if (precedence(tok) >= 0) return BINARY_OP; else if (precedence(tok) > 0) return BINARY_OP;
else if (precedence(tok) < 0) return TOKEN_SPLITTER;
if (tok.val[0] != '"' && tok.val[0] != '\'') { if (tok.val[0] != '"' && tok.val[0] != '\'') {
for (unsigned i = 0; i < tok.val.length(); i++) { for (unsigned i = 0; i < tok.val.length(); i++) {
if (chartype(tok.val[i]) == SYMB) { if (chartype(tok.val[i]) == SYMB) {
@ -68,6 +70,10 @@ std::vector<Node> shuntingYard(std::vector<Node> tokens) {
} }
// Left parens go on stack and output queue // Left parens go on stack and output queue
else if (toktyp == LPAREN) { else if (toktyp == LPAREN) {
while (stack.size() && toktype(stack.back()) == TOKEN_SPLITTER) {
oq.push_back(stack.back());
stack.pop_back();
}
if (prevtyp != ALPHANUM && prevtyp != RPAREN) { if (prevtyp != ALPHANUM && prevtyp != RPAREN) {
oq.push_back(token("id", tok.metadata)); oq.push_back(token("id", tok.metadata));
} }
@ -88,16 +94,26 @@ std::vector<Node> shuntingYard(std::vector<Node> tokens) {
else if (toktyp == UNARY_OP) { else if (toktyp == UNARY_OP) {
stack.push_back(tok); stack.push_back(tok);
} }
// If token splitter, just push it to the stack
else if (toktyp == TOKEN_SPLITTER) {
while (stack.size() && toktype(stack.back()) == TOKEN_SPLITTER) {
oq.push_back(stack.back());
stack.pop_back();
}
stack.push_back(tok);
}
// If binary op, keep popping from stack while higher bedmas precedence // If binary op, keep popping from stack while higher bedmas precedence
else if (toktyp == BINARY_OP) { else if (toktyp == BINARY_OP) {
if (tok.val == "-" && prevtyp != ALPHANUM && prevtyp != RPAREN) { if (tok.val == "-" && prevtyp != ALPHANUM && prevtyp != RPAREN) {
stack.push_back(token("neg", tok.metadata)); stack.push_back(tok);
oq.push_back(token("0", tok.metadata));
} }
else { else {
int prec = precedence(tok); int prec = precedence(tok);
while (stack.size() while (stack.size()
&& (toktype(stack.back()) == BINARY_OP && (toktype(stack.back()) == BINARY_OP
|| toktype(stack.back()) == UNARY_OP) || toktype(stack.back()) == UNARY_OP
|| toktype(stack.back()) == TOKEN_SPLITTER)
&& precedence(stack.back()) <= prec) { && precedence(stack.back()) <= prec) {
oq.push_back(stack.back()); oq.push_back(stack.back());
stack.pop_back(); stack.pop_back();
@ -133,9 +149,9 @@ Node treefy(std::vector<Node> stream) {
int typ = toktype(tok); int typ = toktype(tok);
// If unary, take node off end of oq and wrap it with the operator // If unary, take node off end of oq and wrap it with the operator
// If binary, do the same with two nodes // If binary, do the same with two nodes
if (typ == UNARY_OP || typ == BINARY_OP) { if (typ == UNARY_OP || typ == BINARY_OP || typ == TOKEN_SPLITTER) {
std::vector<Node> args; std::vector<Node> args;
int rounds = (typ == BINARY_OP) ? 2 : 1; int rounds = (typ == UNARY_OP) ? 1 : 2;
for (int i = 0; i < rounds; i++) { for (int i = 0; i < rounds; i++) {
if (oq.size() == 0) { if (oq.size() == 0) {
err("Line malformed, not enough args for "+tok.val, err("Line malformed, not enough args for "+tok.val,
@ -245,7 +261,8 @@ int spaceCount(std::string s) {
// Is this a command that takes an argument on the same line? // Is this a command that takes an argument on the same line?
bool bodied(std::string tok) { bool bodied(std::string tok) {
return tok == "if" || tok == "elif" || tok == "while" return tok == "if" || tok == "elif" || tok == "while"
|| tok == "with" || tok == "def"; || tok == "with" || tok == "def" || tok == "extern"
|| tok == "data";
} }
// Is this a command that takes an argument as a child block? // Is this a command that takes an argument as a child block?

870
libserpent/rewriter.cpp

File diff suppressed because it is too large

2
libserpent/tokenize.cpp

@ -13,7 +13,7 @@ int chartype(char c) {
if (c >= '0' && c <= '9') return ALPHANUM; if (c >= '0' && c <= '9') return ALPHANUM;
else if (c >= 'a' && c <= 'z') return ALPHANUM; else if (c >= 'a' && c <= 'z') return ALPHANUM;
else if (c >= 'A' && c <= 'Z') return ALPHANUM; else if (c >= 'A' && c <= 'Z') return ALPHANUM;
else if (std::string("~._$").find(c) != std::string::npos) return ALPHANUM; else if (std::string("~_$").find(c) != std::string::npos) return ALPHANUM;
else if (c == '\t' || c == ' ' || c == '\n') return SPACE; else if (c == '\t' || c == ' ' || c == '\n') return SPACE;
else if (std::string("()[]{}").find(c) != std::string::npos) return BRACK; else if (std::string("()[]{}").find(c) != std::string::npos) return BRACK;
else if (c == '"') return DQUOTE; else if (c == '"') return DQUOTE;

22
libserpent/util.cpp

@ -26,6 +26,28 @@ Node astnode(std::string val, std::vector<Node> args, Metadata met) {
return o; return o;
} }
//AST node constructors for a specific number of children
Node astnode(std::string val, Node a, Metadata met) {
std::vector<Node> args;
args.push_back(a);
return astnode(val, args, met);
}
Node astnode(std::string val, Node a, Node b, Metadata met) {
std::vector<Node> args;
args.push_back(a);
args.push_back(b);
return astnode(val, args, met);
}
Node astnode(std::string val, Node a, Node b, Node c, Metadata met) {
std::vector<Node> args;
args.push_back(a);
args.push_back(b);
args.push_back(c);
return astnode(val, args, met);
}
// Print token list // Print token list
std::string printTokens(std::vector<Node> tokens) { std::string printTokens(std::vector<Node> tokens) {
std::string s = ""; std::string s = "";

6
libserpent/util.h

@ -22,7 +22,8 @@ const int TOKEN = 0,
COLON = 11, COLON = 11,
UNARY_OP = 12, UNARY_OP = 12,
BINARY_OP = 13, BINARY_OP = 13,
COMPOUND = 14; COMPOUND = 14,
TOKEN_SPLITTER = 15;
// Stores metadata about each token // Stores metadata about each token
class Metadata { class Metadata {
@ -48,6 +49,9 @@ struct Node {
}; };
Node token(std::string val, Metadata met=Metadata()); Node token(std::string val, Metadata met=Metadata());
Node astnode(std::string val, std::vector<Node> args, Metadata met=Metadata()); Node astnode(std::string val, std::vector<Node> args, Metadata met=Metadata());
Node astnode(std::string val, Node a, Metadata met=Metadata());
Node astnode(std::string val, Node a, Node b, Metadata met=Metadata());
Node astnode(std::string val, Node a, Node b, Node c, Metadata met=Metadata());
// Number of tokens in a tree // Number of tokens in a tree
int treeSize(Node prog); int treeSize(Node prog);

22
test/crypto.cpp

@ -451,14 +451,14 @@ BOOST_AUTO_TEST_CASE(eth_keypairs)
BOOST_REQUIRE(p.address() == Address(fromHex("8a40bfaa73256b60764c1bf40675a99083efb075"))); BOOST_REQUIRE(p.address() == Address(fromHex("8a40bfaa73256b60764c1bf40675a99083efb075")));
{ {
eth::Transaction t(1000, 0, 0, h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")), bytes(), 0, p.secret()); eth::Transaction t(1000, 0, 0, h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")), bytes(), 0, p.secret());
auto rlp = t.rlp(false); auto rlp = t.rlp(eth::WithoutSignature);
cnote << RLP(rlp); cnote << RLP(rlp);
cnote << toHex(rlp); cnote << toHex(rlp);
cnote << t.sha3(false); cnote << t.sha3(eth::WithoutSignature);
rlp = t.rlp(true); rlp = t.rlp(eth::WithSignature);
cnote << RLP(rlp); cnote << RLP(rlp);
cnote << toHex(rlp); cnote << toHex(rlp);
cnote << t.sha3(true); cnote << t.sha3(eth::WithSignature);
BOOST_REQUIRE(t.sender() == p.address()); BOOST_REQUIRE(t.sender() == p.address());
} }
@ -475,15 +475,15 @@ int cryptoTest()
BOOST_REQUIRE(p.address() == Address(fromHex("8a40bfaa73256b60764c1bf40675a99083efb075"))); BOOST_REQUIRE(p.address() == Address(fromHex("8a40bfaa73256b60764c1bf40675a99083efb075")));
{ {
eth::Transaction t(1000, 0, 0, h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")), bytes(), 0, p.secret()); eth::Transaction t(1000, 0, 0, h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")), bytes(), 0, p.secret());
auto rlp = t.rlp(false); auto rlp = t.rlp(eth::WithoutSignature);
cnote << RLP(rlp); cnote << RLP(rlp);
cnote << toHex(rlp); cnote << toHex(rlp);
cnote << t.sha3(false); cnote << t.sha3(eth::WithoutSignature);
rlp = t.rlp(true); rlp = t.rlp(eth::WithSignature);
cnote << RLP(rlp); cnote << RLP(rlp);
cnote << toHex(rlp); cnote << toHex(rlp);
cnote << t.sha3(true); cnote << t.sha3(eth::WithSignature);
BOOST_REQUIRE(t.sender() == p.address()); assert(t.sender() == p.address());
} }
@ -508,8 +508,8 @@ int cryptoTest()
auto msg = t.rlp(false); auto msg = t.rlp(false);
cout << "TX w/o SIG: " << RLP(msg) << endl; cout << "TX w/o SIG: " << RLP(msg) << endl;
cout << "RLP(TX w/o SIG): " << toHex(t.rlpString(false)) << endl; cout << "RLP(TX w/o SIG): " << toHex(t.rlp(false)) << endl;
std::string hmsg = sha3(t.rlpString(false), false); std::string hmsg = sha3(t.rlp(false), false);
cout << "SHA256(RLP(TX w/o SIG)): 0x" << toHex(hmsg) << endl; cout << "SHA256(RLP(TX w/o SIG)): 0x" << toHex(hmsg) << endl;
bytes privkey = sha3Bytes("123"); bytes privkey = sha3Bytes("123");

9
test/vm.cpp

@ -375,7 +375,7 @@ mArray FakeExtVM::exportCallCreates()
for (Transaction const& tx: callcreates) for (Transaction const& tx: callcreates)
{ {
mObject o; mObject o;
o["destination"] = tx.type() == Transaction::ContractCreation ? "" : toString(tx.receiveAddress()); o["destination"] = tx.isCreation() ? "" : toString(tx.receiveAddress());
push(o, "gasLimit", tx.gas()); push(o, "gasLimit", tx.gas());
push(o, "value", tx.value()); push(o, "value", tx.value());
o["data"] = "0x" + toHex(tx.data()); o["data"] = "0x" + toHex(tx.data());
@ -683,7 +683,7 @@ void executeTests(const string& _name)
else else
testPath = ptestPath; testPath = ptestPath;
testPath += "/vmtests"; testPath += "/VMTests";
#ifdef FILL_TESTS #ifdef FILL_TESTS
try try
@ -770,11 +770,6 @@ BOOST_AUTO_TEST_CASE(vmPushDupSwapTest)
dev::test::executeTests("vmPushDupSwapTest"); dev::test::executeTests("vmPushDupSwapTest");
} }
BOOST_AUTO_TEST_CASE(vmSystemOperationsTest)
{
dev::test::executeTests("vmSystemOperationsTest");
}
BOOST_AUTO_TEST_CASE(userDefinedFile) BOOST_AUTO_TEST_CASE(userDefinedFile)
{ {

226
test/vmArithmeticTestFiller.json

@ -1094,35 +1094,7 @@
} }
}, },
"exp0": { "addmod0": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
"currentGasLimit" : "1000000",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 2 2)}",
"storage": {}
}
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
"gasPrice" : "100000000000000",
"gas" : "10000"
}
},
"exp1": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1135,7 +1107,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 115792089237316195423570985008687907853269984665640564039457584007913129639935 115792089237316195423570985008687907853269984665640564039457584007913129639934 )}", "code" : "{ [[ 0 ]] (ADDMOD 1 2 2) } ",
"storage": {} "storage": {}
} }
}, },
@ -1150,7 +1122,7 @@
} }
}, },
"exp2": { "addmod1": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1163,7 +1135,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 2147483647 2147483647)}", "code" : "{ [[ 0 ]] (ADDMOD (- 0 1) (- 0 2) 2) } ",
"storage": {} "storage": {}
} }
}, },
@ -1178,7 +1150,7 @@
} }
}, },
"exp3": { "addmod2": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1191,7 +1163,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 0 2147483647)}", "code" : "{ [[ 0 ]] (ADDMOD (- 0 6) 1 3) } ",
"storage": {} "storage": {}
} }
}, },
@ -1206,7 +1178,7 @@
} }
}, },
"exp4": { "addmod2_0": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1219,7 +1191,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 2147483647 0)}", "code" : "{ [[ 0 ]] (EQ (SMOD (- 0 5) 3) (ADDMOD (- 0 6) 1 3) ) } ",
"storage": {} "storage": {}
} }
}, },
@ -1234,7 +1206,7 @@
} }
}, },
"exp5": { "addmod2_1": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1247,7 +1219,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 257 1)}", "code" : "{[[ 0 ]] (EQ (MOD (- 0 5) 3) (ADDMOD (- 0 6) 1 3) ) }",
"storage": {} "storage": {}
} }
}, },
@ -1262,7 +1234,7 @@
} }
}, },
"exp6": { "addmod3": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1275,7 +1247,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 1 257)}", "code" : "{ [[ 0 ]] (ADDMOD 4 1 (- 0 3) )} ",
"storage": {} "storage": {}
} }
}, },
@ -1290,7 +1262,7 @@
} }
}, },
"exp7": { "addmod3_0": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1303,7 +1275,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EXP 2 257)}", "code" : "{ [[ 0 ]] (EQ (ADDMOD 4 1 (- 0 3) ) 2 ) } ",
"storage": {} "storage": {}
} }
}, },
@ -1319,7 +1291,7 @@
}, },
"bnot0": { "mulmod0": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1332,7 +1304,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (NEG 0 )}", "code" : "{ [[ 0 ]] (MULMOD 1 2 2) } ",
"storage": {} "storage": {}
} }
}, },
@ -1347,7 +1319,7 @@
} }
}, },
"bnot1": { "mulmod1": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1360,7 +1332,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (NEG 2 )}", "code" : "{ [[ 0 ]] (MULMOD (- 0 1) (- 0 2) 3) } ",
"storage": {} "storage": {}
} }
}, },
@ -1375,7 +1347,7 @@
} }
}, },
"bnot2": { "mulmod2": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1388,7 +1360,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (NEG 115792089237316195423570985008687907853269984665640564039457584007913129639935 )}", "code" : "{ [[ 0 ]] (MULMOD (- 0 5) 1 3) } ",
"storage": {} "storage": {}
} }
}, },
@ -1403,7 +1375,7 @@
} }
}, },
"bnot3": { "mulmod2_0": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1416,7 +1388,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (NEG (- 0 2) )}", "code" : "{ [[ 0 ]] (EQ (SMOD (- 0 5) 3) (MULMOD (- 0 5) 1 3) ) } ",
"storage": {} "storage": {}
} }
}, },
@ -1431,7 +1403,7 @@
} }
}, },
"bnot4": { "mulmod2_1": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1444,7 +1416,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (NEG (- 0 115792089237316195423570985008687907853269984665640564039457584007913129639935) )}", "code" : "{[[ 0 ]] (EQ (MOD (- 0 5) 3) (MULMOD (- 0 5) 1 3) ) }",
"storage": {} "storage": {}
} }
}, },
@ -1459,7 +1431,7 @@
} }
}, },
"bnot5": { "mulmod3": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1472,7 +1444,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (NEG (- 0 0) )}", "code" : "{ [[ 0 ]] (MULMOD 5 1 (- 0 3) )} ",
"storage": {} "storage": {}
} }
}, },
@ -1487,7 +1459,7 @@
} }
}, },
"lt0": { "mulmod3_0": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1500,7 +1472,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (LT (- 0 2) 0 )}", "code" : "{ [[ 0 ]] (EQ (MULMOD 5 1 (- 0 3) ) 2 )} ",
"storage": {} "storage": {}
} }
}, },
@ -1515,35 +1487,8 @@
} }
}, },
"lt1": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
"currentGasLimit" : "1000000",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"nonce" : 0,
"code" : "{ [[ 0 ]] (LT 0 (- 0 2) )}",
"storage": {}
}
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
"gasPrice" : "100000000000000",
"gas" : "10000"
}
},
"lt2": { "exp0": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1556,7 +1501,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (LT 115792089237316195423570985008687907853269984665640564039457584007913129639935 0 )}", "code" : "{ [[ 0 ]] (EXP 2 2)}",
"storage": {} "storage": {}
} }
}, },
@ -1571,8 +1516,7 @@
} }
}, },
"exp1": {
"lt3": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1585,7 +1529,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (LT 0 115792089237316195423570985008687907853269984665640564039457584007913129639935 )}", "code" : "{ [[ 0 ]] (EXP 115792089237316195423570985008687907853269984665640564039457584007913129639935 115792089237316195423570985008687907853269984665640564039457584007913129639934 )}",
"storage": {} "storage": {}
} }
}, },
@ -1600,7 +1544,7 @@
} }
}, },
"gt0": { "exp2": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1613,7 +1557,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] ( GT (- 0 2) 0 )}", "code" : "{ [[ 0 ]] (EXP 2147483647 2147483647)}",
"storage": {} "storage": {}
} }
}, },
@ -1628,7 +1572,7 @@
} }
}, },
"gt1": { "exp3": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1641,7 +1585,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (GT 0 (- 0 2) )}", "code" : "{ [[ 0 ]] (EXP 0 2147483647)}",
"storage": {} "storage": {}
} }
}, },
@ -1656,7 +1600,7 @@
} }
}, },
"gt2": { "exp4": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1669,7 +1613,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (GT 115792089237316195423570985008687907853269984665640564039457584007913129639935 0 )}", "code" : "{ [[ 0 ]] (EXP 2147483647 0)}",
"storage": {} "storage": {}
} }
}, },
@ -1684,8 +1628,7 @@
} }
}, },
"exp5": {
"gt3": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1698,7 +1641,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (GT 0 115792089237316195423570985008687907853269984665640564039457584007913129639935 )}", "code" : "{ [[ 0 ]] (EXP 257 1)}",
"storage": {} "storage": {}
} }
}, },
@ -1713,7 +1656,7 @@
} }
}, },
"slt0": { "exp6": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1726,7 +1669,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SLT (- 0 2) 0 )}", "code" : "{ [[ 0 ]] (EXP 1 257)}",
"storage": {} "storage": {}
} }
}, },
@ -1741,7 +1684,7 @@
} }
}, },
"slt1": { "exp7": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1754,7 +1697,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SLT 0 (- 0 2) )}", "code" : "{ [[ 0 ]] (EXP 2 257)}",
"storage": {} "storage": {}
} }
}, },
@ -1769,7 +1712,7 @@
} }
}, },
"slt2": { "signextend_bitIsSet": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1782,7 +1725,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SLT 115792089237316195423570985008687907853269984665640564039457584007913129639935 0 )}", "code" : "0x62122ff4600016600057",
"storage": {} "storage": {}
} }
}, },
@ -1797,8 +1740,7 @@
} }
}, },
"signextend_BitIsNotSet": {
"slt3": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1811,7 +1753,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SLT 0 115792089237316195423570985008687907853269984665640564039457584007913129639935 )}", "code" : "0x62122f6a600016600057",
"storage": {} "storage": {}
} }
}, },
@ -1826,7 +1768,7 @@
} }
}, },
"slt4": { "signextend_BitIsSetInHigherByte": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1839,7 +1781,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SLT (- 0 5) (- 0 3) )}", "code" : "0x6212faf4600116600057",
"storage": {} "storage": {}
} }
}, },
@ -1854,7 +1796,7 @@
} }
}, },
"sgt0": { "signextend_BitIsNotSetInHigherByte": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1867,7 +1809,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SGT (- 0 2) 0 )}", "code" : "0x62126af4600116600057",
"storage": {} "storage": {}
} }
}, },
@ -1882,7 +1824,7 @@
} }
}, },
"sgt1": { "signextendInvalidByteNumber": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1895,7 +1837,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SGT 0 (- 0 2) )}", "code" : "0x62126af4605016600057",
"storage": {} "storage": {}
} }
}, },
@ -1910,7 +1852,7 @@
} }
}, },
"sgt2": { "signextend_00": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1923,7 +1865,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SGT 115792089237316195423570985008687907853269984665640564039457584007913129639935 0 )}", "code" : "{ [[ 0 ]] (SIGNEXTEND 0 0) } ",
"storage": {} "storage": {}
} }
}, },
@ -1938,8 +1880,7 @@
} }
}, },
"signextend_BigByte_0": {
"sgt3": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1952,7 +1893,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SGT 0 115792089237316195423570985008687907853269984665640564039457584007913129639935 )}", "code" : "{ [[ 0 ]] (SIGNEXTEND 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0) } ",
"storage": {} "storage": {}
} }
}, },
@ -1967,7 +1908,7 @@
} }
}, },
"sgt4": { "signextend_0_BigByte": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -1980,7 +1921,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (SGT (- 0 5) (- 0 3) )}", "code" : "{ [[ 0 ]] (SIGNEXTEND 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) } ",
"storage": {} "storage": {}
} }
}, },
@ -1995,7 +1936,7 @@
} }
}, },
"eq0": { "signextend_BigByteBigByte": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -2008,7 +1949,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EQ (- 0 5) (- 0 3) )}", "code" : "{ [[ 0 ]] (SIGNEXTEND 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) } ",
"storage": {} "storage": {}
} }
}, },
@ -2023,7 +1964,7 @@
} }
}, },
"eq1": { "signextend_AlmostBiggestByte": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -2036,7 +1977,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EQ 0 0)}", "code" : "{ [[ 0 ]] (SIGNEXTEND 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe) } ",
"storage": {} "storage": {}
} }
}, },
@ -2051,7 +1992,7 @@
} }
}, },
"eq2": { "signextend_bigBytePlus1": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -2064,7 +2005,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (EQ 115792089237316195423570985008687907853269984665640564039457584007913129639935 115792089237316195423570985008687907853269984665640564039457584007913129639935 )}", "code" : "0x66f000000000000161ffff16600057",
"storage": {} "storage": {}
} }
}, },
@ -2079,7 +2020,7 @@
} }
}, },
"not0": { "signextend_BigBytePlus1_2": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -2092,7 +2033,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "{ [[ 0 ]] (NOT 115792089237316195423570985008687907853269984665640564039457584007913129639935 )}", "code" : "0x60ff68f0000000000000000116600057",
"storage": {} "storage": {}
} }
}, },
@ -2105,36 +2046,5 @@
"gasPrice" : "100000000000000", "gasPrice" : "100000000000000",
"gas" : "10000" "gas" : "10000"
} }
},
"not1": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
"currentGasLimit" : "1000000",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"nonce" : 0,
"code" : "{ [[ 0 ]] (NOT 0 )}",
"storage": {}
} }
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
"gasPrice" : "100000000000000",
"gas" : "10000"
}
},
} }

354
test/vmBitwiseLogicOperationTestFiller.json

File diff suppressed because it is too large

80
test/vmIOandFlowOperationsTestFiller.json

@ -12,7 +12,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6002600360045057", "code" : "0x6002600360045055",
"storage": {} "storage": {}
} }
}, },
@ -40,7 +40,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x5060026003600457", "code" : "0x5060026003600455",
"storage": {} "storage": {}
} }
}, },
@ -68,7 +68,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600260035157", "code" : "0x600260035155",
"storage": {} "storage": {}
} }
}, },
@ -96,7 +96,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600260035257", "code" : "0x600260035255",
"storage": {} "storage": {}
} }
}, },
@ -488,7 +488,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6023600058", "code" : "0x600056",
"storage": {} "storage": {}
} }
}, },
@ -516,7 +516,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60236007586001600257", "code" : "0x60236007566001600255",
"storage": {} "storage": {}
} }
}, },
@ -543,7 +543,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x602360085860015d600257", "code" : "0x602360075660015b600255",
"storage": {} "storage": {}
} }
}, },
@ -571,7 +571,63 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x602360075860015d600257", "code" : "0x602360085660015b600255",
"storage": {}
}
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
"gasPrice" : "100000000000000",
"gas" : "10000"
}
},
"jump0_jumpdest2": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
"currentGasLimit" : "1000000",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"nonce" : 0,
"code" : "0x6023600a6008505660015b600255",
"storage": {}
}
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
"gasPrice" : "100000000000000",
"gas" : "10000"
}
},
"jump0_jumpdest3": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
"currentGasLimit" : "1000000",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"nonce" : 0,
"code" : "0x6023600b6008505660015b600255",
"storage": {} "storage": {}
} }
}, },
@ -599,7 +655,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x602360016009596001600257", "code" : "0x602360016009576001600255",
"storage": {} "storage": {}
} }
}, },
@ -627,7 +683,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60236001600a5960015d600257", "code" : "0x60236001600a5760015b600255",
"storage": {} "storage": {}
} }
}, },
@ -655,7 +711,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x602360006009596001600257", "code" : "0x602360006009576001600255",
"storage": {} "storage": {}
} }
}, },
@ -683,7 +739,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff596002600357", "code" : "0x60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff576002600355",
"storage": {} "storage": {}
} }
}, },

134
test/vmPushDupSwapTestFiller.json

@ -12,7 +12,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60ff600357", "code" : "0x60ff600355",
"storage": {} "storage": {}
} }
}, },
@ -68,7 +68,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x61eeff600357", "code" : "0x61eeff600355",
"storage": {} "storage": {}
} }
}, },
@ -96,7 +96,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x62ddeeff600357", "code" : "0x62ddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -124,7 +124,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x63ccddeeff600357", "code" : "0x63ccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -152,7 +152,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x64bbccddeeff600357", "code" : "0x64bbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -180,7 +180,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x65aabbccddeeff600357", "code" : "0x65aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -208,7 +208,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6699aabbccddeeff600357", "code" : "0x6699aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -236,7 +236,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x678899aabbccddeeff600357", "code" : "0x678899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -264,7 +264,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x68778899aabbccddeeff600357", "code" : "0x68778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -292,7 +292,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6966778899aabbccddeeff600357", "code" : "0x6966778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -320,7 +320,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6a5566778899aabbccddeeff600357", "code" : "0x6a5566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -348,7 +348,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6b445566778899aabbccddeeff600357", "code" : "0x6b445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -376,7 +376,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6c33445566778899aabbccddeeff600357", "code" : "0x6c33445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -404,7 +404,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6d2233445566778899aabbccddeeff600357", "code" : "0x6d2233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -432,7 +432,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6e112233445566778899aabbccddeeff600357", "code" : "0x6e112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -460,7 +460,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6f10112233445566778899aabbccddeeff600357", "code" : "0x6f10112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -488,7 +488,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x70ff00112233445566778899aabbccddeeff600357", "code" : "0x70ff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -516,7 +516,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x71eeff00112233445566778899aabbccddeeff600357", "code" : "0x71eeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -544,7 +544,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x72ddeeff00112233445566778899aabbccddeeff600357", "code" : "0x72ddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -572,7 +572,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x73ccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x73ccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -600,7 +600,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x74bbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x74bbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -628,7 +628,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x75aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x75aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -656,7 +656,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7699aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7699aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -684,7 +684,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -712,7 +712,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x78778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x78778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -740,7 +740,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7966778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7966778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -769,7 +769,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7a5566778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7a5566778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -797,7 +797,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7b445566778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7b445566778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -825,7 +825,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7c33445566778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7c33445566778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -853,7 +853,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7d2233445566778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7d2233445566778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -881,7 +881,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7e112233445566778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7e112233445566778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -909,7 +909,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -937,7 +937,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7fff10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff600357", "code" : "0x7fff10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff600355",
"storage": {} "storage": {}
} }
}, },
@ -965,7 +965,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff80600357", "code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff80600355",
"storage": {} "storage": {}
} }
}, },
@ -993,7 +993,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff81600357", "code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff81600355",
"storage": {} "storage": {}
} }
}, },
@ -1021,7 +1021,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6002600181600357", "code" : "0x6002600181600355",
"storage": {} "storage": {}
} }
}, },
@ -1049,7 +1049,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60036002600182600357", "code" : "0x60036002600182600355",
"storage": {} "storage": {}
} }
}, },
@ -1077,7 +1077,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600460036002600183600357", "code" : "0x600460036002600183600355",
"storage": {} "storage": {}
} }
}, },
@ -1105,7 +1105,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6005600460036002600184600357", "code" : "0x6005600460036002600184600355",
"storage": {} "storage": {}
} }
}, },
@ -1133,7 +1133,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60066005600460036002600185600357", "code" : "0x60066005600460036002600185600355",
"storage": {} "storage": {}
} }
}, },
@ -1161,7 +1161,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600760066005600460036002600186600357", "code" : "0x600760066005600460036002600186600355",
"storage": {} "storage": {}
} }
}, },
@ -1189,7 +1189,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6008600760066005600460036002600187600357", "code" : "0x6008600760066005600460036002600187600355",
"storage": {} "storage": {}
} }
}, },
@ -1217,7 +1217,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60096008600760066005600460036002600188600357", "code" : "0x60096008600760066005600460036002600188600355",
"storage": {} "storage": {}
} }
}, },
@ -1245,7 +1245,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600a60096008600760066005600460036002600189600357", "code" : "0x600a60096008600760066005600460036002600189600355",
"storage": {} "storage": {}
} }
}, },
@ -1273,7 +1273,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600b600a6009600860076006600560046003600260018a600357", "code" : "0x600b600a6009600860076006600560046003600260018a600355",
"storage": {} "storage": {}
} }
}, },
@ -1301,7 +1301,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600c600b600a6009600860076006600560046003600260018b600357", "code" : "0x600c600b600a6009600860076006600560046003600260018b600355",
"storage": {} "storage": {}
} }
}, },
@ -1329,7 +1329,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600d600c600b600a6009600860076006600560046003600260018c600357", "code" : "0x600d600c600b600a6009600860076006600560046003600260018c600355",
"storage": {} "storage": {}
} }
}, },
@ -1357,7 +1357,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600e600d600c600b600a6009600860076006600560046003600260018d600357", "code" : "0x600e600d600c600b600a6009600860076006600560046003600260018d600355",
"storage": {} "storage": {}
} }
}, },
@ -1385,7 +1385,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600f600e600d600c600b600a6009600860076006600560046003600260018e600357", "code" : "0x600f600e600d600c600b600a6009600860076006600560046003600260018e600355",
"storage": {} "storage": {}
} }
}, },
@ -1413,7 +1413,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6010600f600e600d600c600b600a6009600860076006600560046003600260018f600357", "code" : "0x6010600f600e600d600c600b600a6009600860076006600560046003600260018f600355",
"storage": {} "storage": {}
} }
}, },
@ -1441,7 +1441,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff60039057", "code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff60039055",
"storage": {} "storage": {}
} }
}, },
@ -1469,7 +1469,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff60039157", "code" : "0x7f10112233445566778899aabbccddeeff00112233445566778899aabbccddeeff60039155",
"storage": {} "storage": {}
} }
}, },
@ -1497,7 +1497,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6002600160039157", "code" : "0x6002600160039155",
"storage": {} "storage": {}
} }
}, },
@ -1525,7 +1525,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60036002600160039257", "code" : "0x60036002600160039255",
"storage": {} "storage": {}
} }
}, },
@ -1553,7 +1553,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600460036002600160039357", "code" : "0x600460036002600160039355",
"storage": {} "storage": {}
} }
}, },
@ -1581,7 +1581,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6005600460036002600160039457", "code" : "0x6005600460036002600160039455",
"storage": {} "storage": {}
} }
}, },
@ -1609,7 +1609,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60066005600460036002600160039557", "code" : "0x60066005600460036002600160039555",
"storage": {} "storage": {}
} }
}, },
@ -1637,7 +1637,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600760066005600460036002600160039657", "code" : "0x600760066005600460036002600160039655",
"storage": {} "storage": {}
} }
}, },
@ -1665,7 +1665,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6008600760066005600460036002600160039757", "code" : "0x6008600760066005600460036002600160039755",
"storage": {} "storage": {}
} }
}, },
@ -1693,7 +1693,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x60096008600760066005600460036002600160039857", "code" : "0x60096008600760066005600460036002600160039855",
"storage": {} "storage": {}
} }
}, },
@ -1721,7 +1721,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600a60096008600760066005600460036002600160039957", "code" : "0x600a60096008600760066005600460036002600160039955",
"storage": {} "storage": {}
} }
}, },
@ -1749,7 +1749,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600b600a60096008600760066005600460036002600160039a57", "code" : "0x600b600a60096008600760066005600460036002600160039a55",
"storage": {} "storage": {}
} }
}, },
@ -1777,7 +1777,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600c600b600a60096008600760066005600460036002600160039b57", "code" : "0x600c600b600a60096008600760066005600460036002600160039b55",
"storage": {} "storage": {}
} }
}, },
@ -1805,7 +1805,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600d600c600b600a60096008600760066005600460036002600160039c57", "code" : "0x600d600c600b600a60096008600760066005600460036002600160039c55",
"storage": {} "storage": {}
} }
}, },
@ -1833,7 +1833,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600e600d600c600b600a60096008600760066005600460036002600160039d57", "code" : "0x600e600d600c600b600a60096008600760066005600460036002600160039d55",
"storage": {} "storage": {}
} }
}, },
@ -1861,7 +1861,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x600f600e600d600c600b600a60096008600760066005600460036002600160039e57", "code" : "0x600f600e600d600c600b600a60096008600760066005600460036002600160039e55",
"storage": {} "storage": {}
} }
}, },
@ -1889,7 +1889,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"nonce" : 0, "nonce" : 0,
"code" : "0x6010600f600e600d600c600b600a60096008600760066005600460036002600160039f57", "code" : "0x6010600f600e600d600c600b600a60096008600760066005600460036002600160039f55",
"storage": {} "storage": {}
} }
}, },

59
test/vmSha3TestFiller.json

@ -111,7 +111,7 @@
} }
}, },
"sha3_3": { "sha3_4": {
"env" : { "env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0", "currentNumber" : "0",
@ -137,8 +137,61 @@
"gasPrice" : "100000000000000", "gasPrice" : "100000000000000",
"gas" : "10000" "gas" : "10000"
} }
} },
"sha3_5": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
"currentGasLimit" : "1000000",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"nonce" : 0,
"code" : "{ [[ 0 ]] (SHA3 10000 0xfffffffff )}",
"storage": {}
}
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
"gasPrice" : "100000000000000",
"gas" : "10000"
}
},
"sha3_6": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
"currentGasLimit" : "1000000",
"currentDifficulty" : "256",
"currentTimestamp" : 1,
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"nonce" : 0,
"code" : "{ [[ 0 ]] (SHA3 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)}",
"storage": {}
}
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000",
"data" : "",
"gasPrice" : "100000000000000",
"gas" : "10000"
}
}
} }

Loading…
Cancel
Save