The functions should first check if the passed arguments are valid first. These checks should include, but not be limited to:
- uint should be larger than 0 when 0 is considered invalid
- uint should be within constraints
- int should be positive in some cases
- length of arrays should match if more arrays are sent as arguments
- addresses should not be 0x0
Add tests that check if all of the arguments have been validated. Consider checking arguments as an important part of writing code and developing the system.
- ConsenSys Audit Shell Protocol Finding 6.2
- Input Validation
- Major Severity
- Parameter Checks
- Valid/Threshold/o/+ve
- Add Checks Testing
- Youtube Reference
- Major severity finding from Consensys Diligence Audit of Shell Protocol