Powered by SECURI LAB
-
-
-
-
-
-
-
-
-
-
-
yes
Vulnerability Findings
ID | Vulnerability Detail | Severity | Category | Status |
SEC-01 | Use Custom Errors | – | Resolved | |
SEC-02 | Long revert strings | – | Resolved |
SEC-01: Use Custom Errors
Vulnerability Detail | Severity | Location | Category | Status |
Use Custom Errors | – | Check on finding | Resolved |
Finding:
127: require(currentAllowance >= subtractedValue, “ERC20: decreased allowance below zero”);
142: require(fromBalance >= amount, “ERC20: transfer amount exceeds balance”);
158: require(owner != address(0), “ERC20: approve from the zero address”);
159: require(spender != address(0), “ERC20: approve to the zero address”);
172: require(currentAllowance >= amount, “ERC20: insufficient allowance”);
Scenario:
–
Recommendation:
Instead of using error strings, to reduce deployment and runtime cost, you should use Custom Errors. This would save both deployment and runtime cost.
https://blog.soliditylang.org/2021/04/21/custom-errors/
Alleviation:
Patwars Team has resolved this issue.
SEC-02: Long revert strings
Vulnerability Detail | Severity | Location | Category | Status |
Long revert strings | – | Check on finding | Resolved |
Finding:
127: require(currentAllowance >= subtractedValue, “ERC20: decreased allowance below zero”);
142: require(fromBalance >= amount, “ERC20: transfer amount exceeds balance”);
158: require(owner != address(0), “ERC20: approve from the zero address”);
159: require(spender != address(0), “ERC20: approve to the zero address”);
Scenario:
–
Recommendation:
Long revert strings can indeed increase gas costs for transactions because they are stored as part of the contract bytecode. To optimize gas usage
Alleviation:
Patwars Team has resolved this issue.