18 , _account_dba(account_dba)
20 , _dprop_service(services.dynamic_global_property_service())
21 , _hardfork_service(services.hardfork_property_service())
27 FC_ASSERT(_hardfork_service.
has_hardfork(SCORUM_HARDFORK_0_5),
"Hardfork #5 is required");
29 FC_ASSERT(!_nft_dba.is_exists_by<by_name>(op.
name), R
"(NFT with name "${name}" already exists.)",
31 FC_ASSERT(!_nft_dba.is_exists_by<by_uuid>(op.
uuid), R
"(NFT with uuid "${uuid}" already exists.)",
33 FC_ASSERT(_account_dba.
is_exists_by<by_name>(op.
owner), R
"(Account "${owner}" must exist.)", ("owner", op.
owner));
35 auto& account = _account_dba.
get_by<by_name>(op.
owner);
36 const auto available_power = account.scorumpower - account.nft_spend_scorumpower;
40 FC_ASSERT(available_power.amount >= requested_sp,
41 R
"(Account available power "${available_power}" is less than requested "${requested_sp}".)",
42 ("available_power", available_power.amount)(
"requested_sp", requested_sp));
44 _account_dba.
update(account, [&](
auto& obj) {
45 obj.nft_spend_scorumpower.amount += requested_sp;
48 _nft_dba.create([&](
auto& obj) {
void do_apply(const operation_type &op)
create_nft_evaluator(data_service_factory_i &, dba::db_accessor< account_object > &, dba::db_accessor< nft_object > &)
const object_type & get_by(const Key &arg) const
bool is_exists_by(const Key &arg) const
const object_type & update(modifier_type modifier)
#define SCORUM_CURRENCY_PRECISION
fc::safe< share_value_type > share_type
virtual fc::time_point_sec head_block_time() const =0
virtual bool has_hardfork(uint32_t hardfork) const =0
This operation create new NFT.
std::string json_metadata