Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart contract NFT internal security audit #131

Closed
3 of 10 tasks
sydhds opened this issue Nov 20, 2023 · 0 comments · Fixed by #132
Closed
3 of 10 tasks

Smart contract NFT internal security audit #131

sydhds opened this issue Nov 20, 2023 · 0 comments · Fixed by #132

Comments

@sydhds
Copy link

sydhds commented Nov 20, 2023

Following the internal audit described here,

The following report has been written with few recommendations:

https://www.notion.so/massa-innoteam/FT-NFT-Contract-Audit-comments-0dd27b501ce44fcf9fbe131a7b6ebb8e?pvs=4#065acfb0b6bc4eba9e1a7070c8eb4636

Recommendations

Code Coverage and Testing

  • Enable coverage automatically in as-pect.config.js.
  • Enable coverage checks in the Continuous Integration (CI) pipeline.
  • Update coverage to 100% in NFT.ts and NFT-internals.ts.
  • Add npm audit to the CI pipeline to regularly check for package vulnerabilities.

Code Security and Best Practices

  • In NFT-internals.ts, _increment: Check for u64 overflow.
  • In NFT-internals.ts, _updateBalanceOf: Check for u64 overflow and reset.
  • In NFT-internals.ts, _isTokenOwner: Revise the comment about memory.compare to clarify that the comparison is of byte contents, not pointers.
  • In NFT-internals.ts, _setApprovalForAll: Store boolean values instead of strings (e.g., "true").
  • In wrapper.spec.ts: Use assert to ensure that all return values are checked.

Dependencies Update

  • Update the "semver" package as recommended by npm audit.
@Ben-Rey Ben-Rey linked a pull request Nov 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant