Skip to content

Instantly share code, notes, and snippets.

View TrevorJTClarke's full-sized avatar
🙈

Trevor Clarke TrevorJTClarke

🙈
View GitHub Profile
axios({
method:'get',
url: 'https://web3api.io/api/v1/tokens/ETHEREUM_ADDRESS_HERE/transfers',
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
}).then(res => {
// res data example:
// {
// "totalRecords": 3545827,
// "records": [
// {
axios({
method:'get',
url: 'https://web3api.io/api/v1/addresses/ETHEREUM_ADDRESS_HERE/tokens',
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
}).then(res => {
// res data example:
// {
// "totalRecords": "738",
// "records": [
// {
axios({
method:'get',
url: 'https://web3api.io/api/v1/addresses/ETHEREUM_ADDRESS_HERE/transactions',
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
}).then(res => {
// res data example:
{
"totalRecords": 3300291,
"records": [
{
axios({
method:'get',
url: 'https://web3api.io/api/v1/addresses/ETHEREUM_ADDRESS_HERE/account-balances/latest',
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
}).then(res => {
// res data example:
// {
// "address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
// "blockNumber": "7280439",
// "timestamp": 1551391449000,
axios({
method:'get',
url: 'https://web3api.io/api/v1/transactions/gas/percentiles',
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
}).then(res => {
// res data example:
// {
// "percentile_000": 0,
// "percentile_001": 0,
// "percentile_002": 0,
axios({
method:'get',
url: 'https://web3api.io/api/v1/transactions/gas/predictions',
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
}).then(res => {
// res data example:
// {
// "average": {
// "gasPrice": 2000000000,
// "numBlocks": 4,
@TrevorJTClarke
TrevorJTClarke / Snapshot_4bytes
Last active February 28, 2019 23:11
snapshot of random sampling (127M out of 400M txns):
Count Signature % % (without 0x) Function
222,852,719 0x 55.96% ETH TRANSFER
87,649,468 0xa9059cbb 22.01% 49.97% transfer(address,uint256) OR many_msg_babbage(bytes1)
4,265,659 0x0a19b14a 1.07% 2.43% trade(address,uint256,address,uint256,uint256,uint256,address,uint8,bytes32,bytes32,uint256)
3,935,612 0x6ea056a9 0.99% 2.24% sweep(address,uint256)
3,297,997 0xef343588 0.83% 1.88% trade(uint256[8],address[4],uint8[2],bytes32[4])
3,247,646 0x0f2c9329 0.82% 1.85% split(address,address)
2,960,633 0x095ea7b3 0.74% 1.69% approve(address,uint256)
2,476,038 0x00000000 0.62% 1.41% -
2,470,649 0xa9b1d507 0.62% 1.41% makeWallet()
@TrevorJTClarke
TrevorJTClarke / sc_audit_stats.csv
Last active October 28, 2018 17:37
Smart Contract Security Audit Stats
Success Warnings Information
161,914 38,618 6,927
@TrevorJTClarke
TrevorJTClarke / sc_audit_vuln.csv
Last active October 28, 2018 17:15
Smart Contract Audit Vulnerabilities
Vulnerability Count
Integer Overflow 100,635
Message CALL to External Contract 84,964
Exception State 8,908
Multiple CALLs 518
DELEGATECALL to a User-Supplied Address 458
Unchecked CALL return value 224
Use of tx.origin 185
Integer Underflow 173
Ether Send 125
@TrevorJTClarke
TrevorJTClarke / hexFromImage.js
Last active May 24, 2018 17:04
Get Color From Image
function rgbToHex(r, g, b) {
if (r > 255 || g > 255 || b > 255) throw 'Invalid color component'
return ((r << 16) | (g << 8) | b).toString(16)
}
const generateColor = src => {
return new Promise((res, rej) => {
let c = document.createElement('canvas')
if (c.getContext) {
c = c.getContext('2d')