This gist has been deprecated. Please refer to the Gnosis Safe Devloper portal for all resources or reach out to the team via Discord.
This file contains hidden or 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.6.6; | |
pragma experimental ABIEncoderV2; | |
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol"; | |
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/FixedPoint.sol"; | |
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/FullMath.sol"; | |
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/Babylonian.sol"; | |
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/BitMath.sol"; | |
library SafeMath { |
This file contains hidden or 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
def isWrapPair(equivalentSets, tokenA, tokenB): | |
for equivalentSet in equivalentSets: | |
if ((tokenA in equivalentSet) and (tokenB in equivalentSet)): | |
return True | |
return False | |
equivalentSets = [ | |
["WETH", "aETH", "cETH", "iETH", "iETH", "PETH"], # ETH group | |
["DAI", "aDAI", "cDAI", "dDAI", "iDAI", "yDAI", "rDAI", "CHAI"], # DAI group | |
["USDC", "aUSDC", "cUSDC", "dUSDC", "iUSDC", "yUSDC"] # USDC group |
This file contains hidden or 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
with | |
double_entry_book as ( | |
-- debits | |
select to_address as address, CAST(value AS NUMERIC) as value, block_timestamp | |
from `bigquery-public-data.crypto_ethereum.token_transfers` | |
where from_address is not null and to_address is not null | |
and token_address = LOWER('0x408e41876cccdc0f92210600ef50372656052a38') --OMG | |
union all | |
-- credits | |
select from_address as address, -CAST(value AS NUMERIC) as value, block_timestamp |
This file contains hidden or 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
# Date, blocknum, difficulty as of 2019-01-18 | |
# Script by vbuterin, slightly modified by lrettig | |
import random | |
import datetime | |
import sys | |
def calc_bomb(i): | |
period = i // 100000 | |
if (period > 0): | |
# Subtract 2, this is the original formula |
This file contains hidden or 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
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
This file contains hidden or 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 "openzeppelin-solidity/contracts/ECRecovery.sol"; | |
contract InviteLink { | |
using ECRecovery for bytes32; | |
IERC1077 owner; | |
// Mappings of transit pub key => true if link is used. | |
mapping (bytes => bool) usedLinks; | |
constructor(IERC1077 _owner) { |
This file contains hidden or 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.16; | |
contract Token { | |
bytes32 public standard; | |
bytes32 public name; | |
bytes32 public symbol; | |
uint256 public totalSupply; | |
uint8 public decimals; | |
bool public allowTransactions; | |
mapping (address => uint256) public balanceOf; |
This file contains hidden or 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
# create assets folder in the current project | |
$ mkdir android/app/src/main/assets | |
# create bundle script | |
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ | |
# execute command to run android to create debug apk | |
$ react-native run-android | |
# Or change to android folder |