From 382d85e832d7f819341a41e487169eb469c462ea Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 7 Aug 2019 11:53:36 -0700 Subject: [PATCH 1/3] only check issue amount max if nft --- build/dgoods/dgoods.wasm | Bin 86446 -> 86450 bytes src/dgoods.cpp | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/dgoods/dgoods.wasm b/build/dgoods/dgoods.wasm index d01f189ba9798638ef9db7e94ec6e7279ef5d5b1..89590d424b3c4f5958e7a528b0472825cb19c5a4 100755 GIT binary patch delta 393 zcmZ3tn03=))(!e>jFUDSu!-r)+&#h|5GN4Nz%9kdSg*|BD3GnhsKTJYsKDTOa&wZg z1{YK7(ak-!cQ}Qn9c2(;1lEQ~)lfAHQWz<6Nt z@)&u>#gmW6C@}3kHu-;yHPiGXlWk(F8E;MA5!+_^^BB|+4qXNYUIw6PESk&=O8ibw z8G^xv&OQ!Q02Wl_2U-S#3Y#P2wwf~D+RQ(tjRk1-v>9@YdpB>L@tqyWS-U`+aqr}t z3myUG_blXLV!S!|jD4F8*u->Y4j*9=Zx>{K+eVm+Kh`Q-(BzsD1Trf z4-@15$!8a*j@y(le^>(vJtEMna zm+@efl39O*fm_5%AunGcIX|x~wWv5VKaauHKbV2R@$mF1Zj5?TuYoEA^YTj+$`W%j zQxu9TbCdFOfYN`COuysCsLVKPnmeN= 1 ) { asset issued_supply = dgood_stats.issued_supply; asset one_token = asset( 1, dgood_stats.max_supply.symbol); From 334f8ae463b2195f745963c36d031a84f2fe7733 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 25 Sep 2019 13:06:44 -0700 Subject: [PATCH 2/3] all params are const ref --- build/dgoods/dgoods.wasm | Bin 86446 -> 82689 bytes include/dgoods.hpp | 116 +++++++++++++++++++-------------------- include/utility.hpp | 4 +- src/dgoods.cpp | 108 ++++++++++++++++++------------------ 4 files changed, 114 insertions(+), 114 deletions(-) diff --git a/build/dgoods/dgoods.wasm b/build/dgoods/dgoods.wasm index d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f*~ zxJ02NxgrG0s~<`v4#KU3cX@oM;nzr|V3pqad5mrPwVqVRn0rj6m#!Za!@}e}k-L8K zsfyb&c~i-CPVOzZ?$>*BvrkNf?VCLbhBc2F8=!4R!rr3MvPBG?y@i6ADN05suPzf4 zCzHQXMhuh5XFHL_hs&<2UDh^PWO=d*54B334(dew8R#sWD; zuS%E~Nt|teIQ*g_3BgSyIgFU6hDKio6*@hF_CwT*Z6ZlN(h|uY6UiRQ7^h2}2_=#a z=1K`HCcj+*nwbkz4U56G0l@IFr1om?_7h5M^}?6WETxh$GOwCJ47bVoCcjl+Wlrz zz(_u*r3Sh&XRXl$c)(5GGS|&tc`)}MC&OZ`UL1D6hdt$_815GbobZ5`yvU@I%v>{n z2I1Wv?=eIB+*7SrUg{L!lV6%^emW=1bX&K)q6pnkI`5)HDciU-8EsP>u!gEq9BtJ| zbd09lwbs*es|Qg9G$M;=lOk~fe{#THXJH0j*gtFP0eRtRF`BEXOXj`J3ukZ&FftGr zh`dSPux%P(+DYHm^T6dO19@|DH8)niYf?v|jK)hzEdXO?bnG-QE&9x}29yQ2X5a{J z3E5@;{gQnwE4SJ{O5)9vNUFMD3 zU587NN^Q3Ldeo=1cZgbOf^4CMqIOQlWE=TZIbb6v<(yAxC6yS&_M(8`WrQZUN+FQ1 zhNRvH8``Y3<}rWSEdADdv0O}%qTOMs(z1LK@SmAPuk*ZFQ)!B|mj5>M{$@XO=K`<| zEgsCINj8KXea?d^BsD_=BwFI8vocuTOb}0s`3`%WVSm=!(xgnxByI;qh-n}65%tUj zi&~C{5$;f#NhD!lc-TqYHt@h@S_9;1lGfSJGq@rDCRagj*!PHNyPNHny|weJF|frx z*l2D18iyH9h%6VhA41>LW!t`Nm{BIpV~ypu^SfNu&!=4q6zkv(zaTIFCC)xGuvKi< zn+l_I>7|1hqK ds) : contract(receiver, code, ds) {} - ACTION setconfig(symbol_code symbol, - string version); - - ACTION create(name issuer, - name rev_partner, - name category, - name token_name, - bool fungible, - bool burnable, - bool sellable, - bool transferable, - double rev_split, - string base_uri, - asset max_supply); - - ACTION issue(name to, - name category, - name token_name, - asset quantity, - string relative_uri, - string memo); - - ACTION burnnft(name owner, - vector dgood_ids); - - ACTION burnft(name owner, - uint64_t category_name_id, - asset quantity); - - void buynft(name from, name to, asset quantity, string memo); - - ACTION transfernft(name from, - name to, - vector dgood_ids, - string memo); - - ACTION transferft(name from, - name to, - name category, - name token_name, - asset quantity, - string memo); - - ACTION listsalenft(name seller, - vector dgood_ids, - asset net_sale_amount); - - ACTION closesalenft(name seller, - uint64_t batch_id); - - ACTION logcall(uint64_t dgood_id); + ACTION setconfig(const symbol_code& symbol, + const string& version); + + ACTION create(const name& issuer, + const name& rev_partner, + const name& category, + const name& token_name, + const bool& fungible, + const bool& burnable, + const bool& sellable, + const bool& transferable, + const double& rev_split, + const string& base_uri, + const asset& max_supply); + + ACTION issue(const name& to, + const name& category, + const name& token_name, + const asset& quantity, + const string& relative_uri, + const string& memo); + + ACTION burnnft(const name& owner, + const vector& dgood_ids); + + ACTION burnft(const name& owner, + const uint64_t& category_name_id, + const asset& quantity); + + void buynft(const name& from, const name& to, const asset& quantity, const string& memo); + + ACTION transfernft(const name& from, + const name& to, + const vector& dgood_ids, + const string& memo); + + ACTION transferft(const name& from, + const name& to, + const name& category, + const name& token_name, + const asset& quantity, + const string& memo); + + ACTION listsalenft(const name& seller, + const vector& dgood_ids, + const asset& net_sale_amount); + + ACTION closesalenft(const name& seller, + const uint64_t& batch_id); + + ACTION logcall(const uint64_t& dgood_id); TABLE lockednfts { uint64_t dgood_id; @@ -171,11 +171,11 @@ CONTRACT dgoods: public contract { private: map _calcfees(vector dgood_ids, asset ask_amount, name seller); - void _changeowner( name from, name to, vector dgood_ids, string memo, bool istransfer); - void _checkasset( asset amount, bool fungible ); - void _mint(name to, name issuer, name category, name token_name, - asset issued_supply, string relative_uri); - void _add_balance(name owner, name issuer, name category, name token_name, - uint64_t category_name_id, asset quantity); - void _sub_balance(name owner, uint64_t category_name_id, asset quantity); + void _changeowner( const name& from, const name& to, const vector& dgood_ids, const string& memo, const bool& istransfer); + void _checkasset( const asset& amount, const bool& fungible ); + void _mint(const name& to, const name& issuer, const name& category, const name& token_name, + const asset& issued_supply, const string& relative_uri); + void _add_balance(const name& owner, const name& issuer, const name& category, const name& token_name, + const uint64_t& category_name_id, const asset& quantity); + void _sub_balance(const name& owner, const uint64_t& category_name_id, const asset& quantity); }; diff --git a/include/utility.hpp b/include/utility.hpp index cc26bf2..dcb98da 100644 --- a/include/utility.hpp +++ b/include/utility.hpp @@ -35,9 +35,9 @@ namespace utility { tuple parsememo(const string& memo) { auto comma_pos = memo.find(','); string errormsg = "malformed memo: must have batch_id,to_account"; - check ( comma_pos != string::npos, errormsg.c_str() ); + check ( comma_pos != string::npos, errormsg ); if ( comma_pos != string::npos ) { - check( ( comma_pos != memo.size() - 1 ), errormsg.c_str() ); + check( ( comma_pos != memo.size() - 1 ), errormsg ); } // will abort if stoull throws error since wasm no error checking uint64_t batch_id = stoull( trim( memo.substr( 0, comma_pos ) ) ); diff --git a/src/dgoods.cpp b/src/dgoods.cpp index 3601a96..9cca176 100644 --- a/src/dgoods.cpp +++ b/src/dgoods.cpp @@ -1,7 +1,7 @@ #include #include -ACTION dgoods::setconfig(symbol_code sym, string version) { +ACTION dgoods::setconfig(const symbol_code& sym, const string& version) { require_auth( get_self() ); // valid symbol @@ -16,17 +16,17 @@ ACTION dgoods::setconfig(symbol_code sym, string version) { config_table.set( config_singleton, get_self() ); } -ACTION dgoods::create(name issuer, - name rev_partner, - name category, - name token_name, - bool fungible, - bool burnable, - bool sellable, - bool transferable, - double rev_split, - string base_uri, - asset max_supply) { +ACTION dgoods::create(const name& issuer, + const name& rev_partner, + const name& category, + const name& token_name, + const bool& fungible, + const bool& burnable, + const bool& sellable, + const bool& transferable, + const double& rev_split, + const string& base_uri, + const asset& max_supply) { require_auth( get_self() ); @@ -85,12 +85,12 @@ ACTION dgoods::create(name issuer, } -ACTION dgoods::issue(name to, - name category, - name token_name, - asset quantity, - string relative_uri, - string memo) { +ACTION dgoods::issue(const name& to, + const name& category, + const name& token_name, + const asset& quantity, + const string& relative_uri, + const string& memo) { check( is_account( to ), "to account does not exist"); check( memo.size() <= 256, "memo has more than 256 bytes" ); @@ -133,8 +133,8 @@ ACTION dgoods::issue(name to, }); } -ACTION dgoods::burnnft(name owner, - vector dgood_ids) { +ACTION dgoods::burnnft(const name& owner, + const vector& dgood_ids) { require_auth(owner); check( dgood_ids.size() <= 20, "max batch size of 20" ); @@ -168,9 +168,9 @@ ACTION dgoods::burnnft(name owner, } } -ACTION dgoods::burnft(name owner, - uint64_t category_name_id, - asset quantity) { +ACTION dgoods::burnft(const name& owner, + const uint64_t& category_name_id, + const asset& quantity) { require_auth(owner); @@ -192,10 +192,10 @@ ACTION dgoods::burnft(name owner, }); } -ACTION dgoods::transfernft(name from, - name to, - vector dgood_ids, - string memo ) { +ACTION dgoods::transfernft(const name& from, + const name& to, + const vector& dgood_ids, + const string& memo ) { check( dgood_ids.size() <= 20, "max batch size of 20" ); // ensure authorized to send from account @@ -211,12 +211,12 @@ ACTION dgoods::transfernft(name from, _changeowner( from, to, dgood_ids, memo, true ); } -ACTION dgoods::transferft(name from, - name to, - name category, - name token_name, - asset quantity, - string memo ) { +ACTION dgoods::transferft(const name& from, + const name& to, + const name& category, + const name& token_name, + const asset& quantity, + const string& memo ) { // ensure authorized to send from account check( from != to, "cannot transfer to self" ); require_auth( from ); @@ -243,9 +243,9 @@ ACTION dgoods::transferft(name from, _add_balance(to, get_self(), category, token_name, dgood_stats.category_name_id, quantity); } -ACTION dgoods::listsalenft(name seller, - vector dgood_ids, - asset net_sale_amount) { +ACTION dgoods::listsalenft(const name& seller, + const vector& dgood_ids, + const asset& net_sale_amount) { require_auth( seller ); check (dgood_ids.size() <= 20, "max batch size of 20"); @@ -285,8 +285,8 @@ ACTION dgoods::listsalenft(name seller, }); } -ACTION dgoods::closesalenft(name seller, - uint64_t batch_id) { +ACTION dgoods::closesalenft(const name& seller, + const uint64_t& batch_id) { ask_index ask_table( get_self(), get_self().value ); const auto& ask = ask_table.get( batch_id, "cannot find sale to close" ); @@ -310,10 +310,10 @@ ACTION dgoods::closesalenft(name seller, } } -void dgoods::buynft(name from, - name to, - asset quantity, - string memo) { +void dgoods::buynft(const name& from, + const name& to, + const asset& quantity, + const string& memo) { // allow EOS to be sent by sending with empty string memo if ( memo == "deposit" ) return; // don't allow spoofs @@ -363,7 +363,7 @@ void dgoods::buynft(name from, } // method to log dgood_id and match transaction to action -ACTION dgoods::logcall(uint64_t dgood_id) { +ACTION dgoods::logcall(const uint64_t& dgood_id) { require_auth( get_self() ); } @@ -401,7 +401,7 @@ map dgoods::_calcfees(vector dgood_ids, asset ask_amount, } // Private -void dgoods::_changeowner(name from, name to, vector dgood_ids, string memo, bool istransfer) { +void dgoods::_changeowner(const name& from, const name& to, const vector& dgood_ids, const string& memo, const bool& istransfer) { check (dgood_ids.size() <= 20, "max batch size of 20"); // loop through vector of dgood_ids, check token exists dgood_index dgood_table( get_self(), get_self().value ); @@ -434,7 +434,7 @@ void dgoods::_changeowner(name from, name to, vector dgood_ids, string } // Private -void dgoods::_checkasset(asset amount, bool fungible) { +void dgoods::_checkasset(const asset& amount, const bool& fungible) { auto sym = amount.symbol; if (fungible) { check( amount.amount > 0, "amount must be positive" ); @@ -450,12 +450,12 @@ void dgoods::_checkasset(asset amount, bool fungible) { } // Private -void dgoods::_mint(name to, - name issuer, - name category, - name token_name, - asset issued_supply, - string relative_uri) { +void dgoods::_mint(const name& to, + const name& issuer, + const name& category, + const name& token_name, + const asset& issued_supply, + const string& relative_uri) { dgood_index dgood_table( get_self(), get_self().value); auto dgood_id = dgood_table.available_primary_key(); @@ -481,8 +481,8 @@ void dgoods::_mint(name to, } // Private -void dgoods::_add_balance(name owner, name ram_payer, name category, name token_name, - uint64_t category_name_id, asset quantity) { +void dgoods::_add_balance(const name& owner, const name& ram_payer, const name& category, const name& token_name, + const uint64_t& category_name_id, const asset& quantity) { account_index to_account( get_self(), owner.value ); auto acct = to_account.find( category_name_id ); if ( acct == to_account.end() ) { @@ -500,7 +500,7 @@ void dgoods::_add_balance(name owner, name ram_payer, name category, name token_ } // Private -void dgoods::_sub_balance(name owner, uint64_t category_name_id, asset quantity) { +void dgoods::_sub_balance(const name& owner, const uint64_t& category_name_id, const asset& quantity) { account_index from_account( get_self(), owner.value ); const auto& acct = from_account.get( category_name_id, "token does not exist in account" ); From cdba7d95b7bcb32d8a61d16079cfa3fe1a071450 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 25 Sep 2019 13:30:57 -0700 Subject: [PATCH 3/3] some optimization + check amount if nft only --- build/dgoods/dgoods.wasm | Bin 82689 -> 86801 bytes src/dgoods.cpp | 43 +++++++++++++++------------------------ 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/build/dgoods/dgoods.wasm b/build/dgoods/dgoods.wasm index b4f7e734a654c45b6c4ec2ff756fefbd3167aba4..efc0875cdcdf6902e7b36e16df18067ce85ea9a1 100755 GIT binary patch delta 13040 zcma)D30zgx)<5gqfeV-6sE7zE=U!0(6|qzXML2}B<&ZW!twcp-5EKxt%!{U`mZt9P zSUCVz+Mo?rb42Wwm1CBg%~`#AeT~}mZ1nrDeJ+E%zW2WCue-;!_L}w@_N9eO9cvzU zgerOEGf7btI;p0t2|W{{&iB#$Ni?74ulcBlL!FO~KZJg;+4j=zwT>8{$E$W$<0GTI zQC;i~XFL&kBO~MN4n^tc=^EK8(r%A(bW4cp)~#ER!yctZ*;Qwv)9HxnXt%3LQ4YIm zcO*tRRC^-24qJDJQ&rJPOaz>*huzNb_Nbo8O`j+`KJtq@p}nGd_3CBEfB1+RM~`&# zoZ|K=1~)+=uOI$^VmWa zw_E2Ox{Y`Ellukhbe~QaWpDh9mEqp zk6pKUoB+g`%530(2C&a=%Lc9PN{_1BjiN%{WwfpEIz2X>0ht>K5JtS)f!z*+3Ox=v zug~Uf232^20B^&7AO(mg$gMkdM+H{x*sVK?J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sDyI((2j&3G4{6aLv81Gc`WJgTOEb#c+f}uK`h}Fi$}*%4jQ~`ZA23mk0>yYFOR3v#_c(_e~CZcxsiTP zeyTGCx;E>{!@D#a%xD@ssdE_3qq=Ht32vi#RkQxFW_|Aj4Tqmk(9LpNFM5P;{|g{q z!K{3L0(p!5AHu%XtzjEIJQ(6&h>s>xxWF8pNFw<19f{OKv_CbC!}*9L-Pr&P=c|&) zN>}(>Nz_pwew;*U5U;H}wGpqF_`y%oUYAADuOfUShNgF?`DDtMtZNN?L}vm7EPhp4PyGFk0$PB5x7dMKJ1Ffo_(p8mY2kj zrD3=%eD6Pa?-PCL9)$$7A0>^ow z{&p(GLb9KwqG(#r|45}!6Mh}CKEk)6%O|H$EBTjW+?GaRRKxqFQA9A_VXSS(=T)is zd6gr_suhJ(3e?ik>LYR3@WgSxBMn)i{y0CAMt%u+^04}h8dF*drYiF)D^$Vc=+cQL zqkxQuRjXGP0QnQkOY-uI#krOOmc#?oDbA)AmQ++07r?vb8WPqpH8PB+Q+|3r^skL zzF55k1*|G|Vc_Y-s%TWTjY}t$6qJMDebfXQu#u&8e0c_i(oQ}igSv#__G7h-Dkv+h zD69k)EBXusC+`V4C4Gy9ZeZ85%Jd?~mr#d%7`U~(z<=uiIDxWia| zD+)?Rsg+|3)RCp-fNwbH)6FUPqX)(d{-952jVw1 zYn!}LqY5hvOG{LkQ9=3W;?hatIA=L!Q#*Qr`(;yS+Qu`p>2F>)&Pi6|*a!&-x6bip z*%aPl-g(Jto>X2~Dde( 1 ) { - asset issued_supply = dgood_stats.issued_supply; - asset one_token = asset( 1, dgood_stats.max_supply.symbol); - for ( uint64_t i = 1; i <= quantity.amount; i++ ) { - _mint(to, dgood_stats.issuer, category, token_name, - issued_supply, relative_uri); - issued_supply += one_token; - } - } else { + check( quantity.amount <= 100, "can issue up to 100 at a time"); + asset issued_supply = dgood_stats.issued_supply; + asset one_token = asset( 1, dgood_stats.max_supply.symbol); + for ( uint64_t i = 1; i <= quantity.amount; i++ ) { _mint(to, dgood_stats.issuer, category, token_name, - dgood_stats.issued_supply, relative_uri); + issued_supply, relative_uri); + // used to keep track of serial number when minting multiple + issued_supply += one_token; } } _add_balance(to, get_self(), category, token_name, dgood_stats.category_name_id, quantity); @@ -149,7 +145,7 @@ ACTION dgoods::burnnft(const name& owner, const auto& dgood_stats = stats_table.get( token.token_name.value, "dgood stats not found" ); check( dgood_stats.burnable == true, "Not burnable"); - check( dgood_stats.fungible == false, "Cannot call burnnft on fungible token, call burn instead"); + check( dgood_stats.fungible == false, "Cannot call burnnft on fungible token, call burnft instead"); // make sure token not locked; auto locked_nft = lock_table.find( dgood_id ); check(locked_nft == lock_table.end(), "token locked"); @@ -249,7 +245,7 @@ ACTION dgoods::listsalenft(const name& seller, require_auth( seller ); check (dgood_ids.size() <= 20, "max batch size of 20"); - check( net_sale_amount.amount > .02, "minimum price of at least 0.02 EOS"); + check( net_sale_amount.amount > .02 * pow(10, net_sale_amount.symbol.precision()), "minimum price of at least 0.02 EOS"); check( net_sale_amount.symbol == symbol( symbol_code("EOS"), 4), "only accept EOS for sale" ); dgood_index dgood_table( get_self(), get_self().value ); @@ -291,23 +287,16 @@ ACTION dgoods::closesalenft(const name& seller, const auto& ask = ask_table.get( batch_id, "cannot find sale to close" ); lock_index lock_table( get_self(), get_self().value ); - // if sale has expired anyone can call this and ask removed, token sent back to orig seller - if ( time_point_sec(current_time_point()) > ask.expiration ) { - for ( auto const& dgood_id: ask.dgood_ids ) { - const auto& locked_nft = lock_table.get( dgood_id, "dgood not found in lock table" ); - lock_table.erase( locked_nft ); - } - ask_table.erase( ask ); - - } else { + if ( time_point_sec(current_time_point()) <= ask.expiration ) { require_auth( seller ); check( ask.seller == seller, "only the seller can cancel a sale in progress"); - for ( auto const& dgood_id: ask.dgood_ids ) { - const auto& locked_nft = lock_table.get( dgood_id, "dgood not found in lock table" ); - lock_table.erase( locked_nft ); - } - ask_table.erase( ask ); } + // sale has expired anyone can call this and ask removed, token removed from asks/lock + for ( auto const& dgood_id: ask.dgood_ids ) { + const auto& locked_nft = lock_table.get( dgood_id, "dgood not found in lock table" ); + lock_table.erase( locked_nft ); + } + ask_table.erase( ask ); } void dgoods::buynft(const name& from,