while setting up openzeppelin "Ownable" it has to be initialized besides constructor but
rather done while declaring the contract which leads to owner address set to address variables default value and
making the contract unusable
https://github.com/Cyfrin/2024-10-trick-or-treat/blob/9cb3955058cad9dd28a24eb5162a96d759bfa842/src/TrickOrTreat.sol#L9
'''
pragma solidity ^0.8.24;
import "forge-std/Test.sol";
import {setOwner} from "../src/setOwner.sol";
contract SpookySwapTest is Test {
setOwner public setowner;
address public owner = address(0x123);
address public nonOwner = address(0x456);
function setUp() public {
// Deploy contract and set the deployer to `owner`
vm.prank(owner);
setowner = new setOwner(42);//setting a random number not related to poc
}
function testOwnerIsSetCorrectly() public {
// Check if the contract owner is set to `owner` address on deployment
assertEq(setowner.owner(), owner, "Owner is not set correctly");
}
'''
owner variable set to zero address making it unusable or DOS
constructor variables should be set inside constructor of inheriting contract
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.