Skip to content

Instantly share code, notes, and snippets.

View thodges-gh's full-sized avatar
⛓️
Linking chains

Thomas thodges-gh

⛓️
Linking chains
View GitHub Profile
@thodges-gh
thodges-gh / Oracle.sol
Last active September 20, 2020 17:31
pragma solidity 0.4.24;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.4/Oracle.sol";
pragma solidity 0.4.24;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.4/ChainlinkClient.sol";
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.4/vendor/Ownable.sol";
contract ATestnetConsumer is ChainlinkClient, Ownable {
uint256 constant private ORACLE_PAYMENT = 1 * LINK;
uint256 public currentPrice;
int256 public changeDay;
// File: @ensdomains/buffer/contracts/Buffer.sol
pragma solidity >0.4.18;
/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for writing to them. At any time you can fetch a bytes object containing the
pragma solidity 0.4.24;
import "https://github.com/thodges-gh/chainlink/evm/contracts/Oracle.sol";
pragma solidity 0.4.24;
import { Ownable as Ownable_Chainlink } from "https://github.com/thodges-gh/chainlink/evm/contracts/vendor/Ownable.sol";
import { SafeMath as SafeMath_Chainlink } from "https://github.com/thodges-gh/chainlink/evm/contracts/vendor/SafeMath.sol";
import "https://github.com/thodges-gh/chainlink/evm/contracts/interfaces/ChainlinkRequestInterface.sol";
import "https://github.com/thodges-gh/chainlink/evm/contracts/interfaces/OracleInterface.sol";
import "https://github.com/thodges-gh/chainlink/evm/contracts/interfaces/LinkTokenInterface.sol";
/**
* @title The Chainlink Oracle contract
pragma solidity 0.4.24;
import "https://github.com/thodges-gh/chainlink/evm/contracts/ChainlinkClient.sol";
import "https://github.com/thodges-gh/chainlink/evm/contracts/vendor/Ownable.sol";
contract ATestnetConsumer is ChainlinkClient, Ownable {
uint256 constant private ORACLE_PAYMENT = 1 * LINK;
uint256 public currentPrice;
int256 public changeDay;
@thodges-gh
thodges-gh / ATestnetConsumer.sol
Last active August 7, 2019 22:34
VWAP Interval
// File: @ensdomains/buffer/contracts/Buffer.sol
pragma solidity >0.4.18;
/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for writing to them. At any time you can fetch a bytes object containing the
@thodges-gh
thodges-gh / ATestnetConsumer.sol
Created August 2, 2019 17:24
A Chainlink example with Solidity 5 support
// File: @ensdomains/buffer/contracts/Buffer.sol
pragma solidity >0.4.18;
/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for writing to them. At any time you can fetch a bytes object containing the
@thodges-gh
thodges-gh / AliceAndBob.sol
Created July 9, 2019 20:29
A Chainlink contract which uses the ETH/USD reference data
// File: @ensdomains/buffer/contracts/Buffer.sol
pragma solidity >0.4.18;
/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for writing to them. At any time you can fetch a bytes object containing the
@thodges-gh
thodges-gh / AChainlinkTester.sol
Last active June 28, 2019 19:43
Chainlink contract that allows for a single call or looping through multiple calls to an oracle
// File: @ensdomains/buffer/contracts/Buffer.sol
pragma solidity >0.4.18;
/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for writing to them. At any time you can fetch a bytes object containing the