Skip to content

Instantly share code, notes, and snippets.

@camharris
camharris / backup-github-orgs.py
Created April 26, 2017 23:16
backup-github-orgs.py
#!/usr/bin/python
import subprocess
import os
import simplejson
import urllib2
import base64
import re
# Simple script to backup all our repos under all our orginizations
# This script requires the system user running it to have an ssh-key installed for the github user in question
@camharris
camharris / ExampleConsumer.sol
Created July 7, 2021 00:52
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.4.24+commit.e67f0147.js&optimize=true&runs=200&gist=
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 ExampleConsumer is ChainlinkClient, Ownable {
uint256 constant private ORACLE_PAYMENT = 1 * LINK;
// Apy standard deviation
string public ApyStd;
### Keybase proof
I hereby claim:
* I am camharris on github.
* I am camharris (https://keybase.io/camharris) on keybase.
* I have a public key ASChI-B5XLLB1PHO6I-2JwgKCNzTXDw2OmgIg7bCf8wOPgo
To claim this, I am signing this object:
@camharris
camharris / gist-e71aab73726c5a2f99ee00c1a70cfef8...AlarmClockSample.sol
Created August 11, 2021 04:47
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.4.24+commit.e67f0147.js&optimize=true&runs=200&gist=
pragma solidity 0.4.24;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.4/ChainlinkClient.sol";
contract AlarmClockSample is ChainlinkClient {
bool public alarmDone;
address private oracle;
@camharris
camharris / walletExample.sol
Created August 11, 2021 07:15
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.6.12+commit.27d51765.js&optimize=true&runs=200&gist=
pragma solidity ^0.6.0;
contract MyWallet {
address payable private owner;
constructor() public {
owner = msg.sender;
}
receive() external payable {
@camharris
camharris / Oracle.sol
Created August 13, 2021 20:25
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.4.24+commit.e67f0147.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.4.24;
import "@chainlink/contracts/src/v0.4/Oracle.sol";
@camharris
camharris / Oracle.sol
Created August 13, 2021 20:41
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.4.24+commit.e67f0147.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.4.24;
import "@chainlink/contracts/src/v0.4/Oracle.sol";
@camharris
camharris / WorkingAlarmClockSample.sol
Created August 23, 2021 02:40
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.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
/** This example code is designed to quickly deploy an example contract using Remix.
* If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough
* You will need testnet ETH and LINK.
* - Kovan ETH faucet: https://faucet.kovan.network/
* - Kovan LINK faucet: https://kovan.chain.link/
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
@camharris
camharris / AlarmClockExample.sol
Last active August 23, 2021 02:42
kovan alarm clock contract
/** This example code is designed to quickly deploy an example contract using Remix.
* If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough
* You will need testnet ETH and LINK.
* - Kovan ETH faucet: https://faucet.kovan.network/
* - Kovan LINK faucet: https://kovan.chain.link/
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
@camharris
camharris / ghoulPrice.sol
Created September 11, 2021 07:21
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.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.6.0;
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";
import "@chainlink/contracts/src/v0.6/vendor/Ownable.sol";
contract TestnetGhoulPrice is ChainlinkClient, Ownable {
uint256 constant private ORACLE_PAYMENT = 1 * LINK;
uint256 public currentPrice;