简体   繁体   中英

What does ! mean in Solidity?

I'm studying Solidity and I couldn't understand what does [!] mean in ⑨⑫⑬.

What does it mean? And, how to use it?

Could you give any advice, please?

function sendReward(uint256 _reward, address _dest, uint256 _id) external 
  onlyOwner {
        require(!rewardSent[_id]); // ⑨
        require(_reward > 0); // ⑩
        require(address(this).balance >= _reward); // ⑪
        require(_dest != address(0)); // ⑫
        require(_dest != owner); // ⑬
        rewardSent[_id] = true; // ⑨
        _dest.transfer(_reward);
        emit RewardSent(_dest, _reward, _id);
    }

According to the documentation != is the inequality operator. The following lines all evaluate to true :

1 == 1
1 != 2 
1 != 3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM