Paweł Bylica
10 years ago
63 changed files with 4231 additions and 1300 deletions
@ -1,50 +1,19 @@ |
|||
{ |
|||
"predef": [ |
|||
"console", |
|||
"require", |
|||
"equal", |
|||
"test", |
|||
"testBoth", |
|||
"testWithDefault", |
|||
"raises", |
|||
"deepEqual", |
|||
"start", |
|||
"stop", |
|||
"ok", |
|||
"strictEqual", |
|||
"module", |
|||
"expect", |
|||
"reject", |
|||
"impl" |
|||
], |
|||
|
|||
"esnext": true, |
|||
"proto": true, |
|||
"node" : true, |
|||
"browser" : true, |
|||
"browserify" : true, |
|||
|
|||
"boss" : true, |
|||
"curly": false, |
|||
"debug": true, |
|||
"devel": true, |
|||
"browserify": true, |
|||
"bitwise": true, |
|||
"camelcase": true, |
|||
"eqeqeq": true, |
|||
"evil": true, |
|||
"forin": false, |
|||
"immed": false, |
|||
"laxbreak": false, |
|||
"newcap": true, |
|||
"noarg": true, |
|||
"noempty": false, |
|||
"nonew": false, |
|||
"nomen": false, |
|||
"onevar": false, |
|||
"plusplus": false, |
|||
"regexp": false, |
|||
"freeze": true, |
|||
"funcscope": false, |
|||
"maxcomplexity": 4, /* our target is 3! */ |
|||
"maxdepth": 3, |
|||
"maxerr": 50, |
|||
/*"maxlen": 80*/ /*this should be our goal*/ |
|||
"maxparams": 3, |
|||
"nonew": true, |
|||
"unused": true, |
|||
"undef": true, |
|||
"sub": true, |
|||
"strict": false, |
|||
"white": false, |
|||
"shadow": true, |
|||
"eqnull": true |
|||
} |
|||
"predef": [ |
|||
"console" |
|||
] |
|||
} |
|||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,223 @@ |
|||
/*
|
|||
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 Christian <c@ethdev.com> |
|||
* @date 2015 |
|||
* LValues for use in the expresison compiler. |
|||
*/ |
|||
|
|||
#include <libsolidity/LValue.h> |
|||
#include <libevmcore/Instruction.h> |
|||
#include <libsolidity/Types.h> |
|||
#include <libsolidity/AST.h> |
|||
#include <libsolidity/CompilerUtils.h> |
|||
|
|||
using namespace std; |
|||
using namespace dev; |
|||
using namespace solidity; |
|||
|
|||
|
|||
StackVariable::StackVariable(CompilerContext& _compilerContext, Declaration const& _declaration): |
|||
LValue(_compilerContext, _declaration.getType()), |
|||
m_baseStackOffset(m_context.getBaseStackOffsetOfVariable(_declaration)), |
|||
m_size(m_dataType->getSizeOnStack()) |
|||
{ |
|||
} |
|||
|
|||
void StackVariable::retrieveValue(SourceLocation const& _location, bool _remove) const |
|||
{ |
|||
(void)_remove; |
|||
unsigned stackPos = m_context.baseToCurrentStackOffset(m_baseStackOffset); |
|||
if (stackPos >= 15) //@todo correct this by fetching earlier or moving to memory
|
|||
BOOST_THROW_EXCEPTION(CompilerError() |
|||
<< errinfo_sourceLocation(_location) << errinfo_comment("Stack too deep.")); |
|||
for (unsigned i = 0; i < m_size; ++i) |
|||
m_context << eth::dupInstruction(stackPos + 1); |
|||
} |
|||
|
|||
void StackVariable::storeValue(Type const& _sourceType, SourceLocation const& _location, bool _move) const |
|||
{ |
|||
(void)_sourceType; |
|||
unsigned stackDiff = m_context.baseToCurrentStackOffset(m_baseStackOffset) - m_size + 1; |
|||
if (stackDiff > 16) |
|||
BOOST_THROW_EXCEPTION(CompilerError() |
|||
<< errinfo_sourceLocation(_location) << errinfo_comment("Stack too deep.")); |
|||
else if (stackDiff > 0) |
|||
for (unsigned i = 0; i < m_size; ++i) |
|||
m_context << eth::swapInstruction(stackDiff) << eth::Instruction::POP; |
|||
if (!_move) |
|||
retrieveValue(_location); |
|||
} |
|||
|
|||
void StackVariable::setToZero(SourceLocation const& _location) const |
|||
{ |
|||
unsigned stackDiff = m_context.baseToCurrentStackOffset(m_baseStackOffset); |
|||
if (stackDiff > 16) |
|||
BOOST_THROW_EXCEPTION(CompilerError() |
|||
<< errinfo_sourceLocation(_location) << errinfo_comment("Stack too deep.")); |
|||
solAssert(stackDiff >= m_size - 1, ""); |
|||
for (unsigned i = 0; i < m_size; ++i) |
|||
m_context << u256(0) << eth::swapInstruction(stackDiff + 1 - i) |
|||
<< eth::Instruction::POP; |
|||
} |
|||
|
|||
|
|||
StorageItem::StorageItem(CompilerContext& _compilerContext, Declaration const& _declaration): |
|||
StorageItem(_compilerContext, _declaration.getType()) |
|||
{ |
|||
m_context << m_context.getStorageLocationOfVariable(_declaration); |
|||
} |
|||
|
|||
StorageItem::StorageItem(CompilerContext& _compilerContext, TypePointer const& _type): |
|||
LValue(_compilerContext, _type) |
|||
{ |
|||
if (m_dataType->isValueType()) |
|||
{ |
|||
solAssert(m_dataType->getStorageSize() == m_dataType->getSizeOnStack(), ""); |
|||
solAssert(m_dataType->getStorageSize() <= numeric_limits<unsigned>::max(), |
|||
"The storage size of " + m_dataType->toString() + " should fit in an unsigned"); |
|||
m_size = unsigned(m_dataType->getStorageSize()); |
|||
} |
|||
else |
|||
m_size = 0; // unused
|
|||
} |
|||
|
|||
void StorageItem::retrieveValue(SourceLocation const&, bool _remove) const |
|||
{ |
|||
if (!m_dataType->isValueType()) |
|||
return; // no distinction between value and reference for non-value types
|
|||
if (!_remove) |
|||
m_context << eth::Instruction::DUP1; |
|||
if (m_size == 1) |
|||
m_context << eth::Instruction::SLOAD; |
|||
else |
|||
for (unsigned i = 0; i < m_size; ++i) |
|||
{ |
|||
m_context << eth::Instruction::DUP1 << eth::Instruction::SLOAD << eth::Instruction::SWAP1; |
|||
if (i + 1 < m_size) |
|||
m_context << u256(1) << eth::Instruction::ADD; |
|||
else |
|||
m_context << eth::Instruction::POP; |
|||
} |
|||
} |
|||
|
|||
void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _location, bool _move) const |
|||
{ |
|||
// stack layout: value value ... value target_ref
|
|||
if (m_dataType->isValueType()) |
|||
{ |
|||
if (!_move) // copy values
|
|||
{ |
|||
if (m_size + 1 > 16) |
|||
BOOST_THROW_EXCEPTION(CompilerError() |
|||
<< errinfo_sourceLocation(_location) << errinfo_comment("Stack too deep.")); |
|||
for (unsigned i = 0; i < m_size; ++i) |
|||
m_context << eth::dupInstruction(m_size + 1) << eth::Instruction::SWAP1; |
|||
} |
|||
if (m_size > 1) // store high index value first
|
|||
m_context << u256(m_size - 1) << eth::Instruction::ADD; |
|||
for (unsigned i = 0; i < m_size; ++i) |
|||
{ |
|||
if (i + 1 >= m_size) |
|||
m_context << eth::Instruction::SSTORE; |
|||
else |
|||
// stack here: value value ... value value (target_ref+offset)
|
|||
m_context << eth::Instruction::SWAP1 << eth::Instruction::DUP2 |
|||
<< eth::Instruction::SSTORE |
|||
<< u256(1) << eth::Instruction::SWAP1 << eth::Instruction::SUB; |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
solAssert(_sourceType.getCategory() == m_dataType->getCategory(), |
|||
"Wrong type conversation for assignment."); |
|||
if (m_dataType->getCategory() == Type::Category::Array) |
|||
{ |
|||
CompilerUtils(m_context).copyByteArrayToStorage( |
|||
dynamic_cast<ArrayType const&>(*m_dataType), |
|||
dynamic_cast<ArrayType const&>(_sourceType)); |
|||
if (_move) |
|||
m_context << eth::Instruction::POP; |
|||
} |
|||
else if (m_dataType->getCategory() == Type::Category::Struct) |
|||
{ |
|||
// stack layout: source_ref target_ref
|
|||
auto const& structType = dynamic_cast<StructType const&>(*m_dataType); |
|||
solAssert(structType == _sourceType, "Struct assignment with conversion."); |
|||
for (auto const& member: structType.getMembers()) |
|||
{ |
|||
// assign each member that is not a mapping
|
|||
TypePointer const& memberType = member.second; |
|||
if (memberType->getCategory() == Type::Category::Mapping) |
|||
continue; |
|||
m_context << structType.getStorageOffsetOfMember(member.first) |
|||
<< eth::Instruction::DUP3 << eth::Instruction::DUP2 << eth::Instruction::ADD; |
|||
// stack: source_ref target_ref member_offset source_member_ref
|
|||
StorageItem(m_context, memberType).retrieveValue(_location, true); |
|||
// stack: source_ref target_ref member_offset source_value...
|
|||
m_context << eth::dupInstruction(2 + memberType->getSizeOnStack()) |
|||
<< eth::dupInstruction(2 + memberType->getSizeOnStack()) << eth::Instruction::ADD; |
|||
// stack: source_ref target_ref member_offset source_value... target_member_ref
|
|||
StorageItem(m_context, memberType).storeValue(*memberType, _location, true); |
|||
m_context << eth::Instruction::POP; |
|||
} |
|||
if (_move) |
|||
m_context << eth::Instruction::POP; |
|||
else |
|||
m_context << eth::Instruction::SWAP1; |
|||
m_context << eth::Instruction::POP; |
|||
} |
|||
else |
|||
BOOST_THROW_EXCEPTION(InternalCompilerError() |
|||
<< errinfo_sourceLocation(_location) << errinfo_comment("Invalid non-value type for assignment.")); |
|||
} |
|||
} |
|||
|
|||
|
|||
void StorageItem::setToZero(SourceLocation const& _location) const |
|||
{ |
|||
(void)_location; |
|||
if (m_dataType->getCategory() == Type::Category::Array) |
|||
CompilerUtils(m_context).clearByteArray(dynamic_cast<ArrayType const&>(*m_dataType)); |
|||
else if (m_dataType->getCategory() == Type::Category::Struct) |
|||
{ |
|||
// stack layout: ref
|
|||
auto const& structType = dynamic_cast<StructType const&>(*m_dataType); |
|||
for (auto const& member: structType.getMembers()) |
|||
{ |
|||
// zero each member that is not a mapping
|
|||
TypePointer const& memberType = member.second; |
|||
if (memberType->getCategory() == Type::Category::Mapping) |
|||
continue; |
|||
m_context << structType.getStorageOffsetOfMember(member.first) |
|||
<< eth::Instruction::DUP2 << eth::Instruction::ADD; |
|||
StorageItem(m_context, memberType).setToZero(); |
|||
} |
|||
m_context << eth::Instruction::POP; |
|||
} |
|||
else |
|||
{ |
|||
if (m_size == 0) |
|||
m_context << eth::Instruction::POP; |
|||
for (unsigned i = 0; i < m_size; ++i) |
|||
if (i + 1 >= m_size) |
|||
m_context << u256(0) << eth::Instruction::SWAP1 << eth::Instruction::SSTORE; |
|||
else |
|||
m_context << u256(0) << eth::Instruction::DUP2 << eth::Instruction::SSTORE |
|||
<< u256(1) << eth::Instruction::ADD; |
|||
} |
|||
} |
@ -0,0 +1,112 @@ |
|||
/*
|
|||
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 Christian <c@ethdev.com> |
|||
* @date 2015 |
|||
* LValues for use in the expresison compiler. |
|||
*/ |
|||
|
|||
#pragma once |
|||
|
|||
#include <memory> |
|||
#include <libevmcore/SourceLocation.h> |
|||
|
|||
namespace dev |
|||
{ |
|||
namespace solidity |
|||
{ |
|||
|
|||
class Declaration; |
|||
class Type; |
|||
class CompilerContext; |
|||
|
|||
/**
|
|||
* Abstract class used to retrieve, delete and store data in lvalues/variables. |
|||
*/ |
|||
class LValue |
|||
{ |
|||
protected: |
|||
LValue(CompilerContext& _compilerContext, std::shared_ptr<Type const> const& _dataType): |
|||
m_context(_compilerContext), m_dataType(_dataType) {} |
|||
|
|||
public: |
|||
/// @returns true if this lvalue reference type occupies a slot on the stack.
|
|||
virtual bool storesReferenceOnStack() const = 0; |
|||
/// Copies the value of the current lvalue to the top of the stack and, if @a _remove is true,
|
|||
/// also removes the reference from the stack.
|
|||
/// @a _location source location of the current expression, used for error reporting.
|
|||
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const = 0; |
|||
/// Moves a value from the stack to the lvalue. Removes the value if @a _move is true.
|
|||
/// @a _location is the source location of the expression that caused this operation.
|
|||
/// Stack pre: value [lvalue_ref]
|
|||
/// Stack post: if !_move: value_of(lvalue_ref)
|
|||
virtual void storeValue(Type const& _sourceType, |
|||
SourceLocation const& _location = SourceLocation(), bool _move = false) const = 0; |
|||
/// Stores zero in the lvalue.
|
|||
/// @a _location is the source location of the requested operation
|
|||
virtual void setToZero(SourceLocation const& _location = SourceLocation()) const = 0; |
|||
|
|||
protected: |
|||
CompilerContext& m_context; |
|||
std::shared_ptr<Type const> m_dataType; |
|||
}; |
|||
|
|||
/**
|
|||
* Local variable that is completely stored on the stack. |
|||
*/ |
|||
class StackVariable: public LValue |
|||
{ |
|||
public: |
|||
explicit StackVariable(CompilerContext& _compilerContext, Declaration const& _declaration); |
|||
|
|||
virtual bool storesReferenceOnStack() const { return false; } |
|||
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|||
virtual void storeValue(Type const& _sourceType, |
|||
SourceLocation const& _location = SourceLocation(), bool _move = false) const override; |
|||
virtual void setToZero(SourceLocation const& _location = SourceLocation()) const override; |
|||
|
|||
private: |
|||
/// Base stack offset (@see CompilerContext::getBaseStackOffsetOfVariable) of the local variable.
|
|||
unsigned m_baseStackOffset; |
|||
/// Number of stack elements occupied by the value (not the reference).
|
|||
unsigned m_size; |
|||
}; |
|||
|
|||
/**
|
|||
* Reference to some item in storage. The (starting) position of the item is stored on the stack. |
|||
*/ |
|||
class StorageItem: public LValue |
|||
{ |
|||
public: |
|||
/// Constructs the LValue and pushes the location of @a _declaration onto the stack.
|
|||
explicit StorageItem(CompilerContext& _compilerContext, Declaration const& _declaration); |
|||
/// Constructs the LValue and assumes that the storage reference is already on the stack.
|
|||
explicit StorageItem(CompilerContext& _compilerContext, std::shared_ptr<Type const> const& _type); |
|||
virtual bool storesReferenceOnStack() const { return true; } |
|||
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|||
virtual void storeValue(Type const& _sourceType, |
|||
SourceLocation const& _location = SourceLocation(), bool _move = false) const override; |
|||
virtual void setToZero(SourceLocation const& _location = SourceLocation()) const override; |
|||
|
|||
private: |
|||
/// Number of stack elements occupied by the value (not the reference).
|
|||
/// Only used for value types.
|
|||
unsigned m_size; |
|||
}; |
|||
|
|||
} |
|||
} |
@ -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
|
|||
|
File diff suppressed because it is too large
@ -0,0 +1,352 @@ |
|||
{ |
|||
"QuadraticComplexitySolidity_CallDataCopy" : { |
|||
"env" : { |
|||
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "350000000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "500000000", |
|||
"//" : "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" : "5000000", |
|||
"code" : "{ (CALLDATACOPY 0 0 50000) }", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
"transaction" : |
|||
{ |
|||
"//" : "run(int256)", |
|||
"data" : "0x61a47706000000000000000000000000000000000000000000000000000000000000c350", |
|||
"gasLimit" : "904+68*x+e", |
|||
"gasLimit" : "350000000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "0", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "1" |
|||
} |
|||
}, |
|||
|
|||
"Call50000" : { |
|||
"env" : { |
|||
"currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "86000000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"aaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "7000", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xfffffffffffff", |
|||
"code" : "{ (for {} (< @i 50000) [i](+ @i 1) [[ 0 ]] (CALL 1600 0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 50000 0 0) ) [[ 1 ]] @i}", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
|
|||
"transaction" : |
|||
{ |
|||
"data" : "", |
|||
"gasLimit" : "85000000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "10" |
|||
} |
|||
}, |
|||
|
|||
"Callcode50000" : { |
|||
"env" : { |
|||
"currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "86000000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"aaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "7000", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xfffffffffffff", |
|||
"code" : "{ (for {} (< @i 50000) [i](+ @i 1) [[ 0 ]] (CALLCODE 1600 0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b 1 0 50000 0 0) ) [[ 1 ]] @i}", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
|
|||
"transaction" : |
|||
{ |
|||
"data" : "", |
|||
"gasLimit" : "85000000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "10" |
|||
} |
|||
}, |
|||
|
|||
"Create1000" : { |
|||
"env" : { |
|||
"currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "86000000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xfffffffffffff", |
|||
"code" : "{ (for {} (< @i 1000) [i](+ @i 1) [[ 0 ]] (CREATE 1 0 50000) ) [[ 1 ]] @i}", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
|
|||
"transaction" : |
|||
{ |
|||
"data" : "", |
|||
"gasLimit" : "85000000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "10" |
|||
} |
|||
}, |
|||
|
|||
"Call50000_ecrec" : { |
|||
"env" : { |
|||
"currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "95000000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "{ (for {} (< @i 50000) [i](+ @i 1) [[ 0 ]] (CALL 500 1 1 0 50000 0 0) ) [[ 1 ]] @i}", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
|
|||
"transaction" : |
|||
{ |
|||
"data" : "", |
|||
"gasLimit" : "94500000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "10" |
|||
} |
|||
}, |
|||
|
|||
"Call50000_sha256" : { |
|||
"env" : { |
|||
"currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "3925000000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xfffffffffffff", |
|||
"code" : "{ (for {} (< @i 50000) [i](+ @i 1) [[ 0 ]] (CALL 78200 2 1 0 50000 0 0) ) [[ 1 ]] @i}", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
|
|||
"transaction" : |
|||
{ |
|||
"data" : "", |
|||
"gasLimit" : "3925000000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "10" |
|||
} |
|||
}, |
|||
|
|||
"Call50000_rip160" : { |
|||
"env" : { |
|||
"currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "3925000000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xfffffffffffff", |
|||
"code" : "{ (for {} (< @i 50000) [i](+ @i 1) [[ 0 ]] (CALL 78200 3 1 0 50000 0 0) ) [[ 1 ]] @i}", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
|
|||
"transaction" : |
|||
{ |
|||
"data" : "", |
|||
"gasLimit" : "3925000000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "10" |
|||
} |
|||
}, |
|||
|
|||
"Call50000_identity" : { |
|||
"env" : { |
|||
"currentCoinbase" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"currentDifficulty" : "45678256", |
|||
"currentGasLimit" : "88250000", |
|||
"currentNumber" : "0", |
|||
"currentTimestamp" : 1, |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" |
|||
}, |
|||
"pre" : |
|||
{ |
|||
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xffffffffffffffffffffffffffffffff", |
|||
"code" : "", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
}, |
|||
|
|||
"bbbf5374fce5edbc8e2a8697c15331677e6ebf0b" : { |
|||
"balance" : "0xfffffffffffff", |
|||
"code" : "{ (for {} (< @i 50000) [i](+ @i 1) [[ 0 ]] (CALL 1564 4 1 0 50000 0 0) ) [[ 1 ]] @i}", |
|||
"nonce" : "0", |
|||
"storage" : { |
|||
} |
|||
} |
|||
}, |
|||
|
|||
"transaction" : |
|||
{ |
|||
"data" : "", |
|||
"gasLimit" : "88250000", |
|||
"gasPrice" : "1", |
|||
"nonce" : "", |
|||
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", |
|||
"to" : "bbbf5374fce5edbc8e2a8697c15331677e6ebf0b", |
|||
"value" : "10" |
|||
} |
|||
} |
|||
} |
File diff suppressed because it is too large
Loading…
Reference in new issue