20,000 USDC
View results
Submission Details
Severity: gas

Constructors can be marked `payable`

Summary

payable functions cost less gas to execute since the compiler does not have to add extra checks to ensure that a payment wasn't provided. A constructor can safely be marked as payable since only the deployer can pass funds.

Vulnerability Details

There are 5 instances of this issue.

File: src/Beedle.sol
11: constructor() ERC20("Beedle", "BDL") ERC20Permit("Beedle") Ownable(msg.sender) {
File Link Instance Count Instance Link
Beedle.sol 1 11

File: src/Fees.sol
19: constructor(address _weth, address _staking) {
File Link Instance Count Instance Link
Fees.sol 1 19

File: src/Lender.sol
73: constructor() Ownable(msg.sender) {
File Link Instance Count Instance Link
Lender.sol 1 73

File: src/Staking.sol
31: constructor(address _token, address _weth) Ownable(msg.sender) {
File Link Instance Count Instance Link
Staking.sol 1 31

File: src/utils/Ownable.sol
14: constructor(address _owner) {
File Link Instance Count Instance Link
Ownable.sol 1 14

Impact

105 gas

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Mark constructors as payable.

Support

FAQs

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