Hi does anyone mind walking me through this contract? I understand it's for not accessing msg.sender and msg.data directly but confused w/ constructor() internal and how that prevents people deploying contact. ty for any help
Aug 19, 2020, 3:33 AM
I think it's because otherwise the constructor would default to being empty and public if it wasn't specified.
https://www-bitdegree-org.cdn.ampproject.org/v/s/www.bitdegree.org/learn/solidity-inheritance/amp?amp_js_v=0.1&usqp=mq331AQFKAGwASA%3D#constructors
https://www-bitdegree-org.cdn.ampproject.org/v/s/www.bitdegree.org/learn/solidity-inheritance/amp?amp_js_v=0.1&usqp=mq331AQFKAGwASA%3D#constructors
That would make this particular contract deployable on its own when that's not what you want
Aug 19, 2020, 3:46 AM
yes i see what you mean
constructor() internal just prevents that contract from being deployed
thank you @pyskell
Aug 19, 2020, 3:47 AM
Welcome
Aug 19, 2020, 3:48 AM
Feel free to ask questions about OpenZeppelin Contracts in the community forum: https://forum.openzeppelin.com/
Aug 19, 2020, 4:47 AM
cheers will do
Aug 19, 2020, 4:49 AM
In Solidity 0.7 you shouldn't use visibility attributes in constructors anymore. https://solidity.readthedocs.io/en/latest/070-breaking-changes.html#functions-and-events (also check at the bottom: Remove the public keyword from every constructor.
Remove the internal keyword from every constructor and add abstract to the contract (if not already present))
Remove the internal keyword from every constructor and add abstract to the contract (if not already present))
Aug 19, 2020, 5:51 AM
ahhh yes remember reading this about abstract in constructor ty
Aug 19, 2020, 5:56 AM