布尔取值就是 true 或 false。 支持的运算符: && 逻辑与 || 逻辑或 ! 逻辑非 == 等于 != 不等于 123456789101112131415161718192021222324252627pragma solidity ^0.8.0;contract BoolOP { function and_op(bool x,bool y) public returns (bool){ return x && y; } function or_op(bool x,bool y) public returns (bool){ return x||y; } function not(bool x) public returns (bool){ if (!x){ return false; } return true; } function equal(int x,int y) public returns (bool){ return x==y; } function not_equal(int x,int y) public returns (bool){ return x!=y; }}