Skip to content

Instantly share code, notes, and snippets.

@pedroduartecosta
Created June 20, 2019 16:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedroduartecosta/4d3ee1a4ee6b616a35c5d067bdf4bd9f to your computer and use it in GitHub Desktop.
Save pedroduartecosta/4d3ee1a4ee6b616a35c5d067bdf4bd9f to your computer and use it in GitHub Desktop.
// defines a general api request
struct Request {
uint id; //request id
string urlToQuery; //API url
string attributeToFetch; //json attribute (key) to retrieve in the response
string agreedValue; //value from key
mapping(uint => string) anwers; //answers provided by the oracles
mapping(address => uint) quorum; //oracles which will query the answer (1=oracle hasn't voted, 2=oracle has voted)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment