Skip to content

Instantly share code, notes, and snippets.

View ijonas's full-sized avatar

Ijonas Kisselbach ijonas

View GitHub Profile
ijonas /
Last active October 17, 2022 04:32
Antoine Oracle

Antoine's Oracle

This is a sample smart contract that connects to the Translucent Oracle on Goerli and retrieves a dynamic list of strings from a JSON API.

Oracle Job Details

  • Oracle Address - 0x188b71C9d27cDeE01B9b0dfF5C1aff62E8D6F434
  • Job ID - a72b502cccf444e49e4d4768017b6572
  • LINK token address on Goerli - 0x326C977E6efc84E512bB9C30f76E30c160eD06FB

Calling the API

type = "directrequest"
schemaVersion = 1
name = "Get > Uint256 0.05LINK"
minContractPaymentLinkJuels = 50000000000000000
maxTaskDuration = "0s"
contractAddress = "CONTRACT ADDRESS"
minIncomingConfirmations = 0
observationSource = """
decode_log [type="ethabidecodelog"
abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
ijonas / CallingContract.sol
Last active April 5, 2022 12:20
Fetching a string-value via an Oracle
contract MyContract {
string public lastMarket;
function requestEthereumLastMarket(address _oracle, string memory _jobId)
Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(_jobId), address(this), this.fulfillEthereumLastMarket.selector);
req.add("get", "");
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.8.7;
pragma abicoder v2;
import './TransferHelper.sol';
import './ISwapRouter.sol';
contract SwapExamples {
// For the scope of these swap examples,
// we will detail the design considerations when using
pragma solidity 0.7.1;
import "";
contract UniswapExample {
address internal constant UNISWAP_ROUTER_ADDRESS = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ;
IUniswapV2Router02 public uniswapRouter;
address private multiDaiKovan = 0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa;
account_id = 3
case_type_id = 22
bucket_id = 102
admin_user_id = 8
current_state_id = 72
# QA
account_id = 1
case_type_id = 18
ijonas / gist:0386c6e01c1479c9321e162be137d95c
Created September 19, 2016 21:39
How to handle errors in #golang
Below are a bunch of resources that help you grok error handling in Go.
* Listen to Go Time Podcast #16, specifically the parts on error handling
* Read
* Read
* Use the errors pkg for some syntactic sugar...
Use Dave Cheney's "rules"... either handle the error locally and then never again (e.g. log to stderr) OR
pass the error up the call stack. Consider annotating the error... errors.Wrapf(err, "Unable to access %s upload folder", account)
before passing it back up the stack.
TASK [setup] *******************************************************************
ok: [localhost]
TASK [genesis-digitalocean : Get the default SSH key] **************************
changed: [localhost]
TASK [genesis-digitalocean : Add the SSH key to DigitalOcean if it doesn't already exist] ***
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: name 'DoError' is not defined
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n File \"/var/folders/b_/pqyqvn4s0xldl2cm4mfnqkb00000gn/T/ansible_8biPQo/\", line 187, in <module>\n class TimeoutError(DoError):\nNameError: name 'DoError' is not defined\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}
ijonas / gist:7766492
Created December 3, 2013 09:23
DiDate Docker Install Steps
# after launching an Ubuntu 12.04 instance and ssh-ing into the VM
apt-get update
apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
# ssh-ing back into the VM
sh -c "wget -qO- | apt-key add -"
sh -c "echo deb docker main /etc/apt/sources.list.d/docker.list"
apt-get update
apt-get install lxc-docker