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.7.0; | |
// Each mining pool that intends to provide flash loans deploys a Loaner contract and transfers ETH to it | |
// When testing each bundle, the diff in balance in this contract is taking into account for calculating effective gas price | |
// The contract loans funds only on blocks mined by the miner and on zero-gasprice txs | |
contract Loaner { | |
address immutable owner; | |
constructor(address _owner) { | |
owner = _owner; |
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 { Injectable } from '@angular/core'; | |
import { ContractService } from './contract.service'; | |
import { WalletService } from './wallet.service'; | |
/* | |
Usage: | |
- contract has a reference to the multicall address for the relevant network you're on | |
- format your argument to makeMulticall as a list of objects: | |
multicallFns = [ | |
"call1": { |
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
/** | |
* Base contract that all upgradeable contracts should use. | |
* | |
* Contracts implementing this interface are all called using delegatecall from | |
* a dispatcher. As a result, the _sizes and _dest variables are shared with the | |
* dispatcher contract, which allows the called contract to update these at will. | |
* | |
* _sizes is a map of function signatures to return value sizes. Due to EVM | |
* limitations, these need to be populated by the target contract, so the | |
* dispatcher knows how many bytes of data to return from called functions. |
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
#!/usr/bin/python3 | |
__base__ = 'https://github.com/thomdixon/pysha2/blob/master/sha2/sha256.py' | |
__author__ = 'Lukas Prokop' | |
__license__ = 'MIT' | |
import copy | |
import struct | |
import binascii |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
/* | |
* base58.js | |
* - encodes integers to and decodes from a base58 (or your own) base58 alphabet | |
* - based on Flickr's url shortening | |
* | |
* usage: | |
* base58.encode(integer); | |
* base58.decode(string); | |
* | |
* (c) 2012 inflammable/raromachine |