Open code423n4 opened 2 years ago
Many part of code still using old require(..., "") for example
require(addressProvider.isStakerVault(msg.sender, lpToken), Error.UNAUTHORIZED_ACCESS);
You can replace this part with solidity 0.8 custom errors as follow
error Unauthorized();
This part above contract definition
if (!addressProvider.isStakerVault(msg.sender, lpToken)) { revert Unauthorized(); }
This part replace require(..., "")
As a styling choice we will leave as the current revert messages
In lack of any POC am going to give it 0 gas saved
Using solidity 0.8 new custom errors instead of old require(..., "") because it provide better gas optimized in both contract size and gas cost
Many part of code still using old require(..., "") for example
You can replace this part with solidity 0.8 custom errors as follow
This part above contract definition
This part replace require(..., "")