Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas thodges-gh

View GitHub Profile
View README.md

Instructions

  • Run the app.js file:
node app.js
  • Call the adapter with curl:
curl -X POST -H 'content-type: application/json' -d '{"id":"abc123","data":{"pool":"0x0d65b0802d0713bac6426cf4935d252807f59136000000000000000000000000","level":1}}' http://localhost:8080
@thodges-gh
thodges-gh / GetData.sol
Last active May 12, 2020 — forked from PatrickAlphaC/chainlinkVRFDemo.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.17+commit.d19bba13.js&optimize=false&gist=
View GetData.sol
pragma solidity ^0.6.0;
import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
contract GetData is ChainlinkClient {
uint256 public currentPrice;
address public owner;
constructor() public {
// Sets the address of the LINK token when deployed to a public blockchain
View fork-clone.md

Forking and making changes to a private repo

  1. Fork the repo in Github to your account (exampleorg/examplerepo -> personal/examplerepo)
  2. Clone your fork of the repo
git clone git@github.com:personal/examplerepo.git
  1. Add the remote of the original repo as the upstream
git remote add upstream git@github.com:exampleorg/examplerepo.git
View Oracle.sol
pragma solidity 0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
View PrepaidAggregator.sol
pragma solidity 0.5.14;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
View BasicConsumer.sol
// File: contracts/vendor/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
View Betterman.sol
pragma solidity 0.4.24;
import "https://github.com/smartcontractkit/chainlink/evm/contracts/ChainlinkClient.sol";
contract Betterman is ChainlinkClient {
uint256 private ORACLE_PAYMENT = 1 * LINK;
uint256 public currentTemp;
constructor() public {
@thodges-gh
thodges-gh / MyContract.sol
Created Oct 26, 2019
Solidity 5 Chainlinked contract for Remix
View MyContract.sol
pragma solidity >=0.5.0;
import "https://github.com/smartcontractkit/chainlink/evm/v0.5/contracts/ChainlinkClient.sol";
import "https://github.com/smartcontractkit/chainlink/evm/v0.5/contracts/vendor/Ownable.sol";
/**
* @title MyContract is an example contract which requests data from
* the Chainlink network
* @dev This contract is designed to work on multiple networks, including
* local test networks
View DepositTester.sol
pragma solidity 0.5.0;
interface LinkTokenInterface {
function balanceOf(address owner) external returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool success);
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);
}
interface CoordinatorInterface {
function withdraw(address recipient, uint256 amount) external;
View Oracle.sol
pragma solidity 0.4.24;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.4/Oracle.sol";
You can’t perform that action at this time.