0

Following is my SC:

//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
contract DS{
   address payable cer;
   address public owner;
   constructor() public {
      owner = msg.sender;
      cer = (payable) msg.sender;
   }   
}

The error message is:

ParserError: Expected '(' but got ')' --> contracts/DoS1_DoS2.sol:9:21: | 9 | cer = (payable) msg.sender; | ^

Somebody please guide me.

Zulfi.

zak100
  • 1,406
  • 1
  • 13
  • 37

1 Answers1

2

your syntax for type-casting is wrong. the correct syntax for this is: cer = payable(msg.sender);