diff --git a/CMakeLists.txt b/CMakeLists.txt index ff8732156..667c2fb73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,6 +305,7 @@ endif() add_subdirectory(libdevcore) add_subdirectory(libevmcore) +add_subdirectory(libevmasm) add_subdirectory(liblll) if (SERPENT) diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index 9abb3f1a4..41d9ea10f 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -55,8 +55,7 @@ target_link_libraries(${EXECUTABLE} lll) if (SOLIDITY) target_link_libraries(${EXECUTABLE} solidity) endif () -target_link_libraries(${EXECUTABLE} evmcore) -target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} evmasm) target_link_libraries(${EXECUTABLE} web3jsonrpc) target_link_libraries(${EXECUTABLE} jsqrc) target_link_libraries(${EXECUTABLE} natspec) diff --git a/evmjit/libevmjit-cpp/Env.cpp b/evmjit/libevmjit-cpp/Env.cpp index b89aca726..2c37412fc 100644 --- a/evmjit/libevmjit-cpp/Env.cpp +++ b/evmjit/libevmjit-cpp/Env.cpp @@ -1,7 +1,7 @@ #pragma GCC diagnostic ignored "-Wconversion" #include -#include +#include #include #include "Utils.h" diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index e9ce070dc..24fc1cb65 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -23,10 +23,10 @@ #include #include #include +#include #include "EthashAux.h" #include "ProofOfWork.h" #include "Exceptions.h" -#include "Params.h" #include "BlockInfo.h" using namespace std; using namespace dev; diff --git a/libethcore/CMakeLists.txt b/libethcore/CMakeLists.txt index 1adb8428e..4dd626642 100644 --- a/libethcore/CMakeLists.txt +++ b/libethcore/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} ethash) target_link_libraries(${EXECUTABLE} devcrypto) -target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} evmcore) if (ETHASHCL) target_link_libraries(${EXECUTABLE} ethash-cl) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index dd7e92a66..ad7dfe53b 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include "BlockInfo.h" using namespace std; using namespace chrono; diff --git a/libethcore/Params.cpp b/libethcore/Params.cpp index 655c8a78b..a6107e62b 100644 --- a/libethcore/Params.cpp +++ b/libethcore/Params.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file FeeStructure.cpp +/** @file Params.cpp * @author Gav Wood * @date 2014 */ @@ -36,40 +36,6 @@ u256 const c_gasLimitBoundDivisor = 1024; u256 const c_minimumDifficulty = 131072; u256 const c_difficultyBoundDivisor = 2048; u256 const c_durationLimit = 8; -u256 const c_stackLimit = 1024; -u256 const c_tierStepGas[] = {0, 2, 3, 5, 8, 10, 20, 0}; -u256 const c_expGas = 10; -u256 const c_expByteGas = 10; -u256 const c_sha3Gas = 30; -u256 const c_sha3WordGas = 6; -u256 const c_sloadGas = 50; -u256 const c_sstoreSetGas = 20000; -u256 const c_sstoreResetGas = 5000; -u256 const c_sstoreRefundGas = 15000; -u256 const c_jumpdestGas = 1; -u256 const c_logGas = 375; -u256 const c_logDataGas = 8; -u256 const c_logTopicGas = 375; -u256 const c_createGas = 32000; -u256 const c_callGas = 40; -u256 const c_callStipend = 2300; -u256 const c_callValueTransferGas = 9000; -u256 const c_callNewAccountGas = 25000; -u256 const c_suicideRefundGas = 24000; -u256 const c_memoryGas = 3; -u256 const c_quadCoeffDiv = 512; -u256 const c_createDataGas = 200; -u256 const c_txGas = 21000; -u256 const c_txDataZeroGas = 4; -u256 const c_txDataNonZeroGas = 68; -u256 const c_copyGas = 3; -u256 const c_ecrecoverGas = 3000; -u256 const c_sha256Gas = 60; -u256 const c_sha256WordGas = 12; -u256 const c_ripemd160Gas = 600; -u256 const c_ripemd160WordGas = 120; -u256 const c_identityGas = 15; -u256 const c_identityWordGas = 3; //--- END: AUTOGENERATED FROM /feeStructure.json } diff --git a/libethcore/Params.h b/libethcore/Params.h index b957f9737..3520b2f1b 100644 --- a/libethcore/Params.h +++ b/libethcore/Params.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file FeeStructure.h +/** @file Params.h * @author Gav Wood * @date 2014 */ @@ -37,41 +37,6 @@ extern u256 const c_minimumDifficulty; extern u256 const c_difficultyBoundDivisor; extern u256 const c_durationLimit; extern u256 const c_maximumExtraDataSize; -extern u256 const c_stackLimit; - -extern u256 const c_tierStepGas[8]; ///< Once per operation, for a selection of them. -extern u256 const c_expGas; ///< Once per EXP instuction. -extern u256 const c_expByteGas; ///< Times ceil(log256(exponent)) for the EXP instruction. -extern u256 const c_sha3Gas; ///< Once per SHA3 operation. -extern u256 const c_sha3WordGas; ///< Once per word of the SHA3 operation's data. -extern u256 const c_copyGas; ///< Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added. -extern u256 const c_sloadGas; ///< Once per SLOAD operation. -extern u256 const c_sstoreSetGas; ///< Once per SSTORE operation if the zeroness changes from zero. -extern u256 const c_sstoreResetGas; ///< Once per SSTORE operation if the zeroness does not change from zero. NOTE: when c_sstoreSetGas does not apply. -extern u256 const c_sstoreRefundGas; ///< Refunded gas, once per SSTORE operation if the zeroness changes to zero. -extern u256 const c_jumpdestGas; ///< Once per JUMPDEST operation. -extern u256 const c_logGas; ///< Per LOG* operation. -extern u256 const c_logDataGas; ///< Per byte in a LOG* operation's data. -extern u256 const c_logTopicGas; ///< Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas. -extern u256 const c_createGas; ///< Once per CREATE operation & contract-creation transaction. -extern u256 const c_createDataGas; -extern u256 const c_callGas; ///< Once per CALL operation & message call transaction. -extern u256 const c_callStipend; ///< Free gas given at beginning of call. -extern u256 const c_callNewAccountGas; ///< Paid for CALL when the destination address didn't exist prior. -extern u256 const c_callValueTransferGas; ///< Paid for CALL when the value transfor is non-zero. -extern u256 const c_suicideRefundGas; ///< Refunded following a suicide operation. -extern u256 const c_memoryGas; ///< Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL. -extern u256 const c_quadCoeffDiv; ///< Divisor for the quadratic particle of the memory cost equation. -extern u256 const c_txGas; ///< Per transaction. NOTE: Not payable on data of calls between transactions. -extern u256 const c_txDataZeroGas; ///< Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. -extern u256 const c_txDataNonZeroGas; ///< Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. -extern u256 const c_ecrecoverGas; -extern u256 const c_sha256Gas; -extern u256 const c_sha256WordGas; -extern u256 const c_ripemd160Gas; -extern u256 const c_ripemd160WordGas; -extern u256 const c_identityGas; -extern u256 const c_identityWordGas; } } diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 204203c9d..955568c54 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "GenesisInfo.h" #include "State.h" diff --git a/libethereum/CanonBlockChain.cpp b/libethereum/CanonBlockChain.cpp index b5c47b653..2cc1d24dc 100644 --- a/libethereum/CanonBlockChain.cpp +++ b/libethereum/CanonBlockChain.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "GenesisInfo.h" #include "State.h" diff --git a/libethereum/Interface.h b/libethereum/Interface.h index 8fb94bdd0..ba68e976e 100644 --- a/libethereum/Interface.h +++ b/libethereum/Interface.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "LogFilter.h" #include "Transaction.h" diff --git a/libethereum/Precompiled.cpp b/libethereum/Precompiled.cpp index 62d159418..0fd5cb45b 100644 --- a/libethereum/Precompiled.cpp +++ b/libethereum/Precompiled.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include using namespace std; using namespace dev; using namespace dev::eth; diff --git a/libethereum/State.h b/libethereum/State.h index d02521c7a..e3468c24c 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "TransactionQueue.h" #include "Account.h" diff --git a/libethereum/Transaction.h b/libethereum/Transaction.h index 4271a5f27..2b11c52d6 100644 --- a/libethereum/Transaction.h +++ b/libethereum/Transaction.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace dev { namespace eth diff --git a/libevm/VM.h b/libevm/VM.h index 1cf06b78b..30007e0b3 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "VMFace.h" namespace dev diff --git a/libevmcore/Assembly.cpp b/libevmasm/Assembly.cpp similarity index 99% rename from libevmcore/Assembly.cpp rename to libevmasm/Assembly.cpp index eac946230..6cc09a4bc 100644 --- a/libevmcore/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -22,8 +22,8 @@ #include "Assembly.h" #include #include -#include -#include +#include +#include #include using namespace std; using namespace dev; diff --git a/libevmcore/Assembly.h b/libevmasm/Assembly.h similarity index 98% rename from libevmcore/Assembly.h rename to libevmasm/Assembly.h index 4ac873682..b4850f7d0 100644 --- a/libevmcore/Assembly.h +++ b/libevmasm/Assembly.h @@ -25,9 +25,9 @@ #include #include #include -#include #include -#include +#include +#include #include "Exceptions.h" #include diff --git a/libevmcore/AssemblyItem.cpp b/libevmasm/AssemblyItem.cpp similarity index 100% rename from libevmcore/AssemblyItem.cpp rename to libevmasm/AssemblyItem.cpp diff --git a/libevmcore/AssemblyItem.h b/libevmasm/AssemblyItem.h similarity index 98% rename from libevmcore/AssemblyItem.h rename to libevmasm/AssemblyItem.h index 7400954d3..6f2a65de9 100644 --- a/libevmcore/AssemblyItem.h +++ b/libevmasm/AssemblyItem.h @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include #include "Exceptions.h" namespace dev diff --git a/libevmasm/CMakeLists.txt b/libevmasm/CMakeLists.txt new file mode 100644 index 000000000..f8150806f --- /dev/null +++ b/libevmasm/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") + +aux_source_directory(. SRC_LIST) + +include_directories(BEFORE ${JSONCPP_INCLUDE_DIRS}) +include_directories(BEFORE ..) +include_directories(${Boost_INCLUDE_DIRS}) + +set(EXECUTABLE evmasm) + +file(GLOB HEADERS "*.h") + +if (ETH_STATIC) + add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) +else() + add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) +endif() + +target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} devcrypto) + +install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) +install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) + diff --git a/libevmcore/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp similarity index 99% rename from libevmcore/CommonSubexpressionEliminator.cpp rename to libevmasm/CommonSubexpressionEliminator.cpp index 65305b42a..63524d6f3 100644 --- a/libevmcore/CommonSubexpressionEliminator.cpp +++ b/libevmasm/CommonSubexpressionEliminator.cpp @@ -24,8 +24,8 @@ #include #include #include -#include -#include +#include +#include using namespace std; using namespace dev; diff --git a/libevmcore/CommonSubexpressionEliminator.h b/libevmasm/CommonSubexpressionEliminator.h similarity index 99% rename from libevmcore/CommonSubexpressionEliminator.h rename to libevmasm/CommonSubexpressionEliminator.h index 6001f1780..6156bc81a 100644 --- a/libevmcore/CommonSubexpressionEliminator.h +++ b/libevmasm/CommonSubexpressionEliminator.h @@ -30,8 +30,8 @@ #include #include #include -#include -#include +#include +#include namespace dev { diff --git a/libevmcore/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp similarity index 97% rename from libevmcore/ControlFlowGraph.cpp rename to libevmasm/ControlFlowGraph.cpp index ca20a8fb0..cc4367e64 100644 --- a/libevmcore/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -21,11 +21,11 @@ * Control flow analysis for the optimizer. */ -#include +#include #include -#include -#include -#include +#include +#include +#include using namespace std; using namespace dev; diff --git a/libevmcore/ControlFlowGraph.h b/libevmasm/ControlFlowGraph.h similarity index 100% rename from libevmcore/ControlFlowGraph.h rename to libevmasm/ControlFlowGraph.h diff --git a/libevmasm/Exceptions.h b/libevmasm/Exceptions.h new file mode 100644 index 000000000..7cc190e41 --- /dev/null +++ b/libevmasm/Exceptions.h @@ -0,0 +1,36 @@ +/* + 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 . +*/ +/** @file Exceptions.h + * @author Christian + * @date 2014 + */ + +#pragma once + +#include + +namespace dev +{ +namespace eth +{ + +struct AssemblyException: virtual Exception {}; +struct OptimizerException: virtual AssemblyException {}; +struct StackTooDeepException: virtual OptimizerException {}; + +} +} diff --git a/libevmcore/ExpressionClasses.cpp b/libevmasm/ExpressionClasses.cpp similarity index 99% rename from libevmcore/ExpressionClasses.cpp rename to libevmasm/ExpressionClasses.cpp index 7c5d9ad72..1e60a7fe8 100644 --- a/libevmcore/ExpressionClasses.cpp +++ b/libevmasm/ExpressionClasses.cpp @@ -21,14 +21,14 @@ * Container for equivalence classes of expressions for use in common subexpression elimination. */ -#include +#include #include #include #include #include #include -#include -#include +#include +#include using namespace std; using namespace dev; diff --git a/libevmcore/ExpressionClasses.h b/libevmasm/ExpressionClasses.h similarity index 99% rename from libevmcore/ExpressionClasses.h rename to libevmasm/ExpressionClasses.h index d5bf8e547..2f720f606 100644 --- a/libevmcore/ExpressionClasses.h +++ b/libevmasm/ExpressionClasses.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace dev { diff --git a/libevmcore/SemanticInformation.cpp b/libevmasm/SemanticInformation.cpp similarity index 97% rename from libevmcore/SemanticInformation.cpp rename to libevmasm/SemanticInformation.cpp index 3abb26dd9..83d59efc7 100644 --- a/libevmcore/SemanticInformation.cpp +++ b/libevmasm/SemanticInformation.cpp @@ -21,8 +21,8 @@ * Helper to provide semantic information about assembly items. */ -#include -#include +#include +#include using namespace std; using namespace dev; diff --git a/libevmcore/SemanticInformation.h b/libevmasm/SemanticInformation.h similarity index 100% rename from libevmcore/SemanticInformation.h rename to libevmasm/SemanticInformation.h diff --git a/libevmcore/SourceLocation.h b/libevmasm/SourceLocation.h similarity index 100% rename from libevmcore/SourceLocation.h rename to libevmasm/SourceLocation.h diff --git a/libevmcore/CMakeLists.txt b/libevmcore/CMakeLists.txt index 2da76882e..83042e65e 100644 --- a/libevmcore/CMakeLists.txt +++ b/libevmcore/CMakeLists.txt @@ -7,11 +7,8 @@ if (${CMAKE_MAJOR_VERSION} GREATER 2) endif() set(CMAKE_AUTOMOC OFF) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") - aux_source_directory(. SRC_LIST) -include_directories(BEFORE ${JSONCPP_INCLUDE_DIRS}) include_directories(BEFORE ..) include_directories(${Boost_INCLUDE_DIRS}) @@ -22,7 +19,6 @@ file(GLOB HEADERS "*.h") add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} devcore) -target_link_libraries(${EXECUTABLE} devcrypto) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libevmcore/Exceptions.h b/libevmcore/Exceptions.h index fa3c19f13..72af277df 100644 --- a/libevmcore/Exceptions.h +++ b/libevmcore/Exceptions.h @@ -28,11 +28,8 @@ namespace dev namespace eth { -struct AssemblyException: virtual Exception {}; -struct InvalidDeposit: virtual AssemblyException {}; -struct InvalidOpcode: virtual AssemblyException {}; -struct OptimizerException: virtual AssemblyException {}; -struct StackTooDeepException: virtual OptimizerException {}; +struct InvalidDeposit: virtual Exception {}; +struct InvalidOpcode: virtual Exception {}; } } diff --git a/libevmcore/Params.cpp b/libevmcore/Params.cpp new file mode 100644 index 000000000..91b50d0f6 --- /dev/null +++ b/libevmcore/Params.cpp @@ -0,0 +1,69 @@ +/* + 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 . +*/ +/** @file Params.cpp + * @author Gav Wood + * @date 2014 + */ + +#include "Params.h" + +using namespace std; +namespace dev +{ +namespace eth +{ + +//--- BEGIN: AUTOGENERATED FROM github.com/ethereum/common/params.json +u256 const c_stackLimit = 1024; +u256 const c_tierStepGas[] = {0, 2, 3, 5, 8, 10, 20, 0}; +u256 const c_expGas = 10; +u256 const c_expByteGas = 10; +u256 const c_sha3Gas = 30; +u256 const c_sha3WordGas = 6; +u256 const c_sloadGas = 50; +u256 const c_sstoreSetGas = 20000; +u256 const c_sstoreResetGas = 5000; +u256 const c_sstoreRefundGas = 15000; +u256 const c_jumpdestGas = 1; +u256 const c_logGas = 375; +u256 const c_logDataGas = 8; +u256 const c_logTopicGas = 375; +u256 const c_createGas = 32000; +u256 const c_callGas = 40; +u256 const c_callStipend = 2300; +u256 const c_callValueTransferGas = 9000; +u256 const c_callNewAccountGas = 25000; +u256 const c_suicideRefundGas = 24000; +u256 const c_memoryGas = 3; +u256 const c_quadCoeffDiv = 512; +u256 const c_createDataGas = 200; +u256 const c_txGas = 21000; +u256 const c_txDataZeroGas = 4; +u256 const c_txDataNonZeroGas = 68; +u256 const c_copyGas = 3; +u256 const c_ecrecoverGas = 3000; +u256 const c_sha256Gas = 60; +u256 const c_sha256WordGas = 12; +u256 const c_ripemd160Gas = 600; +u256 const c_ripemd160WordGas = 120; +u256 const c_identityGas = 15; +u256 const c_identityWordGas = 3; +//--- END: AUTOGENERATED FROM /feeStructure.json + +} +} + diff --git a/libevmcore/Params.h b/libevmcore/Params.h new file mode 100644 index 000000000..213ff5a2d --- /dev/null +++ b/libevmcore/Params.h @@ -0,0 +1,69 @@ +/* + 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 . +*/ +/** @file Params.h + * @author Gav Wood + * @date 2014 + */ + +#pragma once + +#include + +namespace dev +{ +namespace eth +{ + +//--- BEGIN: AUTOGENERATED FROM /feeStructure.json +extern u256 const c_stackLimit; + +extern u256 const c_tierStepGas[8]; ///< Once per operation, for a selection of them. +extern u256 const c_expGas; ///< Once per EXP instuction. +extern u256 const c_expByteGas; ///< Times ceil(log256(exponent)) for the EXP instruction. +extern u256 const c_sha3Gas; ///< Once per SHA3 operation. +extern u256 const c_sha3WordGas; ///< Once per word of the SHA3 operation's data. +extern u256 const c_copyGas; ///< Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added. +extern u256 const c_sloadGas; ///< Once per SLOAD operation. +extern u256 const c_sstoreSetGas; ///< Once per SSTORE operation if the zeroness changes from zero. +extern u256 const c_sstoreResetGas; ///< Once per SSTORE operation if the zeroness does not change from zero. NOTE: when c_sstoreSetGas does not apply. +extern u256 const c_sstoreRefundGas; ///< Refunded gas, once per SSTORE operation if the zeroness changes to zero. +extern u256 const c_jumpdestGas; ///< Once per JUMPDEST operation. +extern u256 const c_logGas; ///< Per LOG* operation. +extern u256 const c_logDataGas; ///< Per byte in a LOG* operation's data. +extern u256 const c_logTopicGas; ///< Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas. +extern u256 const c_createGas; ///< Once per CREATE operation & contract-creation transaction. +extern u256 const c_createDataGas; +extern u256 const c_callGas; ///< Once per CALL operation & message call transaction. +extern u256 const c_callStipend; ///< Free gas given at beginning of call. +extern u256 const c_callNewAccountGas; ///< Paid for CALL when the destination address didn't exist prior. +extern u256 const c_callValueTransferGas; ///< Paid for CALL when the value transfor is non-zero. +extern u256 const c_suicideRefundGas; ///< Refunded following a suicide operation. +extern u256 const c_memoryGas; ///< Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL. +extern u256 const c_quadCoeffDiv; ///< Divisor for the quadratic particle of the memory cost equation. +extern u256 const c_txGas; ///< Per transaction. NOTE: Not payable on data of calls between transactions. +extern u256 const c_txDataZeroGas; ///< Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. +extern u256 const c_txDataNonZeroGas; ///< Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. +extern u256 const c_ecrecoverGas; +extern u256 const c_sha256Gas; +extern u256 const c_sha256WordGas; +extern u256 const c_ripemd160Gas; +extern u256 const c_ripemd160WordGas; +extern u256 const c_identityGas; +extern u256 const c_identityWordGas; + +} +} diff --git a/liblll/CMakeLists.txt b/liblll/CMakeLists.txt index d3f465f37..66f32e4d8 100644 --- a/liblll/CMakeLists.txt +++ b/liblll/CMakeLists.txt @@ -21,8 +21,7 @@ file(GLOB HEADERS "*.h") add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) -target_link_libraries(${EXECUTABLE} evmcore) -target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} evmasm) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/liblll/CodeFragment.h b/liblll/CodeFragment.h index 554f90b46..03f812b60 100644 --- a/liblll/CodeFragment.h +++ b/liblll/CodeFragment.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include "Exceptions.h" namespace boost { namespace spirit { class utree; } } diff --git a/libsolidity/AST.h b/libsolidity/AST.h index c9ad6447e..fde0b71b0 100644 --- a/libsolidity/AST.h +++ b/libsolidity/AST.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libsolidity/ASTUtils.h b/libsolidity/ASTUtils.h index f2b90ea53..b24a34048 100644 --- a/libsolidity/ASTUtils.h +++ b/libsolidity/ASTUtils.h @@ -22,7 +22,7 @@ #pragma once -#include +#include #include namespace dev diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt index 3d31331a4..10c7bc2d2 100644 --- a/libsolidity/CMakeLists.txt +++ b/libsolidity/CMakeLists.txt @@ -22,7 +22,7 @@ file(GLOB HEADERS "*.h") add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) -target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} evmasm) target_link_libraries(${EXECUTABLE} devcrypto) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index d57f30c12..fb2ab3156 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libsolidity/Compiler.h b/libsolidity/Compiler.h index c3c3b9dcc..106038d1c 100644 --- a/libsolidity/Compiler.h +++ b/libsolidity/Compiler.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace dev { namespace solidity { diff --git a/libsolidity/CompilerContext.h b/libsolidity/CompilerContext.h index 0ca6369dd..933912455 100644 --- a/libsolidity/CompilerContext.h +++ b/libsolidity/CompilerContext.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libsolidity/Exceptions.h b/libsolidity/Exceptions.h index a0031ba7e..4bb6644b1 100644 --- a/libsolidity/Exceptions.h +++ b/libsolidity/Exceptions.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace dev { diff --git a/libsolidity/ExpressionCompiler.h b/libsolidity/ExpressionCompiler.h index 35526662a..45a2311ef 100644 --- a/libsolidity/ExpressionCompiler.h +++ b/libsolidity/ExpressionCompiler.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libsolidity/LValue.h b/libsolidity/LValue.h index ad6225162..1617e8167 100644 --- a/libsolidity/LValue.h +++ b/libsolidity/LValue.h @@ -23,7 +23,7 @@ #pragma once #include -#include +#include #include namespace dev diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp index 43571314a..37c358d3b 100644 --- a/libsolidity/Parser.cpp +++ b/libsolidity/Parser.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/libsolidity/Scanner.h b/libsolidity/Scanner.h index b57b8a189..43fcd133c 100644 --- a/libsolidity/Scanner.h +++ b/libsolidity/Scanner.h @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include namespace dev diff --git a/libsolidity/SourceReferenceFormatter.h b/libsolidity/SourceReferenceFormatter.h index ed2564f31..dd258c276 100644 --- a/libsolidity/SourceReferenceFormatter.h +++ b/libsolidity/SourceReferenceFormatter.h @@ -23,7 +23,7 @@ #pragma once #include -#include +#include namespace dev { diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 515123de5..636a665e6 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 3c6c3abdf..3f713a17b 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "SolidityType.h" class QTextDocument; diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index 3fb325bd4..b1d8f889e 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "Exceptions.h" using namespace std; diff --git a/mix/QBasicNodeDefinition.h b/mix/QBasicNodeDefinition.h index 9179905eb..6a327b734 100644 --- a/mix/QBasicNodeDefinition.h +++ b/mix/QBasicNodeDefinition.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace dev { diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index 8dcee7fb5..ccc4bf811 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -17,20 +17,20 @@ /** * @author Lefteris Karapetsas * @date 2015 - * Unit tests for Assembly Items from evmcore/Assembly.h + * Unit tests for Assembly Items from evmasm/Assembly.h */ #include #include #include #include -#include +#include +#include #include #include #include #include #include -#include using namespace std; using namespace dev::eth; diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index ceb9c68d9..9cdaa5886 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -26,9 +26,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include using namespace std; using namespace dev::eth;