📈
Everipedia
  • Home
  • Everipedia API
    • Everipedia.org REST API
  • Everipedia OraQles
    • About
    • Data Partners
      • Associated Press
  • Current OraQles Projects
    • January 5th, 2021 Senate Runoff
      • Ethers.js tutorial
      • Solidity Tutorial
  • Past OraQles Projects
    • 2020 US Presidential Election
      • 2020 US Presidential Election - Ethereum
        • Fetch election calls with Solidity
        • Fetch election calls with web3
        • Mainnet Oracle Data
        • Kovan Testnet Oracle Data
      • 2020 US Presidential Election - EOS
Powered by GitBook
On this page
  • 🚀 Want a shortcut? 🚀
  • Walkthrough

Was this helpful?

  1. Current OraQles Projects
  2. January 5th, 2021 Senate Runoff

Solidity Tutorial

PreviousEthers.js tutorialNext2020 US Presidential Election

Last updated 4 years ago

Was this helpful?

🚀 Want a shortcut? 🚀

.

Walkthrough

  1. Install the contract via npm

npm install oraqle-contracts
# OR
yarn add oraqle-contracts

2. Set pragma and import the senate contract at the top of your smart contract

pragma solidity 0.6.11;

import "oraqle-contracts/contracts/associated-press/Jan2021SenateRunoffs.sol";

3. Paste in this example code and change the parts your need! Don't forget to change the deployed contract address for production.

contract IsPerdueWinner {
    Jan2021SenateRunoffs internal senateRunoffContract;

    constructor() public {
        senateRunoffContract = Jan2021SenateRunoffs(
            0x0792724900B551d200D954a5Ed709d9514d73A9F
        );
    }

    function isPerdueWinner() public view returns (bool) {
        return
            keccak256(
                bytes(senateRunoffContract.winners("U.S. Senate Class II"))
            ) == keccak256(bytes("Perdue"));
    }
}

6. Still having issues?

4. Validate on kovan that you are getting :

5. Replace the smart contract address on line 6 above with and get ready for January 5th!

Tweet to and any engineering questions (or send a DM on Twitter to )

Start with our boilerplate Solidity smart contract on GitHub
the following results
the production contract address
Refer to our example repo
@dawsonbotsford
@everipedia
@dawsonbotsford