Good day,
I know that using a constant function means that no change will be done on the blockchain, but I'd like to have a smart contract that verifies the user input WITHOUT exposing what the input is unless it matches specific criteria. You can see in the following example that no number below 5 should be accepted.
contract Try{
uint public num;
function changeNum(uint _num){
num = _num;
}
function cool(uint _num) constant {
if (_num > 5){
changeNum(_num + 2);
}
}
}
I don't want to use a modifier since it's still possible to produce a signed transaction that will contain an invalid input, it will simply be rejected by the other nodes.
I want to have it so that the user will be allowed to insert whichever number they like to the cool
function, and only if the number is above 5, a transaction (containing the final input of _num + 2
) will be signed and transmitted.
I'll appreciate any input you might have on how to achieve this behavior using only the EVM.