Skip to content

Instantly share code, notes, and snippets.

View larrythecucumber321's full-sized avatar

Larry the Cucumber larrythecucumber321

View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import { ERC20 } from "solady/src/tokens/ERC20.sol";
import { ERC4626 } from "solady/src/tokens/ERC4626.sol";
import { FactoryOwnable } from "../base/FactoryOwnable.sol";
import { Utils } from "../libraries/Utils.sol";
import { IHoneyErrors } from "./IHoneyErrors.sol";
@larrythecucumber321
larrythecucumber321 / BGT.sol
Last active July 11, 2024 09:39
Proof of Liquidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// chosen to use an initializer instead of a constructor
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
// chosen not to use Solady because EIP-2612 is not needed
import {
ERC20Upgradeable,
IERC20,
IERC20Metadata
[
{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" },
{ "type": "receive", "stateMutability": "payable" },
{
"type": "function",
"name": "UPGRADE_INTERFACE_VERSION",
"inputs": [],
"outputs": [{ "name": "", "type": "string", "internalType": "string" }],
"stateMutability": "view"
},
@larrythecucumber321
larrythecucumber321 / EntropyTest.sol
Last active May 17, 2024 13:52
Pyth Entropy Testing
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@pythnetwork/entropy-sdk-solidity/IEntropy.sol";
import "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol";
contract EntropyNFT is ERC721Enumerable, IEntropyConsumer {
event NumberRequested(uint64 sequenceNumber, address minter);
event Minted(address minter, uint256 tokenId);
@larrythecucumber321
larrythecucumber321 / tradingContract.json
Last active May 31, 2024 23:28
Berp Trading Interface
[
{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" },
{ "type": "receive", "stateMutability": "payable" },
{
"type": "function",
"name": "UPGRADE_INTERFACE_VERSION",
"inputs": [],
"outputs": [{ "name": "", "type": "string", "internalType": "string" }],
"stateMutability": "view"
},
@larrythecucumber321
larrythecucumber321 / jars
Created October 31, 2023 18:49
Pickle Vaults for Zaps
{
jar: 'LOOKS',
depositToken: '0xf4d2888d29D722226FafA5d9B24F9164c092421E',
pickleVaultToken: '0xb4EBc2C371182DeEa04B2264B9ff5AC4F0159C69',
balance: 1928273.507
},
{
jar: 'steCRV',
depositToken: '0x06325440D014e39736583c165C2963BA99fAf14E',
pickleVaultToken: '0x77C8A58D940a322Aea02dBc8EE4A30350D4239AD',
@larrythecucumber321
larrythecucumber321 / getBalances.ts
Created October 11, 2023 21:34
Get balances for hyUSD recollateralization auction
import hre from 'hardhat'
import { bn, fp } from '#/common/numbers'
import { whileImpersonating } from '#/utils/impersonation'
const main = async () => {
const eoa = 'ENTER_WALLET_ADDRESS_HERE'
// '0x465a5a630482f3abD6d3b84B39B29b07214d19e5', fusdc
// '0x3BECE5EC596331033726E5C6C188c313Ff4E3fE5', stkcvxeusd
// '0xaA91d24c2F7DBb6487f61869cD8cd8aFd5c5Cab2', morpho usdt
@larrythecucumber321
larrythecucumber321 / 3.0.0.md
Last active January 8, 2024 08:08
3.0.0 Upgrade Steps

Reserve 3.0.0 Upgrade Instructions

See here for a video Q&A between Nevin Freeman and Patrick Mckelvy explaining the impact & purpose of the 3.0.0 governance proposals

Electronic Dollar - eUSD

Description Target Contract Method Data
@larrythecucumber321
larrythecucumber321 / upgrade-instructions.ts
Created September 8, 2023 04:13
RToken upgrade instructions
import hre, { ethers } from 'hardhat'
import { getDeploymentFile, getDeploymentFilename, IDeployments } from './deployment/common'
import { getChainId } from '../common/blockchain-utils'
async function main() {
const rTokenAddresses = [
'0xA0d69E286B938e21CBf7E51D71F6A4c8918f482F',
'0xE72B141DF173b999AE7c1aDcbF60Cc9833Ce56a8',
'0xaCdf0DBA4B9839b96221a8487e9ca660a48212be',
]
@larrythecucumber321
larrythecucumber321 / 2.1.0-upgrade.md
Created April 12, 2023 19:13
Actions for upgrading eUSD to Reserve Protocol v2.1.0
Description Target contract Method Data
Upgrade Broker 0x90EB22A31b69C29C34162E0E9278cc0617aA2B50 upgradeTo 0x89209a52d085D975b14555F3e828F43fb7EaF3B7
Set Trade Plugin 0x90EB22A31b69C29C34162E0E9278cc0617aA2B50 setTradeImplementation 0xAd4B0B11B041BB1342fEA16fc9c12Ef2a6443439
Upgrade BasketHandler 0x6d309297ddDFeA104A6E89a132e2f05ce3828e07 upgradeTo 0x5c13b3b6f40aD4bF7aa4793F844BA24E85482030
Upgrade RToken 0xA0d69E286B938e21CBf7E51D71F6A4c8918f482F upgradeTo 0x5643D5AC6b79ae8467Cf2F416da6D465d8e7D9C1
Upgrade StRSR 0x18ba6e33ceb80f077DEb9260c9111e62f21aE7B8 upgradeTo 0xfDa8C62d86E426D5fB653B6c44a455Bb657b693f