20,000 USDC
View results
Submission Details
Severity: low
Valid

No address(0) check

Summary

There is no checks for the addresses when setting TKN and WETH

Vulnerability Details

The addresses of TKN and WETH are set in the constructor of Staking contract. However it is a good practice to have validations for address(0). Also there are no other functions that have the ability to change the tokens addresses, therefore once set to address(0), they can never be changed

Impact

Setting wrong addresses of TKN and WETH and causing the contract not to work as expected

Tools Used

Manual review

Recommendations

Add the following lines at the beginning of the constructor:

require(_token != address(0x0), "Invalid TKN address");
require(_weth!= address(0x0), "Invalid WETH address");

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.