Golom contest - 0xc0ffEE'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: 131/179

Findings: 1

Award: $35.17

🌟 Selected for report: 0

🚀 Solo Findings: 0

GolomTrader.sol

  1. Should use enum for orderType in struct Order in order for the logic in fillAsk fillBid fillCriteriaBid more descriptive
  2. Should use enum for order status (i.e enum OrderStatus) for validateOrder returns so that the checks in fillAsk fillBid fillCriteriaBid more descriptive
  3. The total amount to transfer in function _settleBalances included protocolFee but the checks at https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/core/GolomTrader.sol#L286 and at https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/core/GolomTrader.sol#L342. This could lead to revert on _settleBalances because the amount contract collect from o.signer is not enough to transfer
  4. The checks at https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/core/GolomTrader.sol#L286 and at https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/core/GolomTrader.sol#L342 are not consistent. The first one includes p.paymentAmt, the other doesn't

RewardDistributor.sol

  1. For more precise calculation, rewardExchange[epoch] in function addFee should equal ((tokenToEmit - stakerReward) - rewardTrader[epoch]) instead

VoteEscrowDelegation.sol

  1. The function delegate should check for whether tokenId != toTokenId. When inputtokenId == toTokenId, result of getVotes and getPriorVotes can be unexpected
  2. https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/vote-escrow/VoteEscrowDelegation.sol#L85 will always revert. Because at this point nCheckpoints = 0 and in _writeCheckpoint, the execution would revert at Checkpoint memory oldCheckpoint = checkpoints[toTokenId][nCheckpoints - 1] because underflow by nCheckpoints - 1 This results that any first delegates to toTokenId would not work

There are many testcases not yet implemented for GolemTrader: https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/test/GolomTrader.specs.ts#L645-L661 RewardDistributor: https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/test/RewardDistributor.specs.ts#L364-L368 No tests found for VoteEscrowDelegation

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