Noracle's Smart Contracts
There are two Noracle smart contracts:
VerifySSLCertificate
Feed
VerifySSLCertificate allows users to link their domain name to their crypto address and create a data feed. It also stores the following accessor functions: domainToFeed and domainstringToFeed. Both of these take a domain and return the address of the Feed contract linked to the domain.
The Feed contract stores the latest value of the data feed and exposes functions that allow the domain owner (who created the Feed) to update the latest value. There are three variables in which the latest value can be stored:
uint256 public mostRecentUInt;
int256 public mostRecentInt;
string public mostRecentStr;The mostRecent values can be accessed on-chain or off-chain.
On-Chain Access of mostRecent Value
This is solidity code showing how to access the mostRecent value. It will always be of type int256, uint256, or string. If the feed is reliable, It should never change types.
Feed feedContract = Feed(feedAddress);
int256 mostRecentInt = feedContract.mostRecentInt();
uint256 mostRecentUInt = feedContract.mostRecentUInt();
string memory mostRecentStr = feedContract.mostRecentStr();Off-Chain Access of the mostRecent Value
off-chain queries can be done by libraries such as hethers.js, as shown below.
Last updated