Skip to content

Instantly share code, notes, and snippets.

@camharris
camharris / example.js
Created Jan 12, 2022
How to setup rpc endpoints for tronweb
View example.js
const TronWeb = require('tronweb')
const server = 'SERVER_ADDRESS_GOES_HERE'
const username = 'USERNAME_GOES_HERE';
const password = 'PASSWORD_GOES_HERE';
const rpc_url = (`https://${username}:${password}@${server}`);
// Build out rpc endpoints to be passed as seperate nodes
// since our node provides different endpoints for each tron api
const fullNodeEndpoint = (`${rpc_url}/full`);
@camharris
camharris / GhoulPriceConsumer.sol
Created Sep 16, 2021
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=
View GhoulPriceConsumer.sol
// 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;
@camharris
camharris / ghoulPrice.sol
Created Sep 11, 2021
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=
View ghoulPrice.sol
// 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;
@camharris
camharris / AlarmClockExample.sol
Last active Aug 23, 2021
kovan alarm clock contract
View AlarmClockExample.sol
/** 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 / WorkingAlarmClockSample.sol
Created Aug 23, 2021
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=
View WorkingAlarmClockSample.sol
/** 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 / Oracle.sol
Created Aug 13, 2021
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=
View Oracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.4.24;
import "@chainlink/contracts/src/v0.4/Oracle.sol";
@camharris
camharris / Oracle.sol
Created Aug 13, 2021
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=
View Oracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.4.24;
import "@chainlink/contracts/src/v0.4/Oracle.sol";
@camharris
camharris / walletExample.sol
Created Aug 11, 2021
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=
View walletExample.sol
pragma solidity ^0.6.0;
contract MyWallet {
address payable private owner;
constructor() public {
owner = msg.sender;
}
receive() external payable {
@camharris
camharris / gist-e71aab73726c5a2f99ee00c1a70cfef8...AlarmClockSample.sol
Created Aug 11, 2021
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=
View gist-e71aab73726c5a2f99ee00c1a70cfef8...AlarmClockSample.sol
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;
View gist:27962f5ac45c06dc6d0ac1a265470a40
### 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: