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
// Example usage: | |
// | |
// console.table(await debugEvents(origin.contractService, {fromBlock:175, topics:[]})) | |
// | |
async function debugEvents(contractService, options){ | |
const web3 = contractService.web3 | |
// Lookup table for contracts from bytecode |
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
out = {} | |
for (const k in originTest.contractService.contracts) { | |
out[k] = {4: {address:originTest.contractService.contracts[k].networks[4].address}} | |
} | |
JSON.stringify(out) |
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 numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import json | |
%matplotlib inline | |
%config InlineBackend.figure_format = 'retina' | |
pd.options.mode.chained_assignment = None |
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 sets | |
import engine | |
import strutils | |
import math | |
# import log | |
type | |
Atc* = ref object of RootObj | |
available*: HashSet[Ship] | |
occupied*: seq[bool] |
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
# If running against any data you care about, check the results of each command for success before running the next command. | |
# Create new index | |
curl -X PUT "localhost:9200/listings_two" -H 'Content-Type: application/json' -d' | |
{ | |
"mappings":{"listing":{"properties":{"price.amount":{"type":"double"},"price.currency.id":{"type":"keyword"},"commission":{"type":"double"},"commissionPerUnit":{"type":"double"},"unitsTotal":{"type":"integer"},"language":{"type":"keyword"},"listingType":{"type":"keyword"},"status":{"type":"keyword"},"marketplacePublisher":{"type":"keyword"},"category":{"type":"keyword","copy_to":"all_text"},"subCategory":{"type":"keyword","copy_to":"all_text"},"description":{"type":"text","copy_to":"all_text"},"title":{"type":"text","copy_to":"all_text"},"all_text":{"type":"text"}}}} | |
} | |
' | |
# copy listings to new index |
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
const fs = require('fs') | |
const chalk = require('chalk') | |
const trace = JSON.parse(fs.readFileSync('2019_08_09_mike_fail.json')) | |
const logs = trace.result.structLogs as TraceLog[] | |
interface TraceLog { | |
depth: number | |
error: string | |
gas: number, |
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.6.0; | |
// Calling SafeERC20.safeTransfer and SafeERC20.safeTransferFrom can fail | |
// with a "SafeERC20: ERC20 operation did not succeed" message when the | |
// underlying cause is running out of gas inside the transfer | |
// This is because the low level call to the ERC20 is indeed reverted by | |
// running out of gas, but that revert is caught, and a different revert | |
// is raised by the safeTransfer method. |
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 pandas as pd | |
import numpy as np | |
import secrets | |
num = 800 | |
addresses = ['0x'+secrets.token_hex(20) for _ in range(0,num)] | |
amounts = np.power(1200000, np.random.rand(num)*np.random.rand(num)) | |
df = pd.DataFrame({'address':addresses, 'amount':amounts}) | |
df.to_csv('sample_amounts.csv') |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.7; | |
interface KeeperCompatibleInterface { | |
function checkUpkeep(bytes calldata checkData) | |
external | |
returns (bool upkeepNeeded, bytes memory performData); | |
function performUpkeep(bytes calldata performData) external; | |
} |