Skip to content

Commit

Permalink
Report for issue #127 updated by Tadev
Browse files Browse the repository at this point in the history
  • Loading branch information
c4-bot-4 committed Nov 3, 2023
1 parent 7d6e130 commit d69c0b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion data/Tadev-G.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ While the bot report suggests to merge these following 2 mappings using struct/n
I propose to simply remove `tokenToRequest` variable, as it is unused and has no utility. This will save gas compared to creating a merged data structure without the need to do it.


## [G‑03] A useless variable is created in `mint()` function in NextGenMinterContract and should be removed.
## [G‑03] 2 useless variables are created in `mint()` function in NextGenMinterContract and should be removed.

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/hardhat/smart-contracts/MinterContract.sol#L198C7-L198C7

Expand All @@ -46,6 +46,12 @@ uint256 col = _collectionID;
```
While `_collectionID` variable could be used in the rest of the function, declaring `col` costs gas without any reason. This variable should be removed, and `_collectionID` should be used wherever `col` is currently used.

The same applies for `tokdata` variable, which is declared and assigned to `_tokendata` :

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/hardhat/smart-contracts/MinterContract.sol#L201

This string variable `tokdata` should also be removed, and `_tokendata` should be used wherever `tokdata` is currently used.


## [G‑04]

Expand Down

0 comments on commit d69c0b6

Please sign in to comment.