Skip to content

Instantly share code, notes, and snippets.

View madeinfree's full-sized avatar
🐱
Focusing

Whien_Liou madeinfree

🐱
Focusing
View GitHub Profile
@0age
0age / c000r.sol
Last active June 10, 2024 18:32
0xMonaco car (top-ranked finisher by ELO, Paradigm CTF 2022) https://0xmonaco.ctf.paradigm.xyz/viewTeam/OpenSea
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16; // (10M optimization runs)
interface MonacoInterface {
struct CarData {
uint32 balance; // Where 0 means the car has no money.
uint32 speed; // Where 0 means the car isn't moving.
uint32 y; // Where 0 means the car hasn't moved.
Car car;
}
@z0r0z
z0r0z / ClubSig.sol
Last active March 9, 2022 01:53
Multi-sig with dynamic NFTs, ragequit and minimal extension interface ('governor')
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
import 'https://github.com/kalidao/kali-contracts/blob/main/contracts/tokens/erc721/ERC721initializable.sol';
import 'https://github.com/kalidao/kali-contracts/blob/main/contracts/utils/Multicall.sol';
import 'https://github.com/kalidao/kali-contracts/blob/main/contracts/libraries/Base64.sol';
import 'https://github.com/kalidao/kali-contracts/blob/main/contracts/utils/NFThelper.sol';
/// @notice Minimal ERC-20 interface.
@z0r0z
z0r0z / Multisig.sol
Last active March 9, 2022 01:50
Simple gas-optimized multi-signature contract.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Simple gas-optimized multi-signature contract.
contract Multisig {
event Propose(address indexed proposer, uint256 indexed proposal);
event Sign(address indexed signer, uint256 indexed proposal);
event Execute(uint256 indexed proposal);
error NotSigner();
@patricklodder
patricklodder / 2021-Dogecoin-fee-policy-proposal.md
Created June 27, 2021 20:12
2021 Dogecoin Fee Policy Proposal

DOGECOIN FEE POLICY CHANGE PROPOSAL

This document proposes a new fee structure and policy for Dogecoin Core, to be gradually deployed to the network over multiple software releases.

Historical fee policy

Meaningful fees were introduced for Dogecoin in 2014 to reduce on-chain spam. With a 1 DOGE fee per kilobyte, rounded up, the Dogecoin chain provided

@earthchie
earthchie / getPrice.js
Created May 13, 2021 15:12
Simple API to get a exchange rate from PancakeSwap V2 Router
const express = require('express');
const { ethers } = require('ethers');
const app = express();
const port = 3000;
const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed.binance.org/');
const contract = {
factory: '0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73', // PancakeSwap V2 factory
router: '0x10ED43C718714eb63d5aA57B78B54704E256024E', // PancakeSwap V2 router
@c9s
c9s / .env.local
Last active March 6, 2023 13:37
BBGO 之 MAX 交易所網格設定指南
# API Key 可以在以下頁面建立:
# https://max.maicoin.com/api_tokens/new
#
MAX_API_KEY=
MAX_API_SECRET=
import random
from typing import Tuple
def get_reciprocal(value: int, mod: int) -> int:
for i in range(1, mod):
if (i * value) % mod == 1:
return i
return -1
@argoc
argoc / helloworld.s
Last active January 26, 2023 03:14
Hello World in RISC-V
.data # declare and initialize variables
hello: .asciz "Hello world!" # string with null terminator
.text # code starts here
main: # label marking the entry point of the program
la a0, hello # load the address of hello into $a0 (1st argument)
addi a7, zero, 4 # code to print the string at the address a0
ecall # make the system call
addi a7, zero, 10 # code to exit
@Tynael
Tynael / README.md
Last active October 9, 2024 22:42
How to use npx to run gist based scripts
@bvaughn
bvaughn / index.md
Last active April 3, 2024 07:41
Interaction tracing with React

This API was removed in React 17


Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.