GithubHelp home page GithubHelp logo

isabella232 / oracle-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gnosis/oracle-examples

0.0 0.0 0.0 93 KB

A collection of example oracles for the upcoming oracle standard.

JavaScript 100.00%

oracle-examples's Introduction

NOTE: The standard is still being refined, and will most likely be using bytes rather than bytes32 for the results. While the functionality for decoding bytes in Solidity is not ready yet unfortunately, it is coming soon.

Oracle-Examples

A collection of Oracles built in accordance with the upcoming EIP specification for standardizing Oracles. More information can be found at EIP 1154: Oracle Interface

Contents:

Inside the contracts folder example collections are split up into Pull Oracles, Push Oracles. While standardized interfaces can be found in the Interfaces folder. Examples of Oracle Consumers can be found in the OracleConsumers folder.

Push Oracle Interface

interface OracleHandler {
    function receiveResult(bytes32 id, bytes32 result) external;
}
receiveResult MUST revert if the msg.sender is not an oracle authorized to provide the result for that id.

receiveResult MUST revert if receiveResult has been called with the same id before.

receiveResult MAY revert if the id or result cannot be handled by the handler.

Pull Oracle Interface

interface Oracle {
    function resultFor(bytes32 id) external view returns (bytes32 result);
}
resultFor MUST revert if the result for an id is not available yet.

resultFor MUST return the same result for an id after that result is available.

Branches

There are two active branches to this repository, integer-oracles, which is a very simpler implementation. Along with weather-oracles which is a little bit more complex implementation.

Test Cases:

For truffle test to work correctly, you would need to start a test chain with at least 55 sample accounts. The code to do so with ganache is ganache-cli -d -a 55

oracle-examples's People

Contributors

v1rtuouscycle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.