Skip to content

Instantly share code, notes, and snippets.

View Desgard's full-sized avatar
:shipit:
Web3 time!

Gua Desgard

:shipit:
Web3 time!
View GitHub Profile
test_data = """
1 traitType uint8 9
1 traitIds uint8 0
2 traitIds uint8 1
3 traitIds uint8 2
4 traitIds uint8 3
5 traitIds uint8 4
6 traitIds uint8 5
7 traitIds uint8 6
Function: uploadTraits(uint8, uint8[], (string,string)[])
# Name Type Data
1 traitType uint8 9
1 traitIds uint8 0
2 traitIds uint8 1
3 traitIds uint8 2
4 traitIds uint8 3
5 traitIds uint8 4
6 traitIds uint8 5
7 traitIds uint8 6
@Desgard
Desgard / shua_mdx.sol
Last active October 29, 2021 16:24
shua_mdx.sol
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
contract StrategySwapFunction {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public uniRouter = 0xED7d5F38C79115ca12fe6C0041abb22F0A06C300;
pragma solidity ^0.8.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "../Interface/IBpPool.sol";
#!/usr/bin/env bash
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
cur_dir=$(pwd)
# check root
@Desgard
Desgard / cloudSettings
Created September 2, 2019 04:01
vscode_sync
{"lastUpload":"2019-09-02T04:00:52.194Z","extensionVersion":"v3.4.2"}
bundle config --global path ~/.bundle/vendor
bundle config --global bin ~/.bundle/vendor/bin
gem uninstall ies_pod_extension
gem uninstall cocoapods-seer
#!/bin/sh
# mbox 工作目录判断
if [ ! -d "./.mbox" ]; then
echo "不是 .mbox 工作目录,安装失败"
exit -1
fi
# Gemfile.custom 文件判断
if [ ! -d "./Gemfile.custom" ]; then
@Desgard
Desgard / commit-msg.py
Last active January 8, 2018 02:16
Sepicat git logs commit-msg [Githook]
#!/usr/bin/env python3
# 在项目根目录下执行即可:
# wget -O ./.git/hooks/commit-msg https://gist.github.com/Desgard/354c28251dae78d1b886cbe339d88cd1/raw/6d0bedce72371090d3b07e6f8c975b2f787a437f/commit-msg.py
# 权限修改:sudo chmod -x .git/hooks/commit-msg
import sys, os, re
from subprocess import check_output
class bcolors:
@Desgard
Desgard / check_ipad_xib.sh
Last active January 3, 2018 03:12
Check the iPad xib and Storyboard fit
#!/usr/bin/env bash
# 用于检测项目目录下的 xib 和 storyboard 对于 iPad 的兼容性问题
# 命名规范是 iPad 适配的 xib 或 storyboard 文件如果 iPhone 以 home.storyboard 为 file name
# 则 iPad 为 homePad.storyboard 为 file name
# 运行脚本后可以检测对应 homePad.storyboard 的合法性
CHECK_TARGET_FOLDER="./YOUR PROJECT FOLDER"
xmllintPath=`which xmllint`