Let's say that my DApp got the following (smart) contract:
module.exports = {
winner: async function(value) {
if (value===10) {
}
}
}
Now the Dapp user can do someting which invoke the contract with some value
which can be 10
or not. The Dapp determines if value
equals 10
or not. So far so good.
But now it seems that anyone with a valid secret (and some XAS send to the Dapps's side chain) can invoke the contract with a simple PUT
request to api/<dappId>//transactions/unsigned
with value
set to whatever they want.
How to ensure that the value of value
is set by the Dapp and can not be manipulated?