Skip to content

Instantly share code, notes, and snippets.

Avatar

Fourswords fourswordsio

View GitHub Profile
@fourswordsio
fourswordsio / based-existing-job.sol
Created Dec 29, 2020
Call existing GET job on Kovan node
View based-existing-job.sol
pragma solidity ^0.6.0;
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";
contract BasedGeckoConsumer is ChainlinkClient {
address private oracle;
bytes32 private jobId;
uint256 private fee;
uint256 public basedPrice;
@fourswordsio
fourswordsio / based-consumer.sol
Last active Dec 29, 2020
Based-Consumer-CoinGecko.sol
View based-consumer.sol
pragma solidity ^0.6.0;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/ChainlinkClient.sol";
contract ConsumerBasedMoney is ChainlinkClient {
uint256 public price;
address private oracle;
bytes32 private jobId;
@fourswordsio
fourswordsio / oracle-flat-v0.5.0.sol
Last active Dec 29, 2020
Chainlink Oracle Contract Flat v0.5
View oracle-flat-v0.5.0.sol
pragma solidity ^0.5.0;
/**
* @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.
View ownable.sol
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;
View erc721.sol
pragma solidity ^0.4.24;
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function transfer(address _to, uint256 _tokenId) public;
function approve(address _to, uint256 _tokenId) public;
function takeOwnership(uint256 _tokenId) public;
View atestconsumer-flat.sol
// File: https://github.com/smartcontractkit/chainlink/evm/contracts/vendor/Ownable.sol
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".
View oracle-flat-v0.4.24.sol
// File: https://github.com/smartcontractkit/chainlink/blob/develop/evm/contracts/interfaces/LinkTokenInterface.sol
pragma solidity ^0.4.24;
interface LinkTokenInterface {
function allowance(address owner, address spender) external returns (uint256 remaining);
function approve(address spender, uint256 value) external returns (bool success);
function balanceOf(address owner) external returns (uint256 balance);
function decimals() external returns (uint8 decimalPlaces);
function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
View node.env
ETH_URL=wss://ropsten-rpc.linkpool.io/ws
ROOT=/chainlink
LINK_CONTRACT_ADDRESS=0x20fe562d797a42dcb3399062ae9546cd06f6328
ETH_CHAIN_ID=3
LOG_LEVEL=debug
CHAINLINK_TLS_PORT=0
CHAINLINK_TLS_HOST=localhost
View keybase.md

Keybase proof

I hereby claim:

  • I am fourswordsio on github.
  • I am fourswords (https://keybase.io/fourswords) on keybase.
  • I have a public key whose fingerprint is 7238 5CD2 A748 E333 5B5D 295C 45B4 121C 598D 333F

To claim this, I am signing this object:

View Dockerfile
FROM golang:1.12-alpine as builder
ENV GO111MODULE=on
RUN apk add --no-cache make curl git gcc musl-dev linux-headers
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
ADD . /go/src/github.com/fourswordsio/bridges
RUN cd /go/src/github.com/fourswordsio/bridges/examples/gasstation && go get && go build -o gasstation