Skip to content

Instantly share code, notes, and snippets.

View zed-wong's full-sized avatar
👨‍🍳
Cooking

Zed Wong zed-wong

👨‍🍳
Cooking
View GitHub Profile
@zed-wong
zed-wong / aragon_ens_debug.md
Created May 11, 2023 12:19
Aragon ens debug

Error:

POST https://geth.mvm.dev/

{"method":"eth_call","params":[{"to":"0x8a38cb623199a4647754dab8ff751001b081e2b0","data":"0x0178b8bf970f805f2000a67797a92296777b123ab29e0e9bcfd5eb206d96ee84fea3b1bf"},"latest"],"id":45,"jsonrpc":"2.0"}

{"jsonrpc":"2.0","id":45,"result":"0x0000000000000000000000000000000000000000000000000000000000000000"}

The address is ENSRegistry, so it's an ENS error. I don't know what happens after the deployment of a DAO, so I checked DAOFactory.

@zed-wong
zed-wong / gh-pages-deploy.md
Created April 29, 2023 01:12 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@zed-wong
zed-wong / nginx-https-graph-node.conf
Created April 27, 2023 06:17
Nginx conf for setting up https for graph node
server {
listen 80;
server_name graph.mvg.finance;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name graph.mvg.finance;
@zed-wong
zed-wong / ma-monitor.py
Created April 25, 2023 08:07
BTC ma monitor & notifier through Mixin Messenger
import sys
import json
import math
import time
import uuid
import base64
import hashlib
import asyncio
import requests
import datetime
@zed-wong
zed-wong / aragon-mvm-deployment.md
Created April 19, 2023 03:07
Aragon MVM Deployment
$ npx hardhat run scripts/deploy.ts --network mvm
No need to generate any newer typings.
Deploying...
Ens registry deployed at 0x157682fa262E96BFC62a0541466B9Db21ABba94D
Ens resolver deployed for subdomain dao at 0x65997E3FF2649bA9A407d9863B250C3903641dfF
Ens resolver deployed for subdomain plugin at 0x50BD1516c6E7b377003Bf334F34Be371520d4011
Warning: Potentially unsafe deployment of @aragon/osx/core/dao/DAO.sol:DAO

    You are using the `unsafeAllow.constructor` flag.
@zed-wong
zed-wong / UpdateMixinOneLine.sh
Created April 12, 2023 02:27
Update Mixin Messenger with one line (Ubuntu)
alias updateMixin="proxychains curl -L -o mixin_desktop.deb $(curl -s https://api.github.com/repos/MixinNetwork/flutter-app/releases/latest | grep "browser_download_url.*mixin_desktop_linux_amd64.deb" | cut -d : -f 2,3 | tr -d \") && sudo dpkg -i mixin_desktop.deb && rm mixin_desktop.deb"
@zed-wong
zed-wong / utils.ts
Last active December 11, 2022 13:32
Ts utils functions
// $1.23
export const formatUSMoney = (x: string | number) => {
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(Number(x))
}
// $123.23M
export const formatCompactUSD = (x: number) => {
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', maximumSignificantDigits: 2, notation: "compact" , compactDisplay: "short" }).format(x)
}
@zed-wong
zed-wong / disable-ubuntu-sensor.md
Created November 22, 2022 08:49
Disable surface ubuntu sensor (disable screen rotation and touchscreen)
@zed-wong
zed-wong / CurveContract.vy
Created October 22, 2022 01:21
curve-contract
# @version 0.2.4
# (c) Curve.Fi, 2020
# Pool for DAI/USDC/USDT
from vyper.interfaces import ERC20
interface CurveToken:
def totalSupply() -> uint256: view
def mint(_to: address, _value: uint256) -> bool: nonpayable
def burnFrom(_to: address, _value: uint256) -> bool: nonpayable
@zed-wong
zed-wong / CurveCryptoSwap.vy
Created October 8, 2022 09:24
CurveCryptoSwap.vy
# @version 0.3.1
# (c) Curve.Fi, 2021
# Pool for USDT/BTC/ETH or similar
interface ERC20: # Custom ERC20 which works for USDT, WETH and WBTC
def transfer(_to: address, _amount: uint256): nonpayable
def transferFrom(_from: address, _to: address, _amount: uint256): nonpayable
def balanceOf(_user: address) -> uint256: view
interface CurveToken: