I am looking at this AdminUpgradeabilityProxy contract: https://bscscan.com/address/0x8cb88701790f650f273c8bb2cc4c5f439cd65219#code
and find that this proxy’s implementation contract’s initialize() function is:
contract BunnyMinterV2 is IBunnyMinterV2, OwnableUpgradeable {
...
function initialize() external initializer {
WITHDRAWAL_FEE_FREE_PERIOD = 3 days;
WITHDRAWAL_FEE = 50;
PERFORMANCE_FEE = 3000;
bunnyPerProfitBNB = 5e18;
bunnyPerBunnyBNBFlip = 6e18;
IBEP20(BUNNY).approve(BUNNY_POOL, uint(- 1));
}
...
}
I notice there is no owner set in this initialize()
function, but by checking the events of this contract creation transaction, I see 2 events:
- one is the Approval event, it is what the initializer does
- the other is
OwnershipTransferred(address,address)
( keccak hash is 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0), I wonder where is this event coming from.
According to my understanding, in order to set owner, we have to call Ownable.initialize(sender);
explicitly in the initializer, so how is this owner set?
I have tried to deploy the contract on testnet, and the owner is not set in my deployment, so I wonder how the contract creation transaction I posted above managed to get the owner set.
contract and tx info: