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 / balances.json
Created April 28, 2021 15:11
Randomly generated list of mock addresses and balances
[{
"address": "16v7w7fKBcw1aJiHae6Ma9rgUQG6MQvgNa",
"balance": 2551004338039
}, {
"address": "1FzCbuRFYPYsMHNpZb9Q4VQoCALM3jvK28",
"balance": 1253382145918
}, {
"address": "1ELav7t52hcWua9v2hiJqwLLgpR2fJ6XE4",
"balance": 1359497538200
}, {

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 20:19 — 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=
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

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
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;
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
// 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
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 October 26, 2019 14:51
Solidity 5 Chainlinked contract for Remix
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
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;