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-1 committed Nov 2, 2023
1 parent 006afe8 commit ce2b8d4
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion data/Tadev-G.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,21 @@ If you only keep the `address gencore` variable, just wrap it into a contract ty
INextGenCore(gencore).setTokenHash(...)
```

## [G‑02]
## [G‑02] Useless `tokenToRequest` mapping in RandomizerRNG and RandomizerVRF contracts should be removed

Both RandomizerRNG and RandomizerVRF contracts declare a mapping `mapping(uint256 => uint256) public tokenToRequest`, and it is only use to store `requestId` in the `requestRandomWords()` function. But this value is never used, and I don't see any utility in storing the requestId corresponding to a minted token in the Randomizer contract.

While the bot report suggests to merge these following 2 mappings using struct/nested mappings in both contracts (N33 and G04 issues) :

```
mapping(uint256 => uint256) public tokenToRequest;
mapping(uint256 => uint256) public tokenIdToCollection;
```

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]




0 comments on commit ce2b8d4

Please sign in to comment.