Skip to content

Instantly share code, notes, and snippets.

@clemsos
clemsos / cctp-attestation.js
Last active December 20, 2024 11:14
Get Circle CCTP attestation status using Hardhat and ethers js 6
import { ethers } from 'ethers'
const transactionHash =
'0xc37329f7bfada70be0a695031b270741542d1dd477fc0a2e0f476d242b8ff508'
// sepolia 11155111
const srcChainRPC = 'https://sepolia.gateway.tenderly.co'
// base sepolia 84532
const destChainRPC = 'https://base-sepolia.gateway.tenderly.co'
@clemsos
clemsos / listEvents.js
Last active November 29, 2024 14:23
List all events in contract ABi (human-readable format)
const { ethers } = require('hardhat')
async function main() {
const { interface } = await ethers.getContractFactory(
'contracts/PublicLock.sol:PublicLock'
)
const events = interface.fragments.filter((f) => f.type === 'event')
console.log(ethers.FormatType)
console.log(
`
@clemsos
clemsos / sighashes.js
Last active May 25, 2022 11:13
Hardhat script to generate all 4-bytes signature hashes for all Unlock contracts (shows a markdown array in the console)
const contracts = require('@unlock-protocol/contracts')
const { ethers } = require('hardhat')
const md = (sigs) => {
// show markdown array on screen
console.log('| Type | Name | SigHash |')
console.log('|---|---|---|')
sigs.forEach(([type, name, sighash]) =>
console.log(`| ${type} | ${name} | ${sighash} |`)
@clemsos
clemsos / import_crater.py
Created May 6, 2021 14:48
Import data into Crater craterapp.com
import requests
import re
import json
# set headers for lavarel
headers = { "Accept": "application/json" }
# session to store cookies
sess = requests.Session()
{"url":"https://link.medium.com/ZSCiKq63NU","postedBy":"clemsos","metadata":{},"context":null,"upvotes":[],"_id":"6he0NMOaIDsFIqL9"}
{"url":"https://m.isaca.org/About-ISACA/History/Documents/ISACA-Glossary-English-Chinese-Simplified_mis_Chi_0615.pdf","postedBy":"clemsos","metadata":{},"context":null,"upvotes":[],"_id":"7bMe8ECX6Aav93xc"}
{"metadata":{},"context":null,"upvotes":[],"_id":"CpmoIrxrL6WJz9D9"}
{"url":"https://docs.google.com/presentation/d/1YdrJPGRLTK2FQLy9zS-8DRHFtPbVBwX1EhrDzXnULTY/mobilepresent?slide=id.p","postedBy":"kidproto","metadata":{"name":"Google Docs","title":"EthCC 2019","description":"Ethereum 2.0 phase 0 Deep dive into the key objects","thumbnail":"https://lh4.googleusercontent.com/g21t-NmkFDCR_ju2YPmuplPyEIqQFGnqKSfLMSbLJt1S052-PJPhV4jN3Cout2bhZr7PlQ=w1200-h630-p"},"context":null,"upvotes":[],"_id":"F9kxCW7OO2cmVIej"}
{"url":"https://itnext.io/part-1-building-a-bookmark-manager-telegram-bot-node-js-vue-js-972bb7198def","postedBy":"clemsos","metadata":{"name":"ITNEXT","title":"[Part
@clemsos
clemsos / stations_clusters_1.json
Last active January 17, 2019 14:57
Weather stations clusters coordinates
[
{
"coords": [
91.75766071072317,
20.540037858066356
],
"count": 8020
},
{
"coords": [
@clemsos
clemsos / Gaussienne.ipynb
Last active October 4, 2018 12:59
Gausienne test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@clemsos
clemsos / .block
Last active October 2, 2018 19:47
Gaussienne
license: mit
@clemsos
clemsos / .block
Created October 2, 2018 19:21
Gaussienne
license: mit
@clemsos
clemsos / .block
Last active July 5, 2018 11:27
Earth from above
license: mit