mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add infrastructure for precompiled smartcontracts (#927)
* Utils for writing precompiled contracts * Precompiled contracts in config, override gas_usage for them * Add base class for precompiled contracts * Improve utils for precompiled smc * Implement GETPRECOMPILEDGAS * Enable precompiles by flag * Process null data in PrecompiledSmartContract * Fix ton_block wasm build * Fix vm::util::store_(u)long --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
b09f910bf2
commit
9d05696452
21 changed files with 991 additions and 95 deletions
|
@ -72,6 +72,7 @@
|
|||
#include "block-auto.h"
|
||||
#include "block-parse.h"
|
||||
#include "common/delay.h"
|
||||
#include "block/precompiled-smc/PrecompiledSmartContract.h"
|
||||
|
||||
Config::Config() {
|
||||
out_port = 3278;
|
||||
|
@ -3812,6 +3813,9 @@ int main(int argc, char *argv[]) {
|
|||
acts.push_back([&x, v]() { td::actor::send_closure(x, &ValidatorEngine::set_archive_preload_period, v); });
|
||||
return td::Status::OK();
|
||||
});
|
||||
p.add_option('\0', "enable-precompiled-smc",
|
||||
"enable exectuion of precompiled contracts (experimental, disabled by default)",
|
||||
[]() { block::precompiled::set_precompiled_execution_enabled(true); });
|
||||
auto S = p.run(argc, argv);
|
||||
if (S.is_error()) {
|
||||
LOG(ERROR) << "failed to parse options: " << S.move_as_error();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue