can i know how the owner of base contract is not assigned
contract BaseContract{
address owner;
modifier isOwner(){
require(owner == msg.sender);
_;
}
}
contract DerivedContract is BaseContract{
address owner;
constructor(){
owner = msg.sender;
}
function withdraw() isOwner() external{
msg.sender.transfer(this.balance);
}
}
Mar 10, 2023, 12:09 AM
you need to check the storage slot as it's a private variable
Mar 10, 2023, 12:40 AM