This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.8.0-buster AS charm | |
# Get the Dockerfile from here | |
# https://raw.githubusercontent.com/sbellem/docker-charm-crypto/master/latest/python3.8/buster/Dockerfile | |
# docker build -f docker-charm-crypto/master/latest/python3.8/buster/Dockerfile -t charm . | |
ENV PYTHONUNBUFFERED 1 | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
bison \ | |
flex \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Struct AddrBal = { address addr; uint balance }; | |
enum RequestType = { TRANSFER; DEPOSIT; WITHDRAW }; | |
Struct Request = { RequestType type, address from; address to; uint amt; bytes32 memo } | |
Struct Response = { uint seqNo, bool status, uint amt, string response }; | |
contract { | |
// Key for encryption | |
bytes32 key; | |
// Checkpoint public state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.0; | |
// "SPDX-License-Identifier: UNLICENSED" | |
/* | |
Honey Object as an Oasis Sapphire contract | |
Could be used to demonstrate side channels | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://xiaziyna.github.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
contract MyContract { | |
// 0x83CC162a944afA8537DAaDec8f39C88E4B6c4E31 mainnet registry | |
// mainnet resolver | |
// 0x12a0083531C904fe4ac490DF231c2e4e4403dB60 ropsten registry | |
// 0x12299799a50340FB860D276805E78550cBaD3De3 ropsten resolver | |
ETHRegistrarController registrar = ETHRegistrarController(0x12a0083531C904fe4ac490DF231c2e4e4403dB60); | |
BaseRegistrar base = BaseRegistrar(0x227Fcb6Ddf14880413EF4f1A3dF2Bbb32bcb29d7); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, sys | |
import subprocess | |
import requests | |
import time | |
import csv | |
import re | |
balances = {} # map addr => balance | |
# Parse the vote string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.22; | |
contract ECVerify { | |
function ecrecovery(bytes32 hash, bytes sig) public pure returns (address) { | |
bytes32 r; | |
bytes32 s; | |
uint8 v; | |
if (sig.length != 65) { | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import concurrent.futures | |
import logging | |
import time | |
import random | |
# Examples of running in executor | |
# https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor | |
# https://pymotw.com/3/asyncio/executors.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import concurrent.futures | |
import logging | |
import time | |
import cffi | |
import random | |
# Examples of running in executor | |
# https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor | |
# https://pymotw.com/3/asyncio/executors.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.22; | |
import "gist/Timer.sol"; | |
contract Auction { | |
address internal timerAddress; | |
address internal sellerAddress; | |
address internal winnerAddress; | |
// constructor |
NewerOlder