current position:Home>In solidity_ What do you mean?

In solidity_ What do you mean?

2022-02-03 23:09:32 Q & A of Denglian community




Take the answer 1:

Indicates a blank , Wait to fill in the code , He was in Modifier (Modifier) Use in . for instance :

contract owned {    function owned() public { owner = msg.sender; }    address owner;    modifier onlyOwner {        require(            msg.sender == owner,            "Only owner can call this function."        );        _;    //  Used _    }   //  Used onlyOwner  modification     function withdraw() public onlyOwner {        msg.sender.transfer(10 ether);    }}

withdraw() After unfolding :

    function withdraw() public onlyOwner {     require(            msg.sender == owner,            "Only owner can call this function."        );                msg.sender.transfer(10 ether);    //  Filled in  _    }



copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032309307942.html

Random recommended