Is it possible to make a function onyOwner, since one of them must obviously be called by Provable's server? Or is there an equivalent modifier to it, such as onlyProvable? If not, would there be a way to code one?

More generally, what about making functions internal or private?

  • And how exactly would the Provable's server call a private or internal function??? Even the owner wouldn't be able to do that. – goodvibration Mar 20 '20 at 18:54
  • Since there are several functions at stake (between the initializer, the callback and the function that's executed), my question was for each of these functions: I don't understand which one is called by the server, and therefore which one must be public. Also, if this function that should be public actually must be, calling it from another function otherFunction() public should, I believe, lift that need. Am I wrong somewhere? – Thanh-Quy Nguyen Mar 20 '20 at 18:59
  • Perhaps the real question I might have would be... Is there a onlyProvable modifier somewhere? Or is it possible to write it? How do we know which is the address of the Provable server that will call our function, and is it always the same? – Thanh-Quy Nguyen Mar 20 '20 at 19:06

The __callback() function actually does that in one of their example.

The Provable's server address can be accessed through provable_cbAddress(), defined in the Provable imported file. Therefore, a modifier could be written like this:

modifier onlyProvable() {
    require(msg.sender != provable_cbAddress(), "The sender is not Provable's server.");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.