Skip to main content

I'mI am trying to create a clone from a contract that has some privileged functions and inherits from Ownable. I realized that after cloning the owner variable is zeroed, so any privileged function, such as transferOwnership, won'twill not run.

I noticed that OwnableOwnable has a internal function _transferOwnership that is not protected by onlyOwner modifier. I thought about calling it in my initializer function.

I just want to confirm that this is the right way to do it or it has a more recommended way to achieve this.

Thanks

I'm trying to create a clone from a contract that has some privileged functions and inherits from Ownable. I realized that after cloning the owner variable is zeroed, so any privileged function, such as transferOwnership, won't run.

I noticed that Ownable has a internal function _transferOwnership that is not protected by onlyOwner modifier. I thought about calling it in my initializer function.

I just want to confirm that this is the right way to do it or it has a more recommended way to achieve this.

Thanks

I am trying to create a clone from a contract that has some privileged functions and inherits from Ownable. I realized that after cloning the owner variable is zeroed, so any privileged function, such as transferOwnership, will not run.

I noticed that Ownable has a internal function _transferOwnership that is not protected by onlyOwner modifier. I thought about calling it in my initializer function.

I just want to confirm that this is the right way to do it or it has a more recommended way to achieve this.

Thanks

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Source Link
Fabiano
  • 303
  • 3
  • 11

Ownable Minimal Proxy (EIP-1167)

I'm trying to create a clone from a contract that has some privileged functions and inherits from Ownable. I realized that after cloning the owner variable is zeroed, so any privileged function, such as transferOwnership, won't run.

I noticed that Ownable has a internal function _transferOwnership that is not protected by onlyOwner modifier. I thought about calling it in my initializer function.

I just want to confirm that this is the right way to do it or it has a more recommended way to achieve this.

Thanks