Smart contracts of Story Oracle infra, interfaces, and sample data source.
IOffChainDataSource - interfaces that NFT off-chain data-source should implement:
- load(), trigger loading/refresh data through backend off-chain oracle.
- getData(), get off-chain data loaded/refreshed by load() above.
IStoryOracleCallback - interfaces that allow backend oracle to call back smart contracts:
- fulfill(), call back function
StoryOracleClient - Infra contract of Oracle that realizes protocol for interop with Story Oracle backend server as its client. It emits the event StoryOracleRequest that is recognized by the oracle backend.
event StoryOracleRequest(
bytes32 indexed requestId, // unique id of the oracle request, story oracle backend would call back with id.
address requester, // address of smart contract which sending the oracle request
address callbackAddr, // address of smart contract which implemented the callback function
string url, // url of the json file
string path // path the locate content within the json file
);
StoryOracleHelper - help functions
StoryDataSource - Sample Story off-chain data source that is based on infra above so that support NFT can load/refresh off-chain data through Story Oracle Backend.
Test deployment:
StoryDataSource: https://goerli.etherscan.io/address/0xbEf2D967690A1e354c15E49C1841Ea2C09150E22#events
Sample of StoryOracleRequest event:https://goerli.etherscan.io/address/0xbEf2D967690A1e354c15E49C1841Ea2C09150E22#events