Algo Ssstablecoinsss

AI First Flight #2
Beginner FriendlyDeFi
EXP
View results
Submission Details
Impact: high
Likelihood: low
Invalid

No zero address checks in constructor

Root + Impact

The root cause is that there is no zero at risk check-in the constructor.

impact would be if the user deploys the contract with the zero address or the zero two connect address, he wouldn't... and he wouldn't... and if he wouldn't realize that, so it will cause a lot of impact and, you know, will break the whole system.

Description

  • No zero address checks in constructor

  • src/dsc_engine.vy:59-73

  • Immutables set at deployment can never be changed — wrong address bricks protocol forever// Root cause in the codebase with @> marks to highlight the relevant section

Risk

Likelihood:

  • Low

Impact:

  • impact would be if the user deploys the contract with the zero address or the zero two connect address, he wouldn't... and he wouldn't... and if he wouldn't realize that, so it will cause a lot of impact and, you know, will break the whole system.

Proof of Concept

if the user deploys the contract with the zero address or the zero two connect address, he wouldn't... and he wouldn't... and if he wouldn't realize that, so it will cause a lot of impact and, you know, will break the whole system.
##

Recommended Mitigation

Add zero address checks at the beginning of the constructor:

- remove this code
+ add this code
@deploy
def __init__(
token_addresses: address[2],
price_feed_addresses: address[2],
dsc_address: address,
):
assert dsc_address != empty(address), "DSCEngine__ZeroAddress"
assert token_addresses[0] != empty(address), "DSCEngine__ZeroAddress"
assert token_addresses[1] != empty(address), "DSCEngine__ZeroAddress"
assert price_feed_addresses[0] != empty(address), "DSCEngine__ZeroAddress"
assert price_feed_addresses[1] != empty(address), "DSCEngine__ZeroAddress"
DSC = i_decentralized_stable_coin(dsc_address)
COLLATERAL_TOKENS = token_addresses
self.token_address_to_price_feed[token_addresses[0]] = price_feed_addresses[0]
self.token_address_to_price_feed[token_addresses[1]] = price_feed_addresses[1]
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 8 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!