Skip to content

Commit 5bb3a5e

Browse files
itamarcpsJean-Lessajcarraror
authored
Development 0.1.2 (#69)
* Revise and cleanup some stuff for #18 * Reflection interface for contracts * Revise Doxygen docs and code formatting everywhere * Go back to SemVer * Finish contract ABI generator * remove unnecessary headers * add uint128 support * add support for SafeUint128_t * ass support for SafeUint160_t * first adjust to reflect function with dynamic contract * Uncomment Patricia, fix Options SDKVersion * trying to deal with runtime inference * finish getData with any container * integrate register templates with DynamicContract class * finish dynamic contract reflection * fix formatting * Merge with v0.0.3 (#43) * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison * change docker docs and copy the local project to the docker local folder first * fix code formatting in readme * Bump version to release 0.0.3 --------- Co-authored-by: Julio Carraro <[email protected]> * Issue #30: Implement a JSON ABI Exporter using reflection (#38) * Reflection interface for contracts * Finish contract ABI generator * remove unnecessary headers * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * change generator to generate to work for many contracts --------- Co-authored-by: Itamar Carvalho <[email protected]> * Fix compiler issues * add support for generating many json ABIs and deleting the deprecated registerCoreFunctions method * Update README.md * Fix typo on README.md * add tests pipeline to develop and add abigenerator tests * fix reflection interface maps * Refactor std::string to std::vector/array/span for storing bytes (#45) * 23 abi refactor (#35) (#36) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Merge main into refactor-string (#41) * 23 abi refactor (#35) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * add rocksdb package to the vm * uncomment network deploy * parametrize AIO-setup arguments * dockerize the project and add instructions for using docker * change the project folder name on docker * Fix merge usage over SafeUnorderedMap * make docker use local repo as volume instead of cloning a repo * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Full refactor of std::string to std::vector/array/span. * Fix compiling issues with the merge * fix main.cpp * Deprecate Blockchain::parseRPC() from the header * Update src/contract/abi.h Co-authored-by: Julio Carraro <[email protected]> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * fix erc20 tests * install newer gcc for future C++23 support * Improve comments and indentation * Utils: fix unspecified comment block --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * update gcc using apt get * update synlinks to CI VM use gcc-12 instead of 11 * uint8 mapping was removed in some merge conflit, adding it back * put typemapping to abi types in abi namespace * implement manager interface as a standalone class * boilerplate for create and validate contract * add casting logic to createNewContract * finish cm refl * fix doxygen warnings * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * remove refl header from dynamiccontract header and ass debian container for pipeline * remove sudo * add noninteractive behaviour for apt * add git in pipeline packages * get ethash log * fix identing :( * add ca-certificates * add protobuf-dev * Fix formatting in contractmanager.h * add code formatter using clang * supress rdpos test * supress state tests * Suppress p2p tests * install doxygen on pipeline * Add tests for Hex::toInt() and Hex::forRPC() * Remove rogue Hex::toInt() test in utils.cpp * Utils: fix docs/add tests for appendBytes()/bytesToString()/stringToBytes() * Add tests for Hex::isValid() * #50 Implement robust return types for contract functions (#51) * register payable/public function with any return type * generate ContractManager ABI: * generate manager abi when generating customcontracts abis * create JsonAbi namespace for dealing with json abi files * debugging actions fs * debugging pipeline fs * simplify calls to another contract view funcs * debugging test json * debugging ERC20 and states * calling non view functions without encoding * trying to fix abi json tests * trying to fiz json abi tests * enable compiler errors if ununsed vars * calling createContract from dynamic contract * im getting insane. * return types for vew functions * remove pipeline debug * Update src/utils/jsonabi.h Co-authored-by: Jean Francisco Lessa <[email protected]> * ad todo in RegisterHelper template * create BytesEncoded typedef * trying to fix json permission in pipeline --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * mounting volume on pipeline for file issues * add pr template * fix some contracts characteristics * support for c++23 * register tuple of functions in the CM ABI generator * using github workspace path for abi tests * change abi generator tests to be static * supress p2p tests * add doxygen on pipeline * Refactor P2P (#54) * Refactor P2P * add missing doxygen docs and run all tests * add more sleep time for sleepy systems * Fix ManagerBase::answerSession shared_ptr segfault condition. * Remove #ifndef __MINGW32__ and add error handling conditions on ServerListener * Fix typo on Utils::logToDebug --------- Co-authored-by: jcarraror <[email protected]> * Fix ContractManager bug to ensure variable reversion upon exception (#55) * Move updateState() responsibility to ContractManager * Make ContractManager::contracts reversible * Update src/contract/contractmanager.h Co-authored-by: Jean Francisco Lessa <[email protected]> * Update Doxygen --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * register constructor with shared_ptr policy * Bump version to release 0.1.0 * update version on cmakelists * separate pipeline workflow in jobs * install cmake on build job * install needed dependencies for build job * add more deps * apt update on build * add permition to test binary * install dependencies for test job * update packages for test job * Sync development branch with main (#58) * Development (#56) * Revise and cleanup some stuff for #18 * Reflection interface for contracts * Revise Doxygen docs and code formatting everywhere * Go back to SemVer * Finish contract ABI generator * remove unnecessary headers * add uint128 support * add support for SafeUint128_t * ass support for SafeUint160_t * first adjust to reflect function with dynamic contract * Uncomment Patricia, fix Options SDKVersion * trying to deal with runtime inference * finish getData with any container * integrate register templates with DynamicContract class * finish dynamic contract reflection * fix formatting * Merge with v0.0.3 (#43) * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison * change docker docs and copy the local project to the docker local folder first * fix code formatting in readme * Bump version to release 0.0.3 --------- Co-authored-by: Julio Carraro <[email protected]> * Issue #30: Implement a JSON ABI Exporter using reflection (#38) * Reflection interface for contracts * Finish contract ABI generator * remove unnecessary headers * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * change generator to generate to work for many contracts --------- Co-authored-by: Itamar Carvalho <[email protected]> * Fix compiler issues * add support for generating many json ABIs and deleting the deprecated registerCoreFunctions method * Update README.md * Fix typo on README.md * add tests pipeline to develop and add abigenerator tests * fix reflection interface maps * Refactor std::string to std::vector/array/span for storing bytes (#45) * 23 abi refactor (#35) (#36) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Merge main into refactor-string (#41) * 23 abi refactor (#35) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * add rocksdb package to the vm * uncomment network deploy * parametrize AIO-setup arguments * dockerize the project and add instructions for using docker * change the project folder name on docker * Fix merge usage over SafeUnorderedMap * make docker use local repo as volume instead of cloning a repo * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Full refactor of std::string to std::vector/array/span. * Fix compiling issues with the merge * fix main.cpp * Deprecate Blockchain::parseRPC() from the header * Update src/contract/abi.h Co-authored-by: Julio Carraro <[email protected]> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * fix erc20 tests * install newer gcc for future C++23 support * Improve comments and indentation * Utils: fix unspecified comment block --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * update gcc using apt get * update synlinks to CI VM use gcc-12 instead of 11 * uint8 mapping was removed in some merge conflit, adding it back * put typemapping to abi types in abi namespace * implement manager interface as a standalone class * boilerplate for create and validate contract * add casting logic to createNewContract * finish cm refl * fix doxygen warnings * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * remove refl header from dynamiccontract header and ass debian container for pipeline * remove sudo * add noninteractive behaviour for apt * add git in pipeline packages * get ethash log * fix identing :( * add ca-certificates * add protobuf-dev * Fix formatting in contractmanager.h * add code formatter using clang * supress rdpos test * supress state tests * Suppress p2p tests * install doxygen on pipeline * Add tests for Hex::toInt() and Hex::forRPC() * Remove rogue Hex::toInt() test in utils.cpp * Utils: fix docs/add tests for appendBytes()/bytesToString()/stringToBytes() * Add tests for Hex::isValid() * #50 Implement robust return types for contract functions (#51) * register payable/public function with any return type * generate ContractManager ABI: * generate manager abi when generating customcontracts abis * create JsonAbi namespace for dealing with json abi files * debugging actions fs * debugging pipeline fs * simplify calls to another contract view funcs * debugging test json * debugging ERC20 and states * calling non view functions without encoding * trying to fix abi json tests * trying to fiz json abi tests * enable compiler errors if ununsed vars * calling createContract from dynamic contract * im getting insane. * return types for vew functions * remove pipeline debug * Update src/utils/jsonabi.h Co-authored-by: Jean Francisco Lessa <[email protected]> * ad todo in RegisterHelper template * create BytesEncoded typedef * trying to fix json permission in pipeline --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * mounting volume on pipeline for file issues * add pr template * fix some contracts characteristics * support for c++23 * register tuple of functions in the CM ABI generator * using github workspace path for abi tests * change abi generator tests to be static * supress p2p tests * add doxygen on pipeline * Refactor P2P (#54) * Refactor P2P * add missing doxygen docs and run all tests * add more sleep time for sleepy systems * Fix ManagerBase::answerSession shared_ptr segfault condition. * Remove #ifndef __MINGW32__ and add error handling conditions on ServerListener * Fix typo on Utils::logToDebug --------- Co-authored-by: jcarraror <[email protected]> * Fix ContractManager bug to ensure variable reversion upon exception (#55) * Move updateState() responsibility to ContractManager * Make ContractManager::contracts reversible * Update src/contract/contractmanager.h Co-authored-by: Jean Francisco Lessa <[email protected]> * Update Doxygen --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * register constructor with shared_ptr policy * Bump version to release 0.1.0 * update version on cmakelists * separate pipeline workflow in jobs * install cmake on build job * install needed dependencies for build job * add more deps * apt update on build * add permition to test binary * install dependencies for test job --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Update packages in test job (#57) * Revise and cleanup some stuff for #18 * Reflection interface for contracts * Revise Doxygen docs and code formatting everywhere * Go back to SemVer * Finish contract ABI generator * remove unnecessary headers * add uint128 support * add support for SafeUint128_t * ass support for SafeUint160_t * first adjust to reflect function with dynamic contract * Uncomment Patricia, fix Options SDKVersion * trying to deal with runtime inference * finish getData with any container * integrate register templates with DynamicContract class * finish dynamic contract reflection * fix formatting * Merge with v0.0.3 (#43) * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison * change docker docs and copy the local project to the docker local folder first * fix code formatting in readme * Bump version to release 0.0.3 --------- Co-authored-by: Julio Carraro <[email protected]> * Issue #30: Implement a JSON ABI Exporter using reflection (#38) * Reflection interface for contracts * Finish contract ABI generator * remove unnecessary headers * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * change generator to generate to work for many contracts --------- Co-authored-by: Itamar Carvalho <[email protected]> * Fix compiler issues * add support for generating many json ABIs and deleting the deprecated registerCoreFunctions method * Update README.md * Fix typo on README.md * add tests pipeline to develop and add abigenerator tests * fix reflection interface maps * Refactor std::string to std::vector/array/span for storing bytes (#45) * 23 abi refactor (#35) (#36) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Merge main into refactor-string (#41) * 23 abi refactor (#35) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * add rocksdb package to the vm * uncomment network deploy * parametrize AIO-setup arguments * dockerize the project and add instructions for using docker * change the project folder name on docker * Fix merge usage over SafeUnorderedMap * make docker use local repo as volume instead of cloning a repo * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Full refactor of std::string to std::vector/array/span. * Fix compiling issues with the merge * fix main.cpp * Deprecate Blockchain::parseRPC() from the header * Update src/contract/abi.h Co-authored-by: Julio Carraro <[email protected]> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * fix erc20 tests * install newer gcc for future C++23 support * Improve comments and indentation * Utils: fix unspecified comment block --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * update gcc using apt get * update synlinks to CI VM use gcc-12 instead of 11 * uint8 mapping was removed in some merge conflit, adding it back * put typemapping to abi types in abi namespace * implement manager interface as a standalone class * boilerplate for create and validate contract * add casting logic to createNewContract * finish cm refl * fix doxygen warnings * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * remove refl header from dynamiccontract header and ass debian container for pipeline * remove sudo * add noninteractive behaviour for apt * add git in pipeline packages * get ethash log * fix identing :( * add ca-certificates * add protobuf-dev * Fix formatting in contractmanager.h * add code formatter using clang * supress rdpos test * supress state tests * Suppress p2p tests * install doxygen on pipeline * Add tests for Hex::toInt() and Hex::forRPC() * Remove rogue Hex::toInt() test in utils.cpp * Utils: fix docs/add tests for appendBytes()/bytesToString()/stringToBytes() * Add tests for Hex::isValid() * #50 Implement robust return types for contract functions (#51) * register payable/public function with any return type * generate ContractManager ABI: * generate manager abi when generating customcontracts abis * create JsonAbi namespace for dealing with json abi files * debugging actions fs * debugging pipeline fs * simplify calls to another contract view funcs * debugging test json * debugging ERC20 and states * calling non view functions without encoding * trying to fix abi json tests * trying to fiz json abi tests * enable compiler errors if ununsed vars * calling createContract from dynamic contract * im getting insane. * return types for vew functions * remove pipeline debug * Update src/utils/jsonabi.h Co-authored-by: Jean Francisco Lessa <[email protected]> * ad todo in RegisterHelper template * create BytesEncoded typedef * trying to fix json permission in pipeline --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * mounting volume on pipeline for file issues * add pr template * fix some contracts characteristics * support for c++23 * register tuple of functions in the CM ABI generator * using github workspace path for abi tests * change abi generator tests to be static * supress p2p tests * add doxygen on pipeline * Refactor P2P (#54) * Refactor P2P * add missing doxygen docs and run all tests * add more sleep time for sleepy systems * Fix ManagerBase::answerSession shared_ptr segfault condition. * Remove #ifndef __MINGW32__ and add error handling conditions on ServerListener * Fix typo on Utils::logToDebug --------- Co-authored-by: jcarraror <[email protected]> * Fix ContractManager bug to ensure variable reversion upon exception (#55) * Move updateState() responsibility to ContractManager * Make ContractManager::contracts reversible * Update src/contract/contractmanager.h Co-authored-by: Jean Francisco Lessa <[email protected]> * Update Doxygen --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * register constructor with shared_ptr policy * Bump version to release 0.1.0 * update version on cmakelists * separate pipeline workflow in jobs * install cmake on build job * install needed dependencies for build job * add more deps * apt update on build * add permition to test binary * install dependencies for test job * update packages for test job --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Itamar Carvalho <[email protected]> --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * 53 implement safecontainers for arrays and vectors (#59) * Development (#56) * Revise and cleanup some stuff for #18 * Reflection interface for contracts * Revise Doxygen docs and code formatting everywhere * Go back to SemVer * Finish contract ABI generator * remove unnecessary headers * add uint128 support * add support for SafeUint128_t * ass support for SafeUint160_t * first adjust to reflect function with dynamic contract * Uncomment Patricia, fix Options SDKVersion * trying to deal with runtime inference * finish getData with any container * integrate register templates with DynamicContract class * finish dynamic contract reflection * fix formatting * Merge with v0.0.3 (#43) * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison * change docker docs and copy the local project to the docker local folder first * fix code formatting in readme * Bump version to release 0.0.3 --------- Co-authored-by: Julio Carraro <[email protected]> * Issue #30: Implement a JSON ABI Exporter using reflection (#38) * Reflection interface for contracts * Finish contract ABI generator * remove unnecessary headers * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * change generator to generate to work for many contracts --------- Co-authored-by: Itamar Carvalho <[email protected]> * Fix compiler issues * add support for generating many json ABIs and deleting the deprecated registerCoreFunctions method * Update README.md * Fix typo on README.md * add tests pipeline to develop and add abigenerator tests * fix reflection interface maps * Refactor std::string to std::vector/array/span for storing bytes (#45) * 23 abi refactor (#35) (#36) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Merge main into refactor-string (#41) * 23 abi refactor (#35) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * add rocksdb package to the vm * uncomment network deploy * parametrize AIO-setup arguments * dockerize the project and add instructions for using docker * change the project folder name on docker * Fix merge usage over SafeUnorderedMap * make docker use local repo as volume instead of cloning a repo * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Full refactor of std::string to std::vector/array/span. * Fix compiling issues with the merge * fix main.cpp * Deprecate Blockchain::parseRPC() from the header * Update src/contract/abi.h Co-authored-by: Julio Carraro <[email protected]> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * fix erc20 tests * install newer gcc for future C++23 support * Improve comments and indentation * Utils: fix unspecified comment block --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * update gcc using apt get * update synlinks to CI VM use gcc-12 instead of 11 * uint8 mapping was removed in some merge conflit, adding it back * put typemapping to abi types in abi namespace * implement manager interface as a standalone class * boilerplate for create and validate contract * add casting logic to createNewContract * finish cm refl * fix doxygen warnings * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * remove refl header from dynamiccontract header and ass debian container for pipeline * remove sudo * add noninteractive behaviour for apt * add git in pipeline packages * get ethash log * fix identing :( * add ca-certificates * add protobuf-dev * Fix formatting in contractmanager.h * add code formatter using clang * supress rdpos test * supress state tests * Suppress p2p tests * install doxygen on pipeline * Add tests for Hex::toInt() and Hex::forRPC() * Remove rogue Hex::toInt() test in utils.cpp * Utils: fix docs/add tests for appendBytes()/bytesToString()/stringToBytes() * Add tests for Hex::isValid() * #50 Implement robust return types for contract functions (#51) * register payable/public function with any return type * generate ContractManager ABI: * generate manager abi when generating customcontracts abis * create JsonAbi namespace for dealing with json abi files * debugging actions fs * debugging pipeline fs * simplify calls to another contract view funcs * debugging test json * debugging ERC20 and states * calling non view functions without encoding * trying to fix abi json tests * trying to fiz json abi tests * enable compiler errors if ununsed vars * calling createContract from dynamic contract * im getting insane. * return types for vew functions * remove pipeline debug * Update src/utils/jsonabi.h Co-authored-by: Jean Francisco Lessa <[email protected]> * ad todo in RegisterHelper template * create BytesEncoded typedef * trying to fix json permission in pipeline --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * mounting volume on pipeline for file issues * add pr template * fix some contracts characteristics * support for c++23 * register tuple of functions in the CM ABI generator * using github workspace path for abi tests * change abi generator tests to be static * supress p2p tests * add doxygen on pipeline * Refactor P2P (#54) * Refactor P2P * add missing doxygen docs and run all tests * add more sleep time for sleepy systems * Fix ManagerBase::answerSession shared_ptr segfault condition. * Remove #ifndef __MINGW32__ and add error handling conditions on ServerListener * Fix typo on Utils::logToDebug --------- Co-authored-by: jcarraror <[email protected]> * Fix ContractManager bug to ensure variable reversion upon exception (#55) * Move updateState() responsibility to ContractManager * Make ContractManager::contracts reversible * Update src/contract/contractmanager.h Co-authored-by: Jean Francisco Lessa <[email protected]> * Update Doxygen --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * register constructor with shared_ptr policy * Bump version to release 0.1.0 * update version on cmakelists * separate pipeline workflow in jobs * install cmake on build job * install needed dependencies for build job * add more deps * apt update on build * add permition to test binary * install dependencies for test job --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Add SafeVector type * Add more tests to SafeVector * Fix formatting * Add SafeArray type. * fix doxygen warnings * Update main.cpp --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Sync development with main (#62) * Development (#56) * Revise and cleanup some stuff for #18 * Reflection interface for contracts * Revise Doxygen docs and code formatting everywhere * Go back to SemVer * Finish contract ABI generator * remove unnecessary headers * add uint128 support * add support for SafeUint128_t * ass support for SafeUint160_t * first adjust to reflect function with dynamic contract * Uncomment Patricia, fix Options SDKVersion * trying to deal with runtime inference * finish getData with any container * integrate register templates with DynamicContract class * finish dynamic contract reflection * fix formatting * Merge with v0.0.3 (#43) * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison * change docker docs and copy the local project to the docker local folder first * fix code formatting in readme * Bump version to release 0.0.3 --------- Co-authored-by: Julio Carraro <[email protected]> * Issue #30: Implement a JSON ABI Exporter using reflection (#38) * Reflection interface for contracts * Finish contract ABI generator * remove unnecessary headers * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * change generator to generate to work for many contracts --------- Co-authored-by: Itamar Carvalho <[email protected]> * Fix compiler issues * add support for generating many json ABIs and deleting the deprecated registerCoreFunctions method * Update README.md * Fix typo on README.md * add tests pipeline to develop and add abigenerator tests * fix reflection interface maps * Refactor std::string to std::vector/array/span for storing bytes (#45) * 23 abi refactor (#35) (#36) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Merge main into refactor-string (#41) * 23 abi refactor (#35) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * add rocksdb package to the vm * uncomment network deploy * parametrize AIO-setup arguments * dockerize the project and add instructions for using docker * change the project folder name on docker * Fix merge usage over SafeUnorderedMap * make docker use local repo as volume instead of cloning a repo * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Full refactor of std::string to std::vector/array/span. * Fix compiling issues with the merge * fix main.cpp * Deprecate Blockchain::parseRPC() from the header * Update src/contract/abi.h Co-authored-by: Julio Carraro <[email protected]> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * fix erc20 tests * install newer gcc for future C++23 support * Improve comments and indentation * Utils: fix unspecified comment block --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * update gcc using apt get * update synlinks to CI VM use gcc-12 instead of 11 * uint8 mapping was removed in some merge conflit, adding it back * put typemapping to abi types in abi namespace * implement manager interface as a standalone class * boilerplate for create and validate contract * add casting logic to createNewContract * finish cm refl * fix doxygen warnings * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * remove refl header from dynamiccontract header and ass debian container for pipeline * remove sudo * add noninteractive behaviour for apt * add git in pipeline packages * get ethash log * fix identing :( * add ca-certificates * add protobuf-dev * Fix formatting in contractmanager.h * add code formatter using clang * supress rdpos test * supress state tests * Suppress p2p tests * install doxygen on pipeline * Add tests for Hex::toInt() and Hex::forRPC() * Remove rogue Hex::toInt() test in utils.cpp * Utils: fix docs/add tests for appendBytes()/bytesToString()/stringToBytes() * Add tests for Hex::isValid() * #50 Implement robust return types for contract functions (#51) * register payable/public function with any return type * generate ContractManager ABI: * generate manager abi when generating customcontracts abis * create JsonAbi namespace for dealing with json abi files * debugging actions fs * debugging pipeline fs * simplify calls to another contract view funcs * debugging test json * debugging ERC20 and states * calling non view functions without encoding * trying to fix abi json tests * trying to fiz json abi tests * enable compiler errors if ununsed vars * calling createContract from dynamic contract * im getting insane. * return types for vew functions * remove pipeline debug * Update src/utils/jsonabi.h Co-authored-by: Jean Francisco Lessa <[email protected]> * ad todo in RegisterHelper template * create BytesEncoded typedef * trying to fix json permission in pipeline --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * mounting volume on pipeline for file issues * add pr template * fix some contracts characteristics * support for c++23 * register tuple of functions in the CM ABI generator * using github workspace path for abi tests * change abi generator tests to be static * supress p2p tests * add doxygen on pipeline * Refactor P2P (#54) * Refactor P2P * add missing doxygen docs and run all tests * add more sleep time for sleepy systems * Fix ManagerBase::answerSession shared_ptr segfault condition. * Remove #ifndef __MINGW32__ and add error handling conditions on ServerListener * Fix typo on Utils::logToDebug --------- Co-authored-by: jcarraror <[email protected]> * Fix ContractManager bug to ensure variable reversion upon exception (#55) * Move updateState() responsibility to ContractManager * Make ContractManager::contracts reversible * Update src/contract/contractmanager.h Co-authored-by: Jean Francisco Lessa <[email protected]> * Update Doxygen --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * register constructor with shared_ptr policy * Bump version to release 0.1.0 * update version on cmakelists * separate pipeline workflow in jobs * install cmake on build job * install needed dependencies for build job * add more deps * apt update on build * add permition to test binary * install dependencies for test job --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Update packages in test job (#57) * Revise and cleanup some stuff for #18 * Reflection interface for contracts * Revise Doxygen docs and code formatting everywhere * Go back to SemVer * Finish contract ABI generator * remove unnecessary headers * add uint128 support * add support for SafeUint128_t * ass support for SafeUint160_t * first adjust to reflect function with dynamic contract * Uncomment Patricia, fix Options SDKVersion * trying to deal with runtime inference * finish getData with any container * integrate register templates with DynamicContract class * finish dynamic contract reflection * fix formatting * Merge with v0.0.3 (#43) * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison * change docker docs and copy the local project to the docker local folder first * fix code formatting in readme * Bump version to release 0.0.3 --------- Co-authored-by: Julio Carraro <[email protected]> * Issue #30: Implement a JSON ABI Exporter using reflection (#38) * Reflection interface for contracts * Finish contract ABI generator * remove unnecessary headers * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * change generator to generate to work for many contracts --------- Co-authored-by: Itamar Carvalho <[email protected]> * Fix compiler issues * add support for generating many json ABIs and deleting the deprecated registerCoreFunctions method * Update README.md * Fix typo on README.md * add tests pipeline to develop and add abigenerator tests * fix reflection interface maps * Refactor std::string to std::vector/array/span for storing bytes (#45) * 23 abi refactor (#35) (#36) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Merge main into refactor-string (#41) * 23 abi refactor (#35) * ABI: replace some string usage with string_view, deprecate JSONEncoder * Merge main to ABI (#34) * Replace LevelDB with RocksDB * Fix P2P deadlock over DiscoveryWorker * Stop sending invalid messages to Discovery nodes * Bump version to release 0.0.2 * Create c-cpp.yml * test pipeline * update pipeline * testing * add all deps * add cmake instead of make * run instead of uses * change distro to debian and generate doxygen * add tests and rollback to ubuntu (no support for pure debian) * Swap RocksDB with Speedb * Use merge on SafeUnorderedMap * Make Ninja compatible --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * ABI: reject Hex usage, embrace raw bytes --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * add rocksdb package to the vm * uncomment network deploy * parametrize AIO-setup arguments * dockerize the project and add instructions for using docker * change the project folder name on docker * Fix merge usage over SafeUnorderedMap * make docker use local repo as volume instead of cloning a repo * add composer file to manager dockerfile * remove local repo * fix volume base sintax * change for loop on AIO for windows compatibility * add sudo to the mac docker usage instructions * fix bash identing * add unison for bidiretional syncing * remove my personal dir * fix volume path * add sync config file for unison --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Full refactor of std::string to std::vector/array/span. * Fix compiling issues with the merge * fix main.cpp * Deprecate Blockchain::parseRPC() from the header * Update src/contract/abi.h Co-authored-by: Julio Carraro <[email protected]> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * fix erc20 tests * install newer gcc for future C++23 support * Improve comments and indentation * Utils: fix unspecified comment block --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * update gcc using apt get * update synlinks to CI VM use gcc-12 instead of 11 * uint8 mapping was removed in some merge conflit, adding it back * put typemapping to abi types in abi namespace * implement manager interface as a standalone class * boilerplate for create and validate contract * add casting logic to createNewContract * finish cm refl * fix doxygen warnings * Apply suggestions from code review Co-authored-by: Jean Francisco Lessa <[email protected]> * remove refl header from dynamiccontract header and ass debian container for pipeline * remove sudo * add noninteractive behaviour for apt * add git in pipeline packages * get ethash log * fix identing :( * add ca-certificates * add protobuf-dev * Fix formatting in contractmanager.h * add code formatter using clang * supress rdpos test * supress state tests * Suppress p2p tests * install doxygen on pipeline * Add tests for Hex::toInt() and Hex::forRPC() * Remove rogue Hex::toInt() test in utils.cpp * Utils: fix docs/add tests for appendBytes()/bytesToString()/stringToBytes() * Add tests for Hex::isValid() * #50 Implement robust return types for contract functions (#51) * register payable/public function with any return type * generate ContractManager ABI: * generate manager abi when generating customcontracts abis * create JsonAbi namespace for dealing with json abi files * debugging actions fs * debugging pipeline fs * simplify calls to another contract view funcs * debugging test json * debugging ERC20 and states * calling non view functions without encoding * trying to fix abi json tests * trying to fiz json abi tests * enable compiler errors if ununsed vars * calling createContract from dynamic contract * im getting insane. * return types for vew functions * remove pipeline debug * Update src/utils/jsonabi.h Co-authored-by: Jean Francisco Lessa <[email protected]> * ad todo in RegisterHelper template * create BytesEncoded typedef * trying to fix json permission in pipeline --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * mounting volume on pipeline for file issues * add pr template * fix some contracts characteristics * support for c++23 * register tuple of functions in the CM ABI generator * using github workspace path for abi tests * change abi generator tests to be static * supress p2p tests * add doxygen on pipeline * Refactor P2P (#54) * Refactor P2P * add missing doxygen docs and run all tests * add more sleep time for sleepy systems * Fix ManagerBase::answerSession shared_ptr segfault condition. * Remove #ifndef __MINGW32__ and add error handling conditions on ServerListener * Fix typo on Utils::logToDebug --------- Co-authored-by: jcarraror <[email protected]> * Fix ContractManager bug to ensure variable reversion upon exception (#55) * Move updateState() responsibility to ContractManager * Make ContractManager::contracts reversible * Update src/contract/contractmanager.h Co-authored-by: Jean Francisco Lessa <[email protected]> * Update Doxygen --------- Co-authored-by: Jean Francisco Lessa <[email protected]> * register constructor with shared_ptr policy * Bump version to release 0.1.0 * update version on cmakelists * separate pipeline workflow in jobs * install cmake on build job * install needed dependencies for build job * add more deps * apt update on build * add permition to test binary * install dependencies for test job * update packages for test job --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Itamar Carvalho <[email protected]> --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]> * Implement DEXV2Pair Contract * Implement DEXV2Factory * Add missing _mintFee function to DEXV2Pair * Implement DEXV2Library * Implement DEXV2Router02 * Fix bugs related with contract iteraction. * register functions with any uint params * Fix bug related with contract nested functionability. * Fix typo on DEXV2Router02::wrappedNative() * Fix RPC bad hex return for zero values * Implement Logger Class * Deprecate Utils::logToDebug() * Bump version to 0.1.2 * Add missing docs for doxygen * Remove Patricia, PNode and CMake caveat on README * Fix RPC Hex encoding * Update ContractABIGenerator Tests * Move DexV2 to own directory. * Add missing doxygen --------- Co-authored-by: Jean-Lessa <[email protected]> Co-authored-by: Julio Carraro <[email protected]> Co-authored-by: Julio Carraro <[email protected]>
1 parent 63a91f9 commit 5bb3a5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4479
-810
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
1717
endif()
1818

1919
# Project data
20-
project(orbitersdk VERSION 0.1.1 DESCRIPTION "Sparq subnet")
20+
project(orbitersdk VERSION 0.1.2 DESCRIPTION "Sparq subnet")
2121
set(CMAKE_CXX_STANDARD 23)
2222
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
2323
set(CMAKE_CXX_EXTENSIONS OFF)

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
alt="chat on Telegram"></a>
2121
</p>
2222

23-
Sparq subnet source code. See [Chapter 3.3 on the docs](https://github.com/SparqNet/sparq-docs/blob/main/Sparq_en-US/ch3/3-3.md) for an expanded version of this file.
23+
Sparq subnet source code. [See the docs](https://github.com/SparqNet/sparq-docs) for a more thorough look at the project.
2424

2525
If you are a developer, fill this form out for free support and additional incentives: https://forms.gle/m83ceG3XoJY3fpwU9
2626

@@ -65,13 +65,9 @@ If building with AvalancheGo support, you'll also need:
6565

6666
### One-liners
6767

68-
For **Debian 11 Bullseye or newer**:
68+
For **Debian 12 Bookworm or newer**:
6969
* `sudo apt install build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev libscrypt-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc`
7070

71-
#### Caveats
72-
73-
* **Debian 11 Bullseye and older**: CMake version from repos is too old (3.18.4), has to be installed manually from [their website](https://cmake.org/download)
74-
7571
## Documentation
7672

7773
We use [Doxygen](https://www.doxygen.nl/index.html) to generate documentation over the current source code. Run `doxygen` inside the project's root folder. Docs should be inside `docs/html`.

scripts/AIO-setup.sh

+14-14
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if [ "$DEPLOY" = true ]; then
130130
# Create the JSON files for the Discovery Node, Validators and Normal Nodes
131131
echo '{
132132
"rootPath": "discoveryNode",
133-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
133+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
134134
"version": 1,
135135
"chainID": 808080,
136136
"wsPort": 8080,
@@ -141,7 +141,7 @@ if [ "$DEPLOY" = true ]; then
141141
# Create the JSON file for the Validators
142142
echo '{
143143
"rootPath": "blockchain",
144-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
144+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
145145
"version": 1,
146146
"chainID": 808080,
147147
"wsPort": 8081,
@@ -157,7 +157,7 @@ if [ "$DEPLOY" = true ]; then
157157

158158
echo '{
159159
"rootPath": "blockchain",
160-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
160+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
161161
"version": 1,
162162
"chainID": 808080,
163163
"wsPort": 8082,
@@ -173,7 +173,7 @@ if [ "$DEPLOY" = true ]; then
173173

174174
echo '{
175175
"rootPath": "blockchain",
176-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
176+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
177177
"version": 1,
178178
"chainID": 808080,
179179
"wsPort": 8083,
@@ -189,7 +189,7 @@ if [ "$DEPLOY" = true ]; then
189189

190190
echo '{
191191
"rootPath": "blockchain",
192-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
192+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
193193
"version": 1,
194194
"chainID": 808080,
195195
"wsPort": 8084,
@@ -205,7 +205,7 @@ if [ "$DEPLOY" = true ]; then
205205

206206
echo '{
207207
"rootPath": "blockchain",
208-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
208+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
209209
"version": 1,
210210
"chainID": 808080,
211211
"wsPort": 8085,
@@ -222,7 +222,7 @@ if [ "$DEPLOY" = true ]; then
222222
# Create the json file for the Normal Nodes
223223
echo '{
224224
"rootPath": "blockchain",
225-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
225+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
226226
"version": 1,
227227
"chainID": 808080,
228228
"wsPort": 8086,
@@ -237,7 +237,7 @@ if [ "$DEPLOY" = true ]; then
237237

238238
echo '{
239239
"rootPath": "blockchain",
240-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
240+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
241241
"version": 1,
242242
"chainID": 808080,
243243
"wsPort": 8087,
@@ -252,7 +252,7 @@ if [ "$DEPLOY" = true ]; then
252252

253253
echo '{
254254
"rootPath": "blockchain",
255-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
255+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
256256
"version": 1,
257257
"chainID": 808080,
258258
"wsPort": 8088,
@@ -267,7 +267,7 @@ if [ "$DEPLOY" = true ]; then
267267

268268
echo '{
269269
"rootPath": "blockchain",
270-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
270+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
271271
"version": 1,
272272
"chainID": 808080,
273273
"wsPort": 8089,
@@ -282,7 +282,7 @@ if [ "$DEPLOY" = true ]; then
282282

283283
echo '{
284284
"rootPath": "blockchain",
285-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
285+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
286286
"version": 1,
287287
"chainID": 808080,
288288
"wsPort": 8110,
@@ -297,7 +297,7 @@ if [ "$DEPLOY" = true ]; then
297297

298298
echo '{
299299
"rootPath": "blockchain",
300-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
300+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
301301
"version": 1,
302302
"chainID": 808080,
303303
"wsPort": 8111,
@@ -312,7 +312,7 @@ if [ "$DEPLOY" = true ]; then
312312

313313
echo '{
314314
"rootPath": "blockchain",
315-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
315+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
316316
"version": 1,
317317
"chainID": 808080,
318318
"wsPort": 8110,
@@ -327,7 +327,7 @@ if [ "$DEPLOY" = true ]; then
327327

328328
echo '{
329329
"rootPath": "blockchain",
330-
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.1",
330+
"web3clientVersion": "OrbiterSDK/cpp/linux_x86-64/0.1.2",
331331
"version": 1,
332332
"chainID": 808080,
333333
"wsPort": 8111,

src/contract/CMakeLists.txt

+13
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ set(CONTRACT_HEADERS
55
${CMAKE_SOURCE_DIR}/src/contract/contractmanager.h
66
${CMAKE_SOURCE_DIR}/src/contract/erc20wrapper.h
77
${CMAKE_SOURCE_DIR}/src/contract/nativewrapper.h
8+
${CMAKE_SOURCE_DIR}/src/contract/variables/reentrancyguard.h
89
${CMAKE_SOURCE_DIR}/src/contract/variables/safebase.h
910
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint8_t.h
1011
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint16_t.h
1112
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint32_t.h
1213
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint64_t.h
14+
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint112_t.h
1315
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint128_t.h
1416
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint160_t.h
17+
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint224_t.h
1518
${CMAKE_SOURCE_DIR}/src/contract/variables/safeuint256_t.h
1619
${CMAKE_SOURCE_DIR}/src/contract/variables/safevector.h
1720
${CMAKE_SOURCE_DIR}/src/contract/variables/safearray.h
@@ -20,16 +23,26 @@ set(CONTRACT_HEADERS
2023
${CMAKE_SOURCE_DIR}/src/contract/variables/safeunorderedmap.h
2124
${CMAKE_SOURCE_DIR}/src/contract/variables/safebool.h
2225
${CMAKE_SOURCE_DIR}/src/contract/erc20.h
26+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2pair.h
27+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2factory.h
28+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2library.h
2329
${CMAKE_SOURCE_DIR}/src/contract/customcontracts.h
30+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2router02.h
31+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/uq112x112.h
2432
PARENT_SCOPE
2533
)
2634

2735
set(CONTRACT_SOURCES
2836
${CMAKE_SOURCE_DIR}/src/contract/abi.cpp
37+
${CMAKE_SOURCE_DIR}/src/contract/contract.cpp
2938
${CMAKE_SOURCE_DIR}/src/contract/contractmanager.cpp
3039
${CMAKE_SOURCE_DIR}/src/contract/dynamiccontract.cpp
3140
${CMAKE_SOURCE_DIR}/src/contract/nativewrapper.cpp
3241
${CMAKE_SOURCE_DIR}/src/contract/erc20.cpp
42+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2pair.cpp
43+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2factory.cpp
44+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2library.cpp
45+
${CMAKE_SOURCE_DIR}/src/contract/dexv2/dexv2router02.cpp
3346
${CMAKE_SOURCE_DIR}/src/contract/erc20wrapper.cpp
3447
PARENT_SCOPE
3548
)

src/contract/abi.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ struct ABIType<Address> {
8888
static constexpr Types value = Types::address; ///< ABI type is address.
8989
};
9090

91+
template <>
92+
struct ABIType<std::vector<Address>> {
93+
static constexpr Types value = Types::addressArr; ///< ABI type is address.
94+
};
95+
9196
/**
9297
* Specialization for bool.
9398
*/
@@ -247,7 +252,7 @@ Types inline getABIEnumFromString(const std::string& type) {
247252
if (it != typeMappings.end()) {
248253
return it->second;
249254
} else {
250-
throw std::runtime_error("Invalid type");
255+
throw std::runtime_error("Invalid type: " + type);
251256
}
252257
}
253258

@@ -546,7 +551,7 @@ Types inline getABIEnumFromString(const std::string& type) {
546551
case Types::bytesArr: return this->getData<std::vector<Bytes>>(index);
547552
case Types::string: return this->getData<std::string>(index);
548553
case Types::stringArr: return this->getData<std::vector<std::string>>(index);
549-
default: throw std::runtime_error("Invalid ABI::Types type");
554+
default: throw std::runtime_error("Invalid ABI::Types type: " + getStringFromABIEnum(type));
550555
}
551556
}
552557

src/contract/contract.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "contract.h"
2+
3+
Address ContractGlobals::coinbase = Address(Hex::toBytes("0x0000000000000000000000000000000000000000"));
4+
uint256_t ContractGlobals::blockHeight = 0;
5+
uint256_t ContractGlobals::blockTimestamp = 0;

src/contract/contract.h

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class BaseContract : public ContractLocals {
7575
Address contractCreator; ///< Address of the creator of the contract.
7676
uint64_t contractChainId; ///< Chain where the contract is deployed.
7777
protected:
78+
bool reentrancyLock = false; ///< Lock (for reentrancy).
7879
const std::unique_ptr<DB> &db; ///< Pointer to the DB instance.
7980
public:
8081
/**

src/contract/contractmanager.h

+13-8
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ContractManager : BaseContract {
102102
template <typename TContract>
103103
std::pair<Address, ABI::Decoder> setupNewContract(const ethCallInfo &callInfo) {
104104
// Check if caller is creator
105-
if (this->caller != this->getContractCreator()) {
105+
if (this->origin != this->getContractCreator()) {
106106
throw std::runtime_error("Only contract creator can create new contracts");
107107
}
108108

@@ -112,7 +112,7 @@ class ContractManager : BaseContract {
112112
throw std::runtime_error("Contract already exists");
113113
}
114114

115-
std::unique_lock lock(this->contractsMutex);
115+
/// std::unique_lock lock(this->contractsMutex);
116116
for (const auto &[protocolContractName, protocolContractAddress] : ProtocolContractAddresses) {
117117
if (protocolContractAddress == derivedContractAddress) {
118118
throw std::runtime_error("Contract already exists");
@@ -128,18 +128,21 @@ class ContractManager : BaseContract {
128128
* @tparam TContract The contract type to create.
129129
* @tparam TTuple The tuple type of the contract constructor arguments.
130130
* @tparam Is The indices of the tuple.
131+
* @param creator The address of the contract creator.
131132
* @param derivedContractAddress The address of the contract to create.
132133
* @param dataVec The vector of arguments to pass to the contract constructor.
133134
* @return A unique pointer to the newly created contract.
134135
* @throw runtime_error if any argument type mismatches.
135136
*/
136137
template <typename TContract, typename TTuple, std::size_t... Is>
137-
std::unique_ptr<TContract> createContractWithTuple(const Address& derivedContractAddress,
138+
std::unique_ptr<TContract> createContractWithTuple(
139+
const Address& creator,
140+
const Address& derivedContractAddress,
138141
const std::vector<std::any>& dataVec,
139142
std::index_sequence<Is...>) {
140143
try {
141144
return std::make_unique<TContract>(std::any_cast<typename std::tuple_element<Is, TTuple>::type>(dataVec[Is])...,
142-
*this->interface, derivedContractAddress, this->getCaller(), this->options->getChainID(), this->db
145+
*this->interface, derivedContractAddress, creator, this->options->getChainID(), this->db
143146
);
144147
} catch (const std::bad_any_cast& ex) {
145148
throw std::runtime_error("Mismatched argument types for contract constructor. Expected: " +
@@ -150,21 +153,23 @@ class ContractManager : BaseContract {
150153

151154
/**
152155
* Helper function to create a new contract from a given call info.
156+
* @param creator The address of the contract creator.
153157
* @param derivedContractAddress The address of the contract to create.
154158
* @param dataVec The vector of arguments to pass to the contract constructor.
155159
* @throw runtime_error if the size of the vector does not match the number of
156160
* arguments of the contract constructor.
157161
*/
158162
template <typename TContract, typename TTuple>
159-
std::unique_ptr<TContract> createContractWithTuple(const Address& derivedContractAddress, const std::vector<std::any>& dataVec) {
163+
std::unique_ptr<TContract> createContractWithTuple(const Address& creator,
164+
const Address& derivedContractAddress, const std::vector<std::any>& dataVec) {
160165
constexpr std::size_t TupleSize = std::tuple_size<TTuple>::value;
161166
if (TupleSize != dataVec.size()) {
162167
throw std::runtime_error("Not enough arguments provided for contract constructor. Expected: " +
163168
std::to_string(TupleSize) + ", got: " + std::to_string(dataVec.size())
164169
);
165170
}
166171
return createContractWithTuple<TContract, TTuple>(
167-
derivedContractAddress, dataVec, std::make_index_sequence<TupleSize>{}
172+
creator, derivedContractAddress, dataVec, std::make_index_sequence<TupleSize>{}
168173
);
169174
}
170175

@@ -203,11 +208,11 @@ class ContractManager : BaseContract {
203208
}
204209
}
205210

206-
auto contract = createContractWithTuple<TContract, ConstructorArguments>(derivedContractAddress, dataVector);
211+
auto contract = createContractWithTuple<TContract, ConstructorArguments>(std::get<0>(callInfo), derivedContractAddress, dataVector);
207212
/// Update the inner variables of the contract.
208213
/// The constructor can set SafeVariables values from the constructor.
209214
/// We need to take account of that and set the variables accordingly.
210-
this->updateState(true);
215+
// this->updateState(true);
211216
this->recentlyCreatedContracts.insert(derivedContractAddress);
212217
this->contracts.insert(std::make_pair(derivedContractAddress, std::move(contract)));
213218
}

src/contract/customcontracts.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include "erc20.h"
22
#include "erc20wrapper.h"
33
#include "nativewrapper.h"
4+
#include "dexv2/dexv2pair.h"
5+
#include "dexv2/dexv2factory.h"
6+
#include "dexv2/dexv2router02.h"
47

5-
using ContractTypes = std::tuple<ERC20, ERC20Wrapper, NativeWrapper>;
8+
using ContractTypes = std::tuple<ERC20, ERC20Wrapper, NativeWrapper, DEXV2Pair, DEXV2Factory, DEXV2Router02>;

0 commit comments

Comments
 (0)