yAxis contest - pauliax's results

The trusted #DeFi platform to earn reliable returns on digital assets.

General Information

Platform: Code4rena

Start Date: 09/09/2021

Pot Size: $60,000 USDC

Total HM: 24

Participants: 12

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 14

Id: 30

League: ETH

yAxis

Findings Distribution

Researcher Performance

Rank: 10/12

Findings: 2

Award: $502.81

🌟 Selected for report: 5

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: pauliax

Labels

bug
1 (Low Risk)
sponsor acknowledged
sponsor confirmed

Awards

46.5153 YAXIS - $181.41

External Links

Handle

pauliax

Vulnerability details

Impact

A theoretical issue is that the decimals of USDC may change as they use an upgradeable contract so you cannot assume that it stays 6 decimals forever: balances[1] = stableSwap3Pool.balances(1).mul(10**12); // USDC

A simple solution would be to call .decimals() on token contract to query it on the go. Then you will not need to hardcode it but gas usage will increase.

#0 - Haz077

2021-09-25T16:04:11Z

I believe that there were other submissions mentioning issues with the decimal (for example: handling tokens with more than 18 decimal points). But I think calling .decimals() from the tokens contract will fix those issues, even though it will cost more gas, so I think this issue should be accepted.

#1 - uN2RVw5q

2021-09-27T16:48:48Z

I would say that it's extremely unlikely that USDC will upgrade the contract and change its decimals, as this would break many existing contracts. Perhaps this should simply be documented. Even if it happens, it's very likely that this would be made public in advance, allowing the tokens to be withdrawn.

IMO, changing 10**12 to 10**18/USDC.decimals() is an unnecessary waste of gas (more than 5000 additional gas, even just counting the call, and storage read)

#2 - GalloDaSballo

2021-10-13T22:52:05Z

I believe the finding to be valid, but wouldn't expect sponsor to have to mitigate

Findings Information

🌟 Selected for report: jonah1005

Also found by: pauliax

Labels

bug
duplicate
1 (Low Risk)
sponsor disputed

Awards

20.9319 YAXIS - $81.63

External Links

Handle

pauliax

Vulnerability details

Impact

"totalDepositCap is the maximum amount of value that can be deposited", however, it is compared against totalSupply() which is the number of shares and may be different than the deposited amount.

Either track the amounts and check against the sum of them or remove the confusion by naming this variable something like totalSharesCap and updating comments.

#0 - Haz077

2021-09-25T16:55:36Z

totalSupply() can't be different than deposited amount as it increase/decrease with deposit/withdraw.

#1 - GalloDaSballo

2021-10-14T00:30:35Z

Duplicate of #25

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