Skip to content

Instantly share code, notes, and snippets.

View PatrickAlphaC's full-sized avatar
💭
Enabling web3 developers at scale

Patrick Collins PatrickAlphaC

💭
Enabling web3 developers at scale
View GitHub Profile
@PatrickAlphaC
PatrickAlphaC / getDataSelfAggregate.sol
Last active May 12, 2020 20:27
Getting data in a more decentralized way, without any of the tools already built
pragma solidity ^0.6.0;
import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
// MyContract inherits the ChainlinkClient contract to gain the
// functionality of creating Chainlink requests
contract ChainlinkExample is ChainlinkClient {
// Stores the answer from the Chainlink oracle
uint256 public currentPrice;
@PatrickAlphaC
PatrickAlphaC / getDataPreCoordinator.sol
Created May 10, 2020 20:07
Get data using the precoordinator tool
pragma solidity ^0.6.0;
import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
// MyContract inherits the ChainlinkClient contract to gain the
// functionality of creating Chainlink requests
contract ChainlinkExample is ChainlinkClient {
// Stores the answer from the Chainlink oracle
uint256 public currentPrice;
address public owner;
pragma solidity ^0.6.0;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/interfaces/AggregatorInterface.sol";
contract ReferenceConsumer {
AggregatorInterface internal ref;
/**
* @dev Ropsten example _aggregator:
* @dev ETH/USD feed: 0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507
@PatrickAlphaC
PatrickAlphaC / Verifiable6SidedDiceRoll.sol
Last active July 9, 2020 20:10
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.2+commit.bacdbe57.js&optimize=false&gist=9be4bfc3abde316990d77fdb24243134
pragma solidity 0.6.2;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/VRFConsumerBase.sol";
contract VRFTestnetD20 is VRFConsumerBase {
using SafeMath_Chainlink for uint;
uint256[] public d20Results;
bytes32 internal keyHash;
pragma solidity ^0.6.0;
import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
// MyContract inherits the ChainlinkClient contract to gain the
// functionality of creating Chainlink requests
contract ChainlinkExample is ChainlinkClient {
// Stores the answer from the Chainlink oracle
uint256 public currentPrice;
address public owner;
pragma solidity 0.6.6;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/7a4e19a8ff07db1be0b397465d38d175bc0bb5b5/evm-contracts/src/v0.6/VRFConsumerBase.sol";
contract VRFTestnetD20 is VRFConsumerBase {
uint256[] public d20Results;
bytes32 internal keyHash;
uint256 internal fee;

This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.

✅ did:3:bafyreigupljw4bnnd54uzuf3wqvvg7qw2ivuhby2l6mz5phjwfyqvw7gje ✅

Create your profile today to start building social connection and trust online at https://3Box.io/

@PatrickAlphaC
PatrickAlphaC / getStockPriceHTTPGet.sol
Last active July 26, 2020 09:55
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&gist=51c6a80fd90b460aa9c1cd61bab78ea0
pragma solidity ^0.6.0;
import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
// MyContract inherits the ChainlinkClient contract to gain the
// functionality of creating Chainlink requests
contract ChainlinkExample is ChainlinkClient {
// Stores the answer from the Chainlink oracle
uint256 public currentPrice;
address public owner;
@PatrickAlphaC
PatrickAlphaC / getStockPriceOracleAccess.sol
Last active July 26, 2020 09:55
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&gist=7f4f845aa75195c0ce19bf8a3f062e34
pragma solidity ^0.6.0;
import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
// MyContract inherits the ChainlinkClient contract to gain the
// functionality of creating Chainlink requests
contract ChainlinkExample is ChainlinkClient {
// Stores the answer from the Chainlink oracle
uint256 public currentPrice;
address public owner;
@PatrickAlphaC
PatrickAlphaC / Randomness.sol
Last active August 7, 2020 03:57
A decentralized provably random lottery. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=b3939b346828763673a188007e8f487c
pragma solidity 0.6.6;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/7a4e19a8ff07db1be0b397465d38d175bc0bb5b5/evm-contracts/src/v0.6/VRFConsumerBase.sol";
import {lottery_man_interface} from "./lottery_man_interface.sol";
import {governance_interface} from "./governance_interface.sol";
contract RandomNumberConsumer is VRFConsumerBase {
bytes32 internal keyHash;
uint256 internal fee;