Skip to content

Instantly share code, notes, and snippets.

@junkim012
junkim012 / HyperliquidForwarder.sol
Created May 30, 2025 05:03
HyperliquidForwarder.sol
pragma solidity 0.8.21;
import { ERC20 } from "@solmate/tokens/ERC20.sol";
import { SafeTransferLib } from "@solmate/utils/SafeTransferLib.sol";
import { Auth, Authority } from "@solmate/auth/Auth.sol";
/**
* @title Hyperliquid Forwarder
* @custom:security-contact security@molecularlabs.io
*/
@junkim012
junkim012 / LHYPE.json
Created February 18, 2025 17:18
LHYPE.json
[
{
"type": "constructor",
"inputs": [
{ "name": "_owner", "type": "address", "internalType": "address" },
{ "name": "_name", "type": "string", "internalType": "string" },
{ "name": "_symbol", "type": "string", "internalType": "string" },
{ "name": "_decimals", "type": "uint8", "internalType": "uint8" }
],
"stateMutability": "nonpayable"
@junkim012
junkim012 / AccountantWithRateProviders.json
Created February 18, 2025 16:37
AccountantWithRateProviders.json
[
{
"type": "constructor",
"inputs": [
{ "name": "_owner", "type": "address", "internalType": "address" },
{ "name": "_vault", "type": "address", "internalType": "address" },
{
"name": "payoutAddress",
"type": "address",
"internalType": "address"
@junkim012
junkim012 / LoopedHypeDepositor.json
Created February 18, 2025 16:32
LoopedHypeDepositor.json
[
{
"type": "constructor",
"inputs": [
{ "name": "_teller", "type": "address", "internalType": "address" },
{ "name": "_owner", "type": "address", "internalType": "address" }
],
"stateMutability": "nonpayable"
},
{
@junkim012
junkim012 / depositAndBridge.ts
Last active December 20, 2024 03:17
Mint earnETH Swell L2
// getRateInQuote
export async function getRateInQuote(
{ quote }: { quote: `0x${string}` },
{ contractAddress }: { contractAddress: `0x${string}` }
): Promise<bigint> {
const rate = await readContract(wagmiConfig, {
abi: AccountantWithRateProviders.abi as Abi,
address: contractAddress,
functionName: 'getRateInQuote',
args: [quote],
@junkim012
junkim012 / IonPool.json
Created May 16, 2024 19:19
IonPool ABI
[
{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" },
{
"type": "function",
"name": "DEFAULT_ADMIN_ROLE",
"inputs": [],
"outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }],
"stateMutability": "view"
},
{
@junkim012
junkim012 / IonLens.json
Created May 16, 2024 17:07
IonLens.json
[
{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" },
{
"type": "function",
"name": "debt",
"inputs": [
{
"name": "pool",
"type": "address",
"internalType": "contract IIonPool"
@junkim012
junkim012 / IntegrationPoC.t.sol
Created March 5, 2024 16:22
VaultCraft <> Ion Fork Test
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import {IonPool} from "./../../../src/IonPool.sol";
import {Whitelist} from "./../../../src/Whitelist.sol";
import {Test} from "forge-std/Test.sol";
IonPool constant ION_POOL = IonPool(0x0000000000eaEbd95dAfcA37A39fd09745739b78);
contract IntegrationPoC is Test {
const wstEthCurrentBorrowRate = await client.readContract({
abi: IonPool.abi,
address: IonPoolAddr as `0x${string}`,
functionName: 'getCurrentBorrowRate',
args: [0],
})
// 1. What does the original readContract return?
// It returns [1000000000073542918165030747n, 0n]
{
"abi": [
{
"inputs": [
{
"internalType": "contract IonPool",
"name": "_ionPool",
"type": "address"
},
{