Golom contest - navinavu's results

An NFT marketplace that offers the lowest industry fee, a publicly available order-book along with analytical tools.

General Information

Platform: Code4rena

Start Date: 26/07/2022

Pot Size: $75,000 USDC

Total HM: 29

Participants: 179

Period: 6 days

Judge: LSDan

Total Solo HM: 6

Id: 148

League: ETH

Golom

Findings Distribution

Researcher Performance

Rank: 178/179

Findings: 1

Award: $0.00

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/core/GolomTrader.sol#L154

Vulnerability details

Impact

Using address.transfer() make the assumption that opcode gas costs are not subject to change, but EIP 1884 increased the SLOAD opcode gas cost and other gas cost raises might happen in the future. It makes this contract dependent on opcode gas cost updates as it would only forward a fixed amount of 2300 gas units to the payAddress, which might require more to internally process the transfer (ex: reading/writing from/to the storage on receive).

It may result to the failure of the ether transfers of all the functions using payEther() and may affect the royalties distribution.

address.transfer() and address.send() have a limited forwarded gas amount to prevent reentrancy attacks. Most of the functions using 'payEther()' are already implementing a nonReentrant lock. Using this lock should be enough to prevent a reentrancy if paired with an enforced checks-effects-interactions pattern.

Then, address.transfer() could be replaced with a low level address.call.value() which will forward the remaining gas with the call:

(bool success, ) = address.call.value(amount)("");
require(success, "Transfer failed.");

#0 - KenzoAgada

2022-08-03T14:09:26Z

Duplicate of #343

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter