guys, maybe someone can help. I have a main smart contract (its like a factory which deploy another contracts) and this main contract is Ownable (openzeppelin);

my other created contracts from this contract inherited from Factory.

If i call transferOwnership method in this created contract, ownership will be transfered for the main contract also? or only for created contract?
who will be the owner of this created contract if its deployed from the main contract?

Feb 9, 2022, 8:39 AM
Only for created
And the owner of your created contract is main contract
Feb 9, 2022, 9:03 AM
thank you!
so, can i do like:

contract Factory is Ownable { Child child = new Child (…) }

contract Child is Factory { transferOwnership(newAddress)}

and now Factory still has the same owner and Child different, right?
Feb 9, 2022, 9:07 AM
Yes, if you call transferOwnership on Child contract, owner will be changed only on it, not on Factory
Feb 9, 2022, 9:10 AM
thanks! 🙏
Feb 9, 2022, 9:24 AM

© 2024 Draquery.com All rights reserved.