Neo Tokyo contest - Kresh's results

A staking contract for the crypto gaming illuminati.

General Information

Platform: Code4rena

Start Date: 08/03/2023

Pot Size: $60,500 USDC

Total HM: 2

Participants: 123

Period: 7 days

Judge: hansfriese

Id: 220

League: ETH

Neo Tokyo

Findings Distribution

Researcher Performance

Rank: 81/123

Findings: 1

Award: $29.67

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Out of gas because of getPoolReward

Description

Because of getPoolReward function's strcture, it is possible for stake to get an "out of gas" error (for every new stake by user it needs about 13k more gas). withdraw and claimReward functions spend less gas, so the full lock of the NFT is impossible (only partial because of high gas fee).

Recomendation

That is architecture's disadvantage

Valid useless parameter

Description

For stake there is an invalid check for assetType, it accepts 4, however it will revert later on dynamic function calling (line https://github.com/code-423n4/2023-03-neotokyo/blob/dfa5887062e47e2d0c801ef33062d44c09f6f36e/contracts/staking/NeoTokyoStaker.sol#L1205) For withdraw is also accepts 4, and still will revert later (line https://github.com/code-423n4/2023-03-neotokyo/blob/dfa5887062e47e2d0c801ef33062d44c09f6f36e/contracts/staking/NeoTokyoStaker.sol#L1668)

Recomendation

Replace > 4 with > 3

Improper variable name

Description

getCreditYield function has an improper variable name _vaultId (line https://github.com/code-423n4/2023-03-neotokyo/blob/dfa5887062e47e2d0c801ef33062d44c09f6f36e/contracts/staking/NeoTokyoStaker.sol#L627)

Recomendation

Replace it with _citizenVaultId

#0 - c4-judge

2023-03-17T02:35:26Z

hansfriese marked the issue as grade-c

#1 - hansfriese

2023-04-04T09:13:02Z

Upgrade to grade-b as it contains 2 low-risk findings.

#2 - c4-judge

2023-04-04T09:13:09Z

hansfriese marked the issue as grade-b

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