zlsecure3 / review_star

0 stars 0 forks source link

code can be refined in `StarNameService.move` contract `create_name_script_nft` function #20

Open zlsecure3 opened 1 year ago

zlsecure3 commented 1 year ago

subject

code can be refined in StarNameService.move contract create_name_script_nft function

description

when name_services.temp_nft_vec doesn't contain owner, can insert vector:: singleton(name) and return directly.

recommendation

if (!table::contains(&mut name_services.temp_nft_vec, owner)) {
           table::add(&mut name_services.temp_nft_vec, owner, vector::empty());
        };

can be modified to:

if (!table::contains(&mut name_services.temp_nft_vec, owner)) {
           table::add(&mut name_services.temp_nft_vec, owner, vector:: singleton(name));
           return;
}

locations

severity

Informational

damage

exploitability

category

Gas Optimization


system_generated: auditor:alansh submission_id:1465030899

zlsecure3 commented 1 year ago

grading (edit)


submission_id:1465030899


review_type:GRADING


result: TBD-yes,no


rating: TBD-123


comment: TBD-Rejected,Accepted by Secure3.


severity: TBD-Critical,Medium,Low,Informational


category:


description:


zlsecure3 commented 1 year ago

client feedback (manual copy)


submission_id:1465030899


review_type:CLIENT_FEEDBACK


result: TBD-yes,no


severity: TBD-Critical,Medium,Low,Informational


comment:


zlsecure3 commented 1 year ago

client feedback decision(edit)


submission_id:1465030899


review_type:CLIENT_FEEDBACK_DECISION


result: TBD-yes,no,yes-honored,no-honored


severity: TBD-Critical,Medium,Low,Informational


comment: