ERC721: add verified foundation scaffold and proof bridges (#73)#559
ERC721: add verified foundation scaffold and proof bridges (#73)#559
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| setMappingUint owners tokenId (addressToWord to) | ||
| setMapping balances to newRecipientBalance | ||
| setStorage totalSupply newSupply | ||
| setStorage nextTokenId (add tokenId 1) |
There was a problem hiding this comment.
Wrapping add for nextTokenId inconsistent with safeAdd pattern
Low Severity
The mint function uses safeAdd with requireSomeUint for both recipientBalance and totalSupply to guard against overflow, but uses wrapping add for nextTokenId. Every other mint function in the codebase (ERC20, SimpleToken) consistently uses safeAdd for all counter increments. While currently safe because the sequential_supply invariant keeps both values equal and totalSupply's safeAdd reverts first, this inconsistency is fragile — if burn functionality is ever added (decreasing supply but not nextTokenId), the wrapping add could silently wrap nextTokenId to zero.


Summary
Adds a merge-safe ERC721 foundation slice for #73, following the same contract-structure/proof-boundary conventions used for existing examples.
What landed
Verity/Examples/ERC721.leanconstructor,mint,approve,setApprovalForAll,transferFrombalanceOf,ownerOf,getApproved,isApprovedForAllVerity/Specs/ERC721/Spec.leanVerity/Specs/ERC721/Invariants.leanVerity/Proofs/ERC721/Basic.leanVerity/Proofs/ERC721/Correctness.leanVerity/AST/ERC721.leanCompiler/Proofs/SpecCorrectness/ERC721.leanVerity/Specs/ERC721/Proofs.lean(re-export)Verity/All.leanimportstest/PropertyERC721.t.soltest/property_manifest.jsonsyncValidation
~/.elan/bin/lake buildpython3 scripts/extract_property_manifest.pypython3 scripts/check_property_manifest_sync.pypython3 scripts/check_property_manifest.pypython3 scripts/check_property_coverage.pypython3 scripts/check_contract_structure.pypython3 scripts/check_lean_hygiene.pypython3 scripts/check_doc_counts.pyCloses #73 (foundation slice).
Note
Cursor Bugbot is generating a summary for commit db0c1ff. Configure here.