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 / multiword.json
Created July 29, 2021 17:48
Multi-word Job Spec
{
"name": "multi-word",
"initiators": [
{
"id": 139,
"jobSpecId": "bcf76dc2-7fd4-484f-ab68-1d3f239cd2c3",
"type": "runlog",
"params": {
"address": "0x7eb318734142a6375787379de2fa202e4058d03f"
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
/**
* @notice DO NOT USE THIS CODE IN PRODUCTION. This is an example contract.
*
* The job spec for this node is located here:
* https://gist.github.com/PatrickAlphaC/53848768b3ca6c747cf1166ccb2f65ec
@PatrickAlphaC
PatrickAlphaC / VRFD20.sol
Last active June 23, 2021 12:25 — forked from alexroan/VRFD20.sol
Game of Thrones 20 Sided Dice
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
import "@chainlink/contracts/src/v0.6/Owned.sol";
/**
* @notice A Chainlink VRF consumer which uses randomness to mimic the rolling
* of a 20 sided die
* @dev This is only an example implementation and not necessarily suitable for mainnet.
@PatrickAlphaC
PatrickAlphaC / APIConsumer.sol
Created June 23, 2021 12:10 — forked from alexroan/APIConsumer.sol
APIConsumer.sol
// This example code is designed to quickly deploy an example contract using Remix.
pragma solidity ^0.6.0;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/master/evm-contracts/src/v0.6/ChainlinkClient.sol";
contract APIConsumer is ChainlinkClient {
uint256 public volume;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract A {
uint public num;
address public sender;
uint public value;
function setVars(uint _num) public payable {
pragma solidity 0.6.6;
import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
/**
* THIS IS AN EXAMPLE CONTRACT WHICH USES HARDCODED VALUES FOR CLARITY.
* PLEASE DO NOT USE THIS CODE IN PRODUCTION.
*/
contract RandomNumberConsumer is VRFConsumerBase {
// This example code is designed to quickly deploy an example contract using Remix.
pragma solidity ^0.6.0;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/master/evm-contracts/src/v0.6/ChainlinkClient.sol";
contract APIConsumer is ChainlinkClient {
uint256 public volume;
address private oracle;
bytes32 private jobId;
uint256 private fee;
/**
* Network: Kovan
@PatrickAlphaC
PatrickAlphaC / setfulfillmentpermission_script.js
Last active March 24, 2021 05:08
setfulfillmentpermission_script.js
let ethers = require('ethers')
let provider = new ethers.providers.JsonRpcProvider(process.env.KOVAN_RPC_URL)
let oracleAddress = '0xCAB9Ba909AfC195F9B5a4323631cBA2f7D1609EC'
let oracleAbi = [
{
"constant": false,
"inputs": [
{
"name": "_sender",
pragma solidity ^0.6.7;
contract Counter {
uint256 public count;
constructor() public {
count = 0;
}