-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Modify the semantics of TinySol so that the evaluation of boolean operators is short-circuited:
https://docs.soliditylang.org/en/latest/types.html#booleans
For example, in the following contract:
contract C {
uint x;
function f() public { if (x==1 || this.g()==1) x+=1; else x=5; }
function g() public view returns(uint) { require(x==0); return 1; }
}executing two successive calls to the function f should yield x==2, since in the second transaction the first condition x==1 is true, and so there is no need to perform the call to g.
Similarly, in the contract:
contract C {
uint x;
function f() public { if (x==0 && this.g()==1) x=1; else x=5; }
function g() public view returns(uint) { require(x==0); return 1; }
}executing two successive calls to f should yield x==5, since in the second transaction the first condition x==0 is false, and so there is no need to perform the call to g.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request