why i can't initialise a variable
address payable public owner=msg.sender;
but i have to do this instead
address payable public owner;
constructor() payable
{
owner = payable(msg.sender);
}
why i can't initialise a variable
address payable public owner=msg.sender;
but i have to do this instead
address payable public owner;
constructor() payable
{
owner = payable(msg.sender);
}
msg.senderis not constant, and it will have a value during the contract deployment. – Ismael Apr 15 '22 at 18:52