This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"type": "constructor", | |
"inputs": [ | |
{ "name": "_owner", "type": "address", "internalType": "address" }, | |
{ "name": "_vault", "type": "address", "internalType": "address" }, | |
{ | |
"name": "payoutAddress", | |
"type": "address", | |
"internalType": "address" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"type": "constructor", | |
"inputs": [ | |
{ "name": "_teller", "type": "address", "internalType": "address" }, | |
{ "name": "_owner", "type": "address", "internalType": "address" } | |
], | |
"stateMutability": "nonpayable" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" }, | |
{ | |
"type": "function", | |
"name": "DEFAULT_ADMIN_ROLE", | |
"inputs": [], | |
"outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], | |
"stateMutability": "view" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" }, | |
{ | |
"type": "function", | |
"name": "debt", | |
"inputs": [ | |
{ | |
"name": "pool", | |
"type": "address", | |
"internalType": "contract IIonPool" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "contract IonPool", | |
"name": "_ionPool", | |
"type": "address" | |
}, | |
{ |
NewerOlder