I’m following Ethereum Smart Contract Programming 101 and at the video about require
, he creates a variable called owner with the type address
:
address owner;
Then he makes a constructor
function and sets the owner
variable to msg.sender
.
address owner;
constructor() {
owner = msg.sender;
}
I’m really confused at that part; why can’t I just set owner
to msg.sender
in the variable? Like this:
address owner = msg.sender;
Thank you!