code-423n4 / 2022-09-artgobblers-findings

0 stars 0 forks source link

QA Report #400

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

RandomBytesRequested Event Always Emits Zero – ChainlinkV1RandProvider.sol #L66

requestId is declared as the return value of this function however usage in emitting an event prior to assignment means that it is never non-zero at the time of emitting the event. Instead consider: emit RandomBytesRequested(requestId = requestRandomness(chainlinkKeyHash, chainlinkFee)); combining with #L69.

Incorrect Legendary Gobbler Auction Start Price Type – ArtGobblers.sol #L461

The start price type should be uint128 to be consistent with other usage.

Explicit Uint Type – ArtGobblers.sol #L763

Use the explicit uint256 type, as in some circumstances (e.g. abi-encoding with signature) they are not synonymous.

Consider Extending Withdraw Functionality – GobblerReserve.sol #L34

It may be wise to make this function internal and then have a single generalised public onlyOwner function which is capable of executing arbitrary abi-encoded calls e.g. to call the proposed internal withdraw functinon or transfer other assets which may be sent to the contract GobblerReserve contract address.

Re-Write Left Shift As Exp – ArtGobblers.sol #L674

Here shl(64, 1) is equivalent to exp(2, 64) so re-write for readability.

Re-Write Left Shift As Exp – ArtGobblers.sol #L844

numGobblersEach << 1 is equivalent to numGobblersEach * 2 so re-write for readability.

GalloDaSballo commented 2 years ago

RandomBytesRequested Event Always Emits Zero – ChainlinkV1RandProvider.sol #L66

R

Incorrect Legendary Gobbler Auction Start Price Type – ArtGobblers.sol #L461

R

Explicit Uint Type – ArtGobblers.sol #L763

NC

Consider Extending Withdraw Functionality – GobblerReserve.sol #L34

R

Shifts

R

3R 1NC

Good intentions but needs more findings