Skip to content

Instantly share code, notes, and snippets.

View 0xGabi's full-sized avatar
🐝
Always learning

Gabi 0xGabi

🐝
Always learning
View GitHub Profile
@0xGabi
0xGabi / Merkle-root
Last active April 12, 2023 23:42
Example merkle root with claims for the default foundry test addresses with the propose of testing MimeToken contract. Generated using: https://github.com/Uniswap/merkle-distributor
{
"merkleRoot": "0x47c52ef48ec180964d648c3783e0b02202f16211392b986fbe2627f021657f2b",
"tokenTotal": "0xbdbc41e0348b300000",
"claims": {
"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC": {
"index": 0,
"amount": "0x3635c9adc5dea00000",
"proof": [
"0x11079118024000df209172a1af6eb7a9ea4e5b2bd6e2760481566ce6bee3e0cd",
"0xf46478da86f39b5d4f0af753bbc54ab402404b5ed5369f359e8fb24268b12edc"
@0xGabi
0xGabi / vote.ts
Last active November 2, 2022 21:07
Test 1Hive's Conviction Voting update of maxRatio parameter to 20%
import hre, { ethers } from 'hardhat';
import { BigNumber, Contract } from 'ethers';
import { expect } from 'chai';
const gardenHolder = '0x5b0F8D8f47E3fDF7eE1c337AbCA19dBba98524e6';
const gardenVoters = [
'0x6120f29ccb5b1DDaa5a747235F257Ef6cB47970F',
'0xc89000E12C600b12D6e61a535cD3fedd4ac1eeC4',
'0xa328500Eab25698b8b146D195F35f5b26C93AAEe',
];
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
@0xGabi
0xGabi / launch.json
Created October 23, 2021 21:45
VSCode configuration to debug using hardhat in a monorepo
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "hardhat test",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${workspaceFolder}/packages/hardhat/node_modules/.bin/hardhat",
"args": ["test", "--network", "localhost"],
@0xGabi
0xGabi / launch.json
Created October 23, 2021 21:44
VSCode configuration to debug websites in Brave
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Brave",
"runtimeExecutable": "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
"userDataDir": true,
"url": "http://localhost:3000",
## Ethereum Fundamental Concepts
- [Intro to Ethereum](https://ethereum.org/en/developers/docs/intro-to-ethereum/)
- [Accounts](https://ethereum.org/en/developers/docs/accounts/)
- [Blocks](https://ethereum.org/en/developers/docs/blocks/)
- [Transactions](https://ethereum.org/en/developers/docs/transactions/)
- [Blockchain demo](https://andersbrownworth.com/blockchain/)
## eth.build**
- [Playground](https://eth.build)
- [Video tutorials](https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi)
@0xGabi
0xGabi / agent-act-with-connect.js
Last active August 3, 2020 21:39
Example of how to use Aragon Connect to interact with a 3rd party smart contract using the Agent app of the organization. The example is doing an approve call to the cDAI mainnet smart contract.
import { ethers } from 'ethers'
import { connect } from '@aragon/connect'
const ACCOUNT = '0xf76604Ce7e7F0134a5310bCfc9C34cAEddf15873'
const targetAddress = '0x5d3a536e4d6dbd6114cc1ead35777bab948e3643' // cDAI
const targetSignature =
'function approve(address spender, uint256 amount) external returns (bool)'
const namehash = require('eth-ens-namehash').hash
const tldName = 'conviction-experimental.open.aragonpm.eth'
const tldHash = namehash(tldName)
console.log(`Namehash: ${tldHash}`)
@0xGabi
0xGabi / arapp.json
Last active February 20, 2020 02:26
{
"environments": {
"rinkeby": {
"registry": "0x98df287b6c145399aaa709692c8d308357bc085d",
"appName": "test.aragonpm.eth",
"wsRPC": "wss://rinkeby.infura.io/ws/v3/infurakey",
"network": "rinkeby"
}
}
}
Agent created a vote to begin setup
Creating accounting component
Error: Node error: {"code":-32601,"message":"The method eth_sendTransaction does not exist/is not available"}
at Function.validate (/Users/gabi/code/playground/dao-fund-framework/node_modules/web3-providers/dist/web3-providers.cjs.js:117:18)
at HttpProvider._callee$ (/Users/gabi/code/playground/dao-fund-framework/node_modules/web3-providers/dist/web3-providers.cjs.js:792:61)
at tryCatch (/Users/gabi/code/playground/dao-fund-framework/node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (/Users/gabi/code/playground/dao-fund-framework/node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (/Users/gabi/code/playground/dao-fund-framework/node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (/Users/gabi/code/playground/dao-fund-framework/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/Users/gabi/c