Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Constructors can be marked as `payable`.

Summary

I noticed that the constructor in the contract is not marked as payable. Marking the constructor as payable reduces gas costs, as the compiler avoids extra checks to ensure no funds were passed during deployment. This can be safely applied since only the deployer can send funds, and the project itself won't pass any.

Vulnerability Details

The constructor does not need to prevent receiving ETH during deployment. Marking it as payable optimizes gas usage by avoiding unnecessary checks.

Impact

Gas optimization—by marking the constructor as payable, deployment becomes more efficient in terms of gas usage.

Tools Used

Manual Analysis

Recommendations

Mark the constructor as payable to reduce gas costs:

/liquid-staking/2024-09-stakelink/contracts/core/lstRewardsSplitter/LSTRewardsSplitter.sol

Line: 50

constructor(address _lst, Fee[] memory _fees, address _owner) payable {
//logic
}

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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