Skip to content

Instantly share code, notes, and snippets.

@0xdef1
0xdef1 / WFRIEND.sol
Last active May 7, 2024 16:23
wFRIEND POC
pragma solidity >=0.8.20;
import {IPoints} from "./IPoints.sol";
import {IRabbitRouter} from "./IRabbitRouter.sol";
import {IBunnySwap} from "./IBunnySwap.sol";
import {ERC20} from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
contract WFRIEND is ERC20 {
address points;
address router;
@0xdef1
0xdef1 / astro-lockdrop.js
Last active December 17, 2021 21:31
ASTRO Lockdrop Stats
import { LCDClient } from '@terra-money/terra.js';
const terra = new LCDClient({
URL: 'https://lcd.terra.dev',
chainID: 'columbus-5',
});
const pools = [
{
name: 'bLUNA-LUNA',
This file has been truncated, but you can view the full file.
[
{
"address": "0xf7801B8115f3Fe46AC55f8c0Fdb5243726bdb66A",
"apes": [
0,
30
],
"punks": []
},
{
@0xdef1
0xdef1 / localterra_terraswap.txt
Created May 7, 2021 03:11
Steps to deploy Terraswap into LocalTerra and create a functional pair
# Clone the terraswap repo (optionally build the binaries yourself)
git clone https://github.com/terraswap/terraswap.git
cd terraswap/artifacts
# Upload terraswap_token contract and note the code_id
terracli tx wasm store terraswap_token.wasm --from test1 --chain-id=localterra --gas=auto --fees=100000uluna --broadcast-mode=block
> code_id: 2
# Upload terraswap_pair contract and note the code_id
terracli tx wasm store terraswap_pair.wasm --from test1 --chain-id=localterra --gas=auto --fees=100000uluna --broadcast-mode=block
@0xdef1
0xdef1 / fei_reweight_monitor.js
Created April 4, 2021 19:13
FEI Re-weight Monitor
let Web3 = require('web3');
let web3 = new Web3(new Web3.providers.WebsocketProvider('wss://mainnet.infura.io/ws/v3/YOUR_API_KEY'));
let abi = '[{"inputs":[{"internalType":"address","name":"_core","type":"address"},{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_pair","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"uint32","name":"_growthRate","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_core","type":"address"}],"name":"CoreUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"bool","name":"_isExempt","type":"bool"}],"name":"ExemptAddressUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_growthRate","type":"uint256"}],"name":"GrowthRateUpdate","type":"e