diff --git a/libraries/chain/contract_evaluator.cpp b/libraries/chain/contract_evaluator.cpp index 48f3b684..7559e373 100644 --- a/libraries/chain/contract_evaluator.cpp +++ b/libraries/chain/contract_evaluator.cpp @@ -154,6 +154,9 @@ void_result contract_update_evaluator::do_evaluate(const contract_update_operati const account_object& contract_obj = op.contract(d); FC_ASSERT(op.owner == contract_obj.registrar, "only owner can update contract, current owner: ${o}", ("o", contract_obj.registrar)); + if(d.head_block_time() > HARDFORK_1015_TIME) { + FC_ASSERT(contract_obj.code.size() > 0, "can not update a normal account: ${a}", ("a", op.contract)); + } code_hash = fc::sha256::hash(op.code); FC_ASSERT(code_hash != contract_obj.code_version, "code not updated"); diff --git a/libraries/chain/include/graphene/chain/hardfork.hpp b/libraries/chain/include/graphene/chain/hardfork.hpp index a586f77b..eba6ba86 100644 --- a/libraries/chain/include/graphene/chain/hardfork.hpp +++ b/libraries/chain/include/graphene/chain/hardfork.hpp @@ -85,6 +85,11 @@ #define HARDFORK_1103_TIME (fc::time_point_sec( 1543507200 )) #endif +#ifndef HARDFORK_1015_TIME +// disable udpate_contract for normal account +#define HARDFORK_1015_TIME (fc::time_point_sec( 1546084800 )) // for mainnet, 2018-12-29T12:00:00 UTC +#endif + // #413 Add operation to claim asset fees #ifndef HARDFORK_413_TIME #define HARDFORK_413_TIME (fc::time_point_sec( 1446652800 ))