Happy Rouge Coyote
Medium
The following changeOwner
is intended to change the owner of the contract, but the owner
variable is shadowed and it will not change.
The passed parameter owner
is the same as the storage variable owner
this leads to shadowing.
No response
No response
No response
The owners of the contracts DebitaV3Aggregator
, AuctionFactory
and buyOrderFactory
won't change because of a broken function
function testChangeOwner() public {
address newAddress = makeAddr("newOwner");
factory.changeOwner(newAddress);
vm.prank(newAddress);
factory.changeOwner(makeAddr("newOwner2"));
}
Output:
Failing tests:
Encountered 1 failing test in test/local/auctions/AuctionFactory.t.sol:AuctionFactoryTest
[FAIL: revert: Only owner] testChangeOwner() (gas: 10494)
Change the parameter passed to function to _owner
.