You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fungible token standard implementation provides a set of Rust macros. The macros perform unchecked
addition, subtraction, and multiplication operations. Unchecked mathematical operations will wrap in rust if overflow_checks are not turned on in the cargo profile.
NEAR smart contracts release profile will have overflow_checks set to true. When set to true, any overflows will cause a panic, preventing malicious attacks on the contract. So this is rather informational but still requires action to fix it.
The text was updated successfully, but these errors were encountered:
This option does not get added when using it at a library level, which is what the standards are. Overflow checks need to be enabled on the crate you are compiling. We add the overflow-checks in the example. This is potentially a good issue for documentation, to better explain the need for this. There is a basic comment about overflow checks here, but it can be improved.
I'm going to move this issue to the docs repo, but feel free to let me know if you believe I'm incorrect about how overflow checks are applied and I'm happy to move back. I did test and the option was not applied when using on the lib.
The fungible token standard implementation provides a set of Rust macros. The macros perform unchecked
addition, subtraction, and multiplication operations. Unchecked mathematical operations will wrap in rust if
overflow_checks
are not turned on in the cargo profile.NEAR smart contracts release profile will have
overflow_checks
set totrue
. When set totrue
, any overflows will cause a panic, preventing malicious attacks on the contract. So this is rather informational but still requires action to fix it.The text was updated successfully, but these errors were encountered: