Santa's List

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

Solidity pragma version mismatch between protocol (0.8.22) and OpenZeppelin ERC721 dependency (^0.8.24) prevents compilation

Solidity pragma version mismatch between protocol (0.8.22) and OpenZeppelin ERC721 dependency (^0.8.24) prevents compilation

Description

  • When running forge buildthe contract should compile

  • Because the ERC721contract in openzeppelindependency only allow compatibility with pragma solidity ^0.8.24the contract will not compile beause all contracts in protocol has version 0.8.22. This makes the contract undeployable.

// ERC721 contract
pragma solidity ^0.8.24;
// SantasList, SantaToken, and TokenUri
pragma solidity 0.8.22;

Risk

Likelihood:

  • Will never compile because the ERC721 will not allow the contract to compile because of incompatibility with the protocol.

Impact

  • The code will not compile making the contract undeployable until pragmamatches 0.8.24or higher.

Proof of Concept

Will get this error when running forge build:

Error: Found incompatible versions:
src/SantasList.sol =0.8.22 imports:
lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol ^0.8.24

Recommended Mitigation

Change versions in all contracts to pragmaversion 0.8.24so the contract will compile:

- pragma solidity 0.8.22;
+ pragma solidity 0.8.24;
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 3 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!