Golom contest - cryptphi'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: 36/179

Findings: 4

Award: $342.78

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

26.7695 USDC - $26.77

Labels

bug
duplicate
3 (High Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-07-golom/blob/main/contracts/vote-escrow/VoteEscrowDelegation.sol#L71-L109

Vulnerability details

Impact

For a tokenId without a prior checkpoint, calling VoteEscrowDelegation.delegate() would revert due to an underflow in nCheckpoints

nCheckpoints variable in uint256 nCheckpoints = numCheckpoints[toTokenId]; is set to 0 since there was no prior numCheckpoints. Thus nCheckpoints - 1 in line 79 would cause an underflow causing a revert.

Due to above, first time delegation on a tokenId will always revert.

Tools Used

Manual review

Change uint256 nCheckpoints = numCheckpoints[toTokenId]; to uint256 nCheckpoints = numCheckpoints[toTokenId] + 1;

#0 - KenzoAgada

2022-08-02T09:20:55Z

Duplicate of #630

Findings Information

🌟 Selected for report: CertoraInc

Also found by: 0xA5DF, 0xsanson, Bahurum, GalloDaSballo, MEP, TrungOre, carlitox477, cryptphi, kenzo

Labels

bug
duplicate
3 (High Risk)

Awards

280.8379 USDC - $280.84

External Links

Lines of code

https://github.com/code-423n4/2022-07-golom/blob/main/contracts/vote-escrow/VoteEscrowDelegation.sol#L233-L262

Vulnerability details

Impact

The _transferFrom() in VoteEscrowDelegation.sol should be change to an external function. Currently, the function is unable to be called by any user since it is an internal function and there's no call to the function from another Golom contract.

With above, users who want to remove delegation and transfer their NFT will be unable to call the function.

Proof of Concept

https://github.com/code-423n4/2022-07-golom/blob/main/contracts/vote-escrow/VoteEscrowDelegation.sol#L233-L262

Tools Used

Manual review

Change function to external.

#0 - KenzoAgada

2022-08-03T14:54:58Z

Duplicate of #377

Lines of code

https://github.com/code-423n4/2022-07-golom/blob/main/contracts/core/GolomTrader.sol#L151-L155

Vulnerability details

Impact

The use of payable().transfer may have unintended outcomes on the eth being sent to the receiver. Funds may be irretrievable or undelivered if the recipient is a smart contract. Funds can potentially be lost if;

  1. The smart contract fails to implement the payable fallback function
  2. The fallback function uses more than 2300 gas units

The impact would mean that any contracts receiving funds would potentially be unable to retrieve funds from the fillAsk transaction.

Possible receivers that may be affected during the fillAsk() transaction are referrer, o.signer , exchange , prepayment and payment receivers.

I

Proof of Concept

https://github.com/code-423n4/2022-07-golom/blob/main/contracts/core/GolomTrader.sol#L151-L155

The payEther() issue may affect RewardDistributor, referrer, o.signer , exchange , prepayment and payment receivers.

Tools Used

Manual review

msg.sender.call.value(amount)` or using the OpenZeppelin Address.sendValue library

#0 - KenzoAgada

2022-08-03T14:56:08Z

Duplicate of #343

  1. Missing zero address check in constructorThe following functions have missing zero address check for the corresponding parameter in the constructor , thus setting owner to address(0). This would require redeployment of contract.

governance parameter in GolomTrader.constructor() - https://github.com/code-423n4/2022-07-golom/blob/main/contracts/core/GolomTrader.sol#L92-L94 governance parameter in GolomToken.constructor() - https://github.com/code-423n4/2022-07-golom/blob/main/contracts/governance/GolomToken.sol#L28-L30 governance parameter in RewardDistributor.constructor() - https://github.com/code-423n4/2022-07-golom/blob/main/contracts/rewards/RewardDistributor.sol#L74-L85

  1. Missing zero address check The following functions have missing zero address check for the corresponding parameter.

trader and token params in RewardDistributor.constructor() are also missing zero address checks - https://github.com/code-423n4/2022-07-golom/blob/main/contracts/rewards/RewardDistributor.sol#L74-L85 _minter parameter in GolomToken.setMinter is missing zero address check.

Default address of pendingMinter is address(0), so if minter is set to zero, executeMinter() will set minter to 0. https://github.com/code-423n4/2022-07-golom/blob/main/contracts/governance/GolomToken.sol#L58-L61

  1. Missing events and emit The following functions are missing emits and/or events for their operations which could be useful in third-party monitoring. GolomTrader.executeSetDistributor() - https://github.com/code-423n4/2022-07-golom/blob/main/contracts/core/GolomTrader.sol#L454-L457 GolomToken.executeSetMinter() - https://github.com/code-423n4/2022-07-golom/blob/main/contracts/governance/GolomToken.sol#L65-L72

  2. Re-written output variable in TokenUriHelper.solThe output variable in TokenUriHelper._tokenURI() looks to be re-written multiple times

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