Inside Staking.sol, the Staking contract is marked as Ownable which is intended to use some authorization functionality. But in the current implementation, the owner modifier is never used in the contract. And just cause deployment costs which can be decreased by a huge factor of 71,780 gas.
Making a contract Ownable makes sense to avoid unauthorized execution of smart contract functions.
But in scenarios where it is just imported and used in making contract ownable but not actually enforcing
does nothing good than just raising gas fees.
I've conducted this test with Foundry.
this was just a simple deployment test function.
run this using : forge snapshot --match-test test_stakingDeployment --gas-report -vvv
Foundry shows the following stats:
Saving a huge amount of gas: 71,780 gas that can save a handsome amount of funds to the protocol at time of deployment
Foundry, Manual Review
Remove the Unused ownable parent from the contract and make it gas efficient and simple.
Here's what the contract looks after we implement the recommendation :
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.