aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-02-26 22:42:21 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-02-26 22:42:21 +0800
commit206d646dbfabd6cb8edea6c68d04d2bc32eb8cf9 (patch)
treee27256e3b1fc13375666e5b34248afa66d771351
parentc5b2733d1e405487b0b3d419b22a08883ac487dd (diff)
parent60ade5b33f004d64b4f55b5efc2f7083724d9682 (diff)
downloaddexon-solidity-206d646dbfabd6cb8edea6c68d04d2bc32eb8cf9.tar.gz
dexon-solidity-206d646dbfabd6cb8edea6c68d04d2bc32eb8cf9.tar.zst
dexon-solidity-206d646dbfabd6cb8edea6c68d04d2bc32eb8cf9.zip
Merge remote-tracking branch 'upstream/develop' into memTests
-rw-r--r--Assembly.cpp129
-rw-r--r--SolidityEndToEndTest.cpp103
-rw-r--r--SolidityExpressionCompiler.cpp3
-rw-r--r--SolidityInterface.cpp2
-rw-r--r--SolidityNameAndTypeResolution.cpp9
-rw-r--r--SolidityParser.cpp51
-rw-r--r--stSolidityTestFiller.json152
-rw-r--r--stTransactionTestFiller.json72
-rw-r--r--vmArithmeticTestFiller.json167
-rw-r--r--vmEnvironmentalInfoTestFiller.json30
-rw-r--r--vmIOandFlowOperationsTestFiller.json477
-rw-r--r--vmPushDupSwapTestFiller.json56
12 files changed, 1136 insertions, 115 deletions
diff --git a/Assembly.cpp b/Assembly.cpp
new file mode 100644
index 00000000..3869919e
--- /dev/null
+++ b/Assembly.cpp
@@ -0,0 +1,129 @@
+/*
+ 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/>.
+*/
+/**
+ * @author Lefteris Karapetsas <lefteris@ethdev.com>
+ * @date 2015
+ * Unit tests for Assembly Items from evmcore/Assembly.h
+ */
+
+#include <string>
+#include <iostream>
+#include <boost/test/unit_test.hpp>
+#include <libdevcore/Log.h>
+#include <libevmcore/SourceLocation.h>
+#include <libsolidity/Scanner.h>
+#include <libsolidity/Parser.h>
+#include <libsolidity/NameAndTypeResolver.h>
+#include <libsolidity/Compiler.h>
+#include <libsolidity/AST.h>
+#include <libevmcore/Assembly.h>
+
+using namespace std;
+using namespace dev::eth;
+
+namespace dev
+{
+namespace solidity
+{
+namespace test
+{
+
+namespace
+{
+
+eth::AssemblyItems compileContract(const string& _sourceCode)
+{
+ Parser parser;
+ ASTPointer<SourceUnit> sourceUnit;
+ BOOST_REQUIRE_NO_THROW(sourceUnit = parser.parse(make_shared<Scanner>(CharStream(_sourceCode))));
+ NameAndTypeResolver resolver({});
+ resolver.registerDeclarations(*sourceUnit);
+ for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes())
+ if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
+ {
+ BOOST_REQUIRE_NO_THROW(resolver.resolveNamesAndTypes(*contract));
+ }
+ for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes())
+ if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
+ {
+ BOOST_REQUIRE_NO_THROW(resolver.checkTypeRequirements(*contract));
+ }
+ for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes())
+ if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
+ {
+ Compiler compiler;
+ compiler.compileContract(*contract, map<ContractDefinition const*, bytes const*>{});
+
+ return compiler.getRuntimeAssemblyItems();
+ }
+ BOOST_FAIL("No contract found in source.");
+ return AssemblyItems();
+}
+
+void checkAssemblyLocations(AssemblyItems const& _items, std::vector<SourceLocation> _locations)
+{
+ size_t i = 0;
+ BOOST_CHECK_EQUAL(_items.size(), _locations.size());
+ for (auto const& it: _items)
+ {
+ BOOST_CHECK_MESSAGE(it.getLocation() == _locations[i],
+ std::string("Location mismatch for assembly item ") + std::to_string(i));
+ ++i;
+ }
+
+}
+
+} // end anonymous namespace
+
+BOOST_AUTO_TEST_SUITE(Assembly)
+
+BOOST_AUTO_TEST_CASE(location_test)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() returns (uint256 a)\n"
+ " {\n"
+ " return 16;\n"
+ " }\n"
+ "}\n";
+ std::shared_ptr<std::string const> n = make_shared<std::string>("source");
+ AssemblyItems items = compileContract(sourceCode);
+ std::vector<SourceLocation> locations {
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(), SourceLocation(),
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(), SourceLocation(), SourceLocation(),
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(0, 77, n), SourceLocation(0, 77, n),
+ SourceLocation(0, 77, n),
+ SourceLocation(18, 75, n), SourceLocation(40, 49, n),
+ SourceLocation(61, 70, n), SourceLocation(61, 70, n), SourceLocation(61, 70, n),
+ SourceLocation(), SourceLocation(),
+ SourceLocation(61, 70, n), SourceLocation(61, 70, n), SourceLocation(61, 70, n)
+ };
+ checkAssemblyLocations(items, locations);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+}
+}
+} // end namespaces
+
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index 20bc8159..f52b52d1 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -2137,7 +2137,7 @@ BOOST_AUTO_TEST_CASE(event_lots_of_data)
callContractFunctionWithValue("deposit(hash256)", value, id);
BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress);
- BOOST_CHECK(m_logs[0].data == encodeArgs(m_sender, id, value, true));
+ BOOST_CHECK(m_logs[0].data == encodeArgs((u160)m_sender, id, value, true));
BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::sha3(string("Deposit(address,hash256,uint256,bool)")));
}
@@ -2667,6 +2667,107 @@ BOOST_AUTO_TEST_CASE(bytes_in_arguments)
== encodeArgs(12, (8 + 9) * 3, 13, u256(innercalldata1.length())));
}
+BOOST_AUTO_TEST_CASE(fixed_arrays_in_storage)
+{
+ char const* sourceCode = R"(
+ contract c {
+ struct Data { uint x; uint y; }
+ Data[2**10] data;
+ uint[2**10 + 3] ids;
+ function setIDStatic(uint id) { ids[2] = id; }
+ function setID(uint index, uint id) { ids[index] = id; }
+ function setData(uint index, uint x, uint y) { data[index].x = x; data[index].y = y; }
+ function getID(uint index) returns (uint) { return ids[index]; }
+ function getData(uint index) returns (uint x, uint y) { x = data[index].x; y = data[index].y; }
+ function getLengths() returns (uint l1, uint l2) { l1 = data.length; l2 = ids.length; }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("setIDStatic(uint256)", 11) == bytes());
+ BOOST_CHECK(callContractFunction("getID(uint256)", 2) == encodeArgs(11));
+ BOOST_CHECK(callContractFunction("setID(uint256,uint256)", 7, 8) == bytes());
+ BOOST_CHECK(callContractFunction("getID(uint256)", 7) == encodeArgs(8));
+ BOOST_CHECK(callContractFunction("setData(uint256,uint256,uint256)", 7, 8, 9) == bytes());
+ BOOST_CHECK(callContractFunction("setData(uint256,uint256,uint256)", 8, 10, 11) == bytes());
+ BOOST_CHECK(callContractFunction("getData(uint256)", 7) == encodeArgs(8, 9));
+ BOOST_CHECK(callContractFunction("getData(uint256)", 8) == encodeArgs(10, 11));
+ BOOST_CHECK(callContractFunction("getLengths()") == encodeArgs(u256(1) << 10, (u256(1) << 10) + 3));
+}
+
+BOOST_AUTO_TEST_CASE(dynamic_arrays_in_storage)
+{
+ char const* sourceCode = R"(
+ contract c {
+ struct Data { uint x; uint y; }
+ Data[] data;
+ uint[] ids;
+ function setIDStatic(uint id) { ids[2] = id; }
+ function setID(uint index, uint id) { ids[index] = id; }
+ function setData(uint index, uint x, uint y) { data[index].x = x; data[index].y = y; }
+ function getID(uint index) returns (uint) { return ids[index]; }
+ function getData(uint index) returns (uint x, uint y) { x = data[index].x; y = data[index].y; }
+ function getLengths() returns (uint l1, uint l2) { l1 = data.length; l2 = ids.length; }
+ function setLengths(uint l1, uint l2) { data.length = l1; ids.length = l2; }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("getLengths()") == encodeArgs(0, 0));
+ BOOST_CHECK(callContractFunction("setLengths(uint256,uint256)", 48, 49) == bytes());
+ BOOST_CHECK(callContractFunction("getLengths()") == encodeArgs(48, 49));
+ BOOST_CHECK(callContractFunction("setIDStatic(uint256)", 11) == bytes());
+ BOOST_CHECK(callContractFunction("getID(uint256)", 2) == encodeArgs(11));
+ BOOST_CHECK(callContractFunction("setID(uint256,uint256)", 7, 8) == bytes());
+ BOOST_CHECK(callContractFunction("getID(uint256)", 7) == encodeArgs(8));
+ BOOST_CHECK(callContractFunction("setData(uint256,uint256,uint256)", 7, 8, 9) == bytes());
+ BOOST_CHECK(callContractFunction("setData(uint256,uint256,uint256)", 8, 10, 11) == bytes());
+ BOOST_CHECK(callContractFunction("getData(uint256)", 7) == encodeArgs(8, 9));
+ BOOST_CHECK(callContractFunction("getData(uint256)", 8) == encodeArgs(10, 11));
+}
+
+BOOST_AUTO_TEST_CASE(fixed_out_of_bounds_array_access)
+{
+ char const* sourceCode = R"(
+ contract c {
+ uint[4] data;
+ function set(uint index, uint value) returns (bool) { data[index] = value; return true; }
+ function get(uint index) returns (uint) { return data[index]; }
+ function length() returns (uint) { return data.length; }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("length()") == encodeArgs(4));
+ BOOST_CHECK(callContractFunction("set(uint256,uint256)", 3, 4) == encodeArgs(true));
+ BOOST_CHECK(callContractFunction("set(uint256,uint256)", 4, 5) == bytes());
+ BOOST_CHECK(callContractFunction("set(uint256,uint256)", 400, 5) == bytes());
+ BOOST_CHECK(callContractFunction("get(uint256)", 3) == encodeArgs(4));
+ BOOST_CHECK(callContractFunction("get(uint256)", 4) == bytes());
+ BOOST_CHECK(callContractFunction("get(uint256)", 400) == bytes());
+ BOOST_CHECK(callContractFunction("length()") == encodeArgs(4));
+}
+
+BOOST_AUTO_TEST_CASE(dynamic_out_of_bounds_array_access)
+{
+ char const* sourceCode = R"(
+ contract c {
+ uint[] data;
+ function enlarge(uint amount) returns (uint) { return data.length += amount; }
+ function set(uint index, uint value) returns (bool) { data[index] = value; return true; }
+ function get(uint index) returns (uint) { return data[index]; }
+ function length() returns (uint) { return data.length; }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("length()") == encodeArgs(0));
+ BOOST_CHECK(callContractFunction("get(uint256)", 3) == bytes());
+ BOOST_CHECK(callContractFunction("enlarge(uint256)", 4) == encodeArgs(4));
+ BOOST_CHECK(callContractFunction("length()") == encodeArgs(4));
+ BOOST_CHECK(callContractFunction("set(uint256,uint256)", 3, 4) == encodeArgs(true));
+ BOOST_CHECK(callContractFunction("get(uint256)", 3) == encodeArgs(4));
+ BOOST_CHECK(callContractFunction("length()") == encodeArgs(4));
+ BOOST_CHECK(callContractFunction("set(uint256,uint256)", 4, 8) == bytes());
+ BOOST_CHECK(callContractFunction("length()") == encodeArgs(4));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}
diff --git a/SolidityExpressionCompiler.cpp b/SolidityExpressionCompiler.cpp
index 9cd13dcf..3340334f 100644
--- a/SolidityExpressionCompiler.cpp
+++ b/SolidityExpressionCompiler.cpp
@@ -127,6 +127,7 @@ bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _
BOOST_REQUIRE(extractor.getExpression() != nullptr);
CompilerContext context;
+ context.resetVisitedNodes(contract);
context.setInheritanceHierarchy(inheritanceHierarchy);
unsigned parametersSize = _localVariables.size(); // assume they are all one slot on the stack
context.adjustStackOffset(parametersSize);
@@ -134,7 +135,7 @@ bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _
context.addVariable(dynamic_cast<VariableDeclaration const&>(resolveDeclaration(variable, resolver)),
parametersSize--);
- ExpressionCompiler::compileExpression(context, *extractor.getExpression());
+ ExpressionCompiler(context).compile(*extractor.getExpression());
for (vector<string> const& function: _functions)
context << context.getFunctionEntryLabel(dynamic_cast<FunctionDefinition const&>(resolveDeclaration(function, resolver)));
diff --git a/SolidityInterface.cpp b/SolidityInterface.cpp
index a73c118b..35471518 100644
--- a/SolidityInterface.cpp
+++ b/SolidityInterface.cpp
@@ -50,7 +50,7 @@ public:
string getSourcePart(ASTNode const& _node) const
{
- Location location = _node.getLocation();
+ SourceLocation location = _node.getLocation();
BOOST_REQUIRE(!location.isEmpty());
return m_interface.substr(location.start, location.end - location.start);
}
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp
index df970a6e..4809aac1 100644
--- a/SolidityNameAndTypeResolution.cpp
+++ b/SolidityNameAndTypeResolution.cpp
@@ -1176,6 +1176,15 @@ BOOST_AUTO_TEST_CASE(test_for_bug_override_function_with_bytearray_type)
BOOST_CHECK_NO_THROW(parseTextAndResolveNamesWithChecks(sourceCode));
}
+BOOST_AUTO_TEST_CASE(array_with_nonconstant_length)
+{
+ char const* text = R"(
+ contract c {
+ function f(uint a) { uint8[a] x; }
+ })";
+ BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}
diff --git a/SolidityParser.cpp b/SolidityParser.cpp
index 69bbc6e0..75eba8bc 100644
--- a/SolidityParser.cpp
+++ b/SolidityParser.cpp
@@ -480,6 +480,18 @@ BOOST_AUTO_TEST_CASE(statement_starting_with_type_conversion)
char const* text = "contract test {\n"
" function fun() {\n"
" uint64(2);\n"
+ " uint64[7](3);\n"
+ " uint64[](3);\n"
+ " }\n"
+ "}\n";
+ BOOST_CHECK_NO_THROW(parseText(text));
+}
+
+BOOST_AUTO_TEST_CASE(type_conversion_to_dynamic_array)
+{
+ char const* text = "contract test {\n"
+ " function fun() {\n"
+ " var x = uint64[](3);\n"
" }\n"
"}\n";
BOOST_CHECK_NO_THROW(parseText(text));
@@ -753,6 +765,45 @@ BOOST_AUTO_TEST_CASE(external_variable)
BOOST_CHECK_THROW(parseText(text), ParserError);
}
+BOOST_AUTO_TEST_CASE(arrays_in_storage)
+{
+ char const* text = R"(
+ contract c {
+ uint[10] a;
+ uint[] a2;
+ struct x { uint[2**20] b; y[0] c; }
+ struct y { uint d; mapping(uint=>x)[] e; }
+ })";
+ BOOST_CHECK_NO_THROW(parseText(text));
+}
+
+BOOST_AUTO_TEST_CASE(arrays_in_events)
+{
+ char const* text = R"(
+ contract c {
+ event e(uint[10] a, string7[8] indexed b, c[3] x);
+ })";
+ BOOST_CHECK_NO_THROW(parseText(text));
+}
+
+BOOST_AUTO_TEST_CASE(arrays_in_expressions)
+{
+ char const* text = R"(
+ contract c {
+ function f() { c[10] a = 7; uint8[10 * 2] x; }
+ })";
+ BOOST_CHECK_NO_THROW(parseText(text));
+}
+
+BOOST_AUTO_TEST_CASE(multi_arrays)
+{
+ char const* text = R"(
+ contract c {
+ mapping(uint => mapping(uint => int8)[8][][9])[] x;
+ })";
+ BOOST_CHECK_NO_THROW(parseText(text));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}
diff --git a/stSolidityTestFiller.json b/stSolidityTestFiller.json
index 973c52a8..253ba801 100644
--- a/stSolidityTestFiller.json
+++ b/stSolidityTestFiller.json
@@ -76,14 +76,6 @@
"//" : " if (!testCryptographicFunctions()) ",
"//" : " res = hash(int(res) + int(0x00000f0000000000000000000000000000000000000000000000000000000000)); ",
"//" : " ",
- "//" : " //Tested 27.01.2015 ",
- "//" : " //should run out of gas ",
- "//" : " //if (!testInfiniteLoop()) ",
- "//" : " // res = hash(int(res) + int(0x000f000000000000000000000000000000000000000000000000000000000000)); ",
- "//" : " // ",
- "//" : " //should run out of gas ",
- "//" : " //if (!testRecursiveMethods()) ",
- "//" : " // res = hash(int(res) + int(0x0000000000000000000000000000000000000000000000000000000000000000)); ",
"//" : " } ",
"//" : " ",
"//" : " function testCryptographicFunctions() returns (bool res) ",
@@ -155,25 +147,6 @@
"//" : " ",
"//" : " } ",
"//" : " ",
- "//" : " function testInfiniteLoop() returns (bool res) ",
- "//" : " { ",
- "//" : " res = false; ",
- "//" : " while(true){} ",
- "//" : " return true; ",
- "//" : " } ",
- "//" : " ",
- "//" : " function testRecursiveMethods() returns (bool res) ",
- "//" : " { ",
- "//" : " res = false; ",
- "//" : " testRecursiveMethods2(); ",
- "//" : " return true; ",
- "//" : " } ",
- "//" : " function testRecursiveMethods2() ",
- "//" : " { ",
- "//" : " testRecursiveMethods(); ",
- "//" : "} ",
- "//" : " ",
- "//" : " ",
"//" : " function testContractSuicide() returns (bool res) ",
"//" : " { ",
"//" : " TestContract a = new TestContract(); ",
@@ -219,7 +192,6 @@
"//" : " } ",
"//" : " } ",
"//" : " ",
- "//" : " ",
"//" : " if (i == 0) ",
"//" : " return true; ",
"//" : " ",
@@ -264,7 +236,7 @@
},
"pre" :
{
- "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "100000",
"//": "contract subcaller ",
"//": "{ ",
@@ -294,6 +266,12 @@
"nonce" : "0",
"storage" : {
}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
}
},
"transaction" :
@@ -304,7 +282,7 @@
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
- "to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "1"
}
},
@@ -320,7 +298,7 @@
},
"pre" :
{
- "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "100000",
"//" : "contract recursiveMethods ",
"//" : "{ ",
@@ -343,17 +321,23 @@
"nonce" : "0",
"storage" : {
}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
}
},
"transaction" :
{
"//" : "testRecursiveMethods()",
"data" : "0x981a3165",
- "gasLimit" : "7000",
+ "gasLimit" : "2000",
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
- "to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "1"
}
},
@@ -369,7 +353,7 @@
},
"pre" :
{
- "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "100000",
"//" : "contract recursiveMethods ",
"//" : "{ ",
@@ -392,6 +376,12 @@
"nonce" : "0",
"storage" : {
}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "500",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
}
},
"transaction" :
@@ -402,7 +392,7 @@
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
- "to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "1"
}
},
@@ -418,7 +408,7 @@
},
"pre" :
{
- "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "1000000",
"//" : "contract recursiveCreate1 ",
"//" : "{ ",
@@ -461,6 +451,12 @@
"nonce" : "0",
"storage" : {
}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "500000",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
}
},
"transaction" :
@@ -471,12 +467,12 @@
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
- "to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "1"
}
},
- "AmbigiousMethod" : {
+ "AmbiguousMethod" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "45678256",
@@ -487,12 +483,35 @@
},
"pre" :
{
- "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "100000",
+ "//" : "contract contract1 ",
+ "//" : "{ ",
+ "//" : " uint value; ",
+ "//" : " function run() ",
+ "//" : " { ",
+ "//" : " value = 225; ",
+ "//" : " } ",
+ "//" : "} ",
+ "//" : " ",
+ "//" : "contract contract2 ",
+ "//" : "{ ",
+ "//" : " uint value2; ",
+ "//" : " function run() ",
+ "//" : " { ",
+ "//" : " value2 = 335; ",
+ "//" : " } ",
+ "//" : "} ",
"code" : "0x60003560e060020a90048063c040622614601557005b601b6021565b60006000f35b61014f60008190555056",
"nonce" : "0",
"storage" : {
}
+ },
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "500",
+ "nonce" : "0",
+ "code" : "",
+ "storage": {}
}
},
"transaction" :
@@ -503,6 +522,61 @@
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+ "value" : "1"
+ }
+ },
+
+ "QuadraticComplexity" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "45678256",
+ "currentGasLimit" : "100000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : 1,
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "pre" :
+ {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "10000000",
+ "//" : "contract caller ",
+ "//" : "{ ",
+ "//" : " int value; ",
+ "//" : " function run(int count) ",
+ "//" : " { ",
+ "//" : " value = count; ",
+ "//" : " address a = 0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b; ",
+ "//" : " while(count > 0) ",
+ "//" : " { ",
+ "//" : " a.call('just', 'call'); ",
+ "//" : " count = count - 1; ",
+ "//" : " } ",
+ "//" : " } ",
+ "//" : "} ",
+ "code" : "0x60003560e060020a9004806361a4770614601557005b601e6004356024565b60006000f35b60008160008190555073b94f5374fce5edbc8e2a8697c15331677e6ebf0b90505b600082131560bf5780600160a060020a03166000600060007f6a7573740000000000000000000000000000000000000000000000000000000081526004017f63616c6c000000000000000000000000000000000000000000000000000000008152602001600060008560155a03f150506001820391506045565b505056",
+ "nonce" : "0",
+ "storage" : {
+ }
+ },
+
+ "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "100000",
+ "code" : "{ (CALLDATACOPY 0 0 32) }",
+ "nonce" : "0",
+ "storage" : {
+ }
+ }
+ },
+ "transaction" :
+ {
+ "//" : "run(int256)",
+ "data" : "0x61a47706000000000000000000000000000000000000000000000000000000000000c350",
+ "gasLimit" : "904+68*x+e",
+ "gasLimit" : "3500000",
+ "gasPrice" : "1",
+ "nonce" : "0",
+ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"value" : "1"
}
diff --git a/stTransactionTestFiller.json b/stTransactionTestFiller.json
index 73026608..37b752f8 100644
--- a/stTransactionTestFiller.json
+++ b/stTransactionTestFiller.json
@@ -842,78 +842,6 @@
}
},
- "TransactionMakeAccountBalanceOverflow" : {
- "env" : {
- "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
- "currentDifficulty" : "45678256",
- "currentGasLimit" : "1000000",
- "currentNumber" : "0",
- "currentTimestamp" : 1,
- "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
- },
- "pre" :
- {
- "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
- "balance" : "100000",
- "code" : "",
- "nonce" : "0",
- "storage" : {
- }
- },
-
- "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
- "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
- "code" : "",
- "nonce" : "0",
- "storage" : {
- }
- }
- },
- "transaction" :
- {
- "data" : "",
- "gasLimit" : "1000",
- "gasPrice" : "1",
- "nonce" : "0",
- "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
- "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
- "value" : "100"
- }
- },
-
- "TransactionMakeAccountNonceOverflow" : {
- "env" : {
- "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
- "currentDifficulty" : "1",
- "currentGasLimit" : "1000000",
- "currentNumber" : "0",
- "currentTimestamp" : 1,
- "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
- },
- "pre" :
- {
- "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
- "balance" : "100000",
- "code" : "",
- "nonce" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
- "nonce" : "10000",
- "storage" : {
- }
- }
- },
- "transaction" :
- {
- "data" : "",
- "gasLimit" : "1000",
- "gasPrice" : "1",
- "nonce" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
- "nonce" : "10000",
- "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
- "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
- "value" : "100"
- }
- },
-
"UserTransactionZeroCost" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
diff --git a/vmArithmeticTestFiller.json b/vmArithmeticTestFiller.json
index 329e2e50..36d11875 100644
--- a/vmArithmeticTestFiller.json
+++ b/vmArithmeticTestFiller.json
@@ -365,6 +365,33 @@
}
},
+ "mul7": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 0x1234567890abcdef0fedcba0987654321 0x1234567890abcdef0fedcba0987654321 0x1234567890abcdef0fedcba0987654321 MUL MUL 0 MSTORE 32 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
"sub0": {
"env" : {
@@ -534,6 +561,34 @@
}
},
+ "div1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 0x2 0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 DIV 0 MSTORE 32 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
"divByNonZero0": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
@@ -1627,6 +1682,34 @@
}
},
+ "mulmod4": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 100 27 37 MULMOD 0 MSTORE8 0 1 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
"mulmoddivByZero": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
@@ -4370,5 +4453,89 @@
"gasPrice" : "100000000000000",
"gas" : "10000"
}
+ },
+
+ "not1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 123456 0 MSTORE 0 MLOAD NOT 0 MSTORE 32 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "arith1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 1 1 SWAP1 ADD 7 MUL 5 ADD 2 SWAP1 DIV 4 SWAP1 1 33 SWAP1 SDIV 21 ADD 3 MUL 5 SWAP1 SMOD 3 SUB 9 17 EXP 0 MSTORE 8 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "fibbonacci_unrolled": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 1 1 DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD DUP2 DUP2 ADD 0 MSTORE 32 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
}
}
diff --git a/vmEnvironmentalInfoTestFiller.json b/vmEnvironmentalInfoTestFiller.json
index bca2c387..3f99b3db 100644
--- a/vmEnvironmentalInfoTestFiller.json
+++ b/vmEnvironmentalInfoTestFiller.json
@@ -1158,6 +1158,34 @@
"gasPrice" : "123456789",
"gas" : "100000000000"
}
- }
+ },
+
+ "env1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "5211",
+ "currentGasLimit" : "10000013",
+ "currentDifficulty" : "231883281",
+ "currentTimestamp" : "42",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "10000000000000033000",
+ "nonce" : "88",
+ "code" : "(asm PC ADDRESS BALANCE CALLER ORIGIN CALLVALUE CALLDATASIZE GASPRICE PREVHASH COINBASE TIMESTAMP NUMBER DIFFICULTY GASLIMIT PC CALLDATASIZE 0 CALLDATALOAD 38 CALLDATALOAD 19 CALLDATALOAD CODESIZE 0x1111222233334444555566667777888899990000aaaabbbbccccddddeeeeffff 0 MSTORE 32 0 0 CREATE 32 0 32 0 0 ADDRESS 3000 CALL 0 MLOAD 4096 MSTORE MSIZE 32 MUL 0 SHA3 ADDRESS SUICIDE 1 2 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "10000000001111111",
+ "data" : "0xdeadbeef",
+ "gasPrice" : "2015",
+ "gas" : "100000000001"
+ }
+ },
}
diff --git a/vmIOandFlowOperationsTestFiller.json b/vmIOandFlowOperationsTestFiller.json
index e794fb2c..6822b3fc 100644
--- a/vmIOandFlowOperationsTestFiller.json
+++ b/vmIOandFlowOperationsTestFiller.json
@@ -3003,5 +3003,482 @@
"gasPrice" : "100000000000000",
"gas" : "10000"
}
+ },
+
+ "byte1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 0x112233445566778899001122334455667788990011223344556677889900aabb 0 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 1 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 2 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 3 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 4 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 5 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 6 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 7 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 8 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 9 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 10 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 11 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 12 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 13 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 14 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 15 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 16 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 17 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 18 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 19 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 20 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 21 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 22 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 23 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 24 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 25 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 26 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 27 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 28 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 29 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 30 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 31 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 32 BYTE 0x112233445566778899001122334455667788990011223344556677889900aabb 2014 BYTE 0 0 SSTORE)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "memory1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 2 0 MSTORE8 3 1 MSTORE8 0 MLOAD 1 MLOAD ADD 2 MSTORE 64 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "return1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 1 1000000 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "return2": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [i] 1 ( if (> @i 0) { (return 39) [i] 2 } (return 1) ) }",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "stackjump1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 0x4 0x6 0x9 0x14 JUMP JUMPDEST 0xa SUB 0x0 MSTORE MSIZE 0x0 RETURN JUMPDEST 0x0 MSTORE ADD 0x9 JUMP)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "kv1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "{ [[69]] (caller) (return 0 (lll (when (= (caller) @@69) (for {} (< @i (calldatasize)) [i](+ @i 64) [[ (calldataload @i) ]] (calldataload (+ @i 32)) ) ) 0))}",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "jumpi_at_the_end" : {
+ "env" : {
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+ "currentDifficulty" : "256",
+ "currentGasLimit" : "10000000",
+ "currentNumber" : "0",
+ "currentTimestamp" : "1",
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "code" : "(asm 10 0 MSTORE JUMPDEST 0 MLOAD 1 SWAP1 SUB DUP1 0 MSTORE 6 JUMPI)",
+ "data" : "0x",
+ "gas" : "1000",
+ "gasPrice" : "100000000000000",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "code" : "(asm 10 0 MSTORE JUMPDEST 0 MLOAD 1 SWAP1 SUB DUP1 0 MSTORE 5 JUMPI)",
+ "nonce" : "0",
+ "storage" : {}
+ }
+ }
+ },
+
+ "bad_indirect_jump1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 27 37 MUL JUMP JUMPDEST)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "bad_indirect_jump2": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 1 3 3 MUL JUMPI 0 0 JUMP)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "for_loop1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(for [i]:10 (> @i 0) [i](- @i 1) [j](+ @i @j))",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "for_loop2": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(for [i]:0 (< @i 10) [i](+ @i 1) [j](+ @i @j))",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "indirect_jump1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 4 3 ADD JUMP STOP JUMPDEST 1 0 MSTORE MSIZE 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "indirect_jump2": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 8 6 ADD JUMP STOP JUMPDEST 1 0 MSTORE STOP JUMPDEST 2 0 MSTORE MSIZE 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "indirect_jump3": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 1 4 5 ADD JUMPI STOP JUMPDEST 1 0 MSTORE MSIZE 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "indirect_jump4": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 0 7 5 ADD JUMPI 1 0 MSTORE STOP JUMPDEST)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "stack_loop": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 10 JUMPDEST 1 DUP2 SUB DUP1 2 JUMPI 0 MSTORE8 1 MSTORE8 2 MSTORE8 3 MSTORE8 4 MSTORE8 5 MSTORE8 6 MSTORE8 7 MSTORE8 8 MSTORE8 9 MSTORE8 MSIZE 0 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "when": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(when (> 1 0) [i] 13)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
}
}
diff --git a/vmPushDupSwapTestFiller.json b/vmPushDupSwapTestFiller.json
index a9b69f79..1aca4792 100644
--- a/vmPushDupSwapTestFiller.json
+++ b/vmPushDupSwapTestFiller.json
@@ -981,6 +981,34 @@
}
},
+ "push33": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 101 2002 303303 40444404 50555555505 60666666666606 7777777777777777 888888888888888888 99999999999999999999 10000000000000000000001 10111111111111111111111101 2022222222222222222222222202 303333333333333333333333333303 4044444444444444444444444444444404 505555555555555555555555555555555505 60666666666666666666666666666666666606 7077777777777777777777777777777777777707 808888888888888888888888888888888888888808 90999999999999999999999999999999999999999909 100000000000000000000000000000000000000000000001 10111111111111111111111111111111111111111111111101 2022222222222222222222222222222222222222222222222202 303333333333333333333333333333333333333333333333333303 40444444444444444444444444444444444444444444444444444404 50555555555555555555555555555555555555555555555555555555505 6066666666666666666666666666666666666666666666666666666666606 707777777777777777777777777777777777777777777777777777777777707 808888888888888888888888888888888888888888888888888888888888888808 90999999999999999999999999999999999999999999999999999999999999999909 100000000000000000000000000000000000000000000000000000000000000000000001 10111111111111111111111111111111111111111111111111111111111111111111111101 2022222222222222222222222222222222222222222222222222222222222222222222222202)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "32"
+ }
+ },
+
"dup1": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
@@ -1931,5 +1959,33 @@
"gasPrice" : "100000000000000",
"gas" : "10000"
}
+ },
+
+ "swapjump1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "code" : "(asm 5 2 1 12 JUMPI POP POP STOP JUMPDEST SWAP1 1 22 JUMPI POP POP STOP JUMPDEST SUB 0 MSTORE 1 31 RETURN)",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
}
}