bitcoin-sv / sol2scrypt

Solidity to sCrypt Transplier
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Transpile `return` #80

Closed xhliu closed 2 years ago

xhliu commented 2 years ago

return in the middle of a function.

function retrieve() external view returns (uint256){
    uint256 x = number * 10;
    if (number > 10) return x;
    return x +  10;
}

Originally posted by @freedomhero in https://github.com/sCrypt-Inc/sol2scrypt/issues/3#issuecomment-1002450912

xhliu commented 2 years ago

depends on

xhliu commented 2 years ago
if (x > 0) {
  return x;
  x--;
  x += 9;
}