Skip to content

Instantly share code, notes, and snippets.

View wang502's full-sized avatar
💭
🍣

pmontaigne wang502

💭
🍣
View GitHub Profile
@wang502
wang502 / github...gnosis...conditional-tokens-market-makers...contracts...ERC20.sol
Created November 1, 2021 01:28
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.8.9+commit.e5eed63a.js&optimize=false&runs=200&gist=
// This is a backported hooked OpenZeppelin ERC 20 implementation
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
@wang502
wang502 / github...gnosis...conditional-tokens-contracts...contracts...CTHelpers.sol
Created November 1, 2021 01:28
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.8.9+commit.e5eed63a.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
library CTHelpers {
using SafeMath for uint;
/// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
/// @param oracle The account assigned to report the result for the prepared condition.
/// @param questionId An identifier for the question to be answered by the oracle.
@wang502
wang502 / github...gnosis...conditional-tokens-contracts...contracts...CTHelpers.sol
Created November 1, 2021 01:26
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.8.9+commit.e5eed63a.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
library CTHelpers {
using SafeMath for uint;
/// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
/// @param oracle The account assigned to report the result for the prepared condition.
/// @param questionId An identifier for the question to be answered by the oracle.
@wang502
wang502 / memsql_quickstart_transform.py
Last active January 14, 2020 05:00
Transform script for memsql pipeline quickstart handling name-value mapping in Kafka payload
#!/usr/bin/python
import json
import os
import struct
import sys
# dependencies are stored in a folder called python_deps
# relative to this script. This is setup by the Dockerfile.

Keybase proof

I hereby claim:

  • I am wang502 on github.
  • I am sethwxh (https://keybase.io/sethwxh) on keybase.
  • I have a public key whose fingerprint is 159A 40A3 8BDF 2E1E 1E59 8540 56AB 8DFD FD70 732F

To claim this, I am signing this object: