Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add preliquidatable class #251

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
294 changes: 294 additions & 0 deletions packages/blue-sdk-viem/src/abis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7949,3 +7949,297 @@ export const erc5267Abi = [
type: "function",
},
] as const;

export const preLiquidationFactoryAbi = [
{
type: "constructor",
inputs: [{ name: "morpho", type: "address", internalType: "address" }],
stateMutability: "nonpayable",
},
{
type: "function",
name: "MORPHO",
inputs: [],
outputs: [{ name: "", type: "address", internalType: "contract IMorpho" }],
stateMutability: "view",
},
{
type: "function",
name: "createPreLiquidation",
inputs: [
{ name: "id", type: "bytes32", internalType: "Id" },
{
name: "preLiquidationParams",
type: "tuple",
internalType: "struct PreLiquidationParams",
components: [
{ name: "preLltv", type: "uint256", internalType: "uint256" },
{ name: "preLCF1", type: "uint256", internalType: "uint256" },
{ name: "preLCF2", type: "uint256", internalType: "uint256" },
{ name: "preLIF1", type: "uint256", internalType: "uint256" },
{ name: "preLIF2", type: "uint256", internalType: "uint256" },
{
name: "preLiquidationOracle",
type: "address",
internalType: "address",
},
],
},
],
outputs: [
{
name: "",
type: "address",
internalType: "contract IPreLiquidation",
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "isPreLiquidation",
inputs: [{ name: "", type: "address", internalType: "address" }],
outputs: [{ name: "", type: "bool", internalType: "bool" }],
stateMutability: "view",
},
{
type: "event",
name: "CreatePreLiquidation",
inputs: [
{
name: "preLiquidation",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "id",
type: "bytes32",
indexed: false,
internalType: "Id",
},
{
name: "preLiquidationParams",
type: "tuple",
indexed: false,
internalType: "struct PreLiquidationParams",
components: [
{ name: "preLltv", type: "uint256", internalType: "uint256" },
{ name: "preLCF1", type: "uint256", internalType: "uint256" },
{ name: "preLCF2", type: "uint256", internalType: "uint256" },
{ name: "preLIF1", type: "uint256", internalType: "uint256" },
{ name: "preLIF2", type: "uint256", internalType: "uint256" },
{
name: "preLiquidationOracle",
type: "address",
internalType: "address",
},
],
},
],
anonymous: false,
},
{ type: "error", name: "ZeroAddress", inputs: [] },
] as const;

export const preLiquidationAbi = [
{
type: "constructor",
inputs: [
{ name: "morpho", type: "address", internalType: "address" },
{ name: "id", type: "bytes32", internalType: "Id" },
{
name: "_preLiquidationParams",
type: "tuple",
internalType: "struct PreLiquidationParams",
components: [
{ name: "preLltv", type: "uint256", internalType: "uint256" },
{ name: "preLCF1", type: "uint256", internalType: "uint256" },
{ name: "preLCF2", type: "uint256", internalType: "uint256" },
{ name: "preLIF1", type: "uint256", internalType: "uint256" },
{ name: "preLIF2", type: "uint256", internalType: "uint256" },
{
name: "preLiquidationOracle",
type: "address",
internalType: "address",
},
],
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "ID",
inputs: [],
outputs: [{ name: "", type: "bytes32", internalType: "Id" }],
stateMutability: "view",
},
{
type: "function",
name: "MORPHO",
inputs: [],
outputs: [{ name: "", type: "address", internalType: "contract IMorpho" }],
stateMutability: "view",
},
{
type: "function",
name: "marketParams",
inputs: [],
outputs: [
{
name: "",
type: "tuple",
internalType: "struct MarketParams",
components: [
{
name: "loanToken",
type: "address",
internalType: "address",
},
{
name: "collateralToken",
type: "address",
internalType: "address",
},
{ name: "oracle", type: "address", internalType: "address" },
{ name: "irm", type: "address", internalType: "address" },
{ name: "lltv", type: "uint256", internalType: "uint256" },
],
},
],
stateMutability: "view",
},
{
type: "function",
name: "onMorphoRepay",
inputs: [
{
name: "repaidAssets",
type: "uint256",
internalType: "uint256",
},
{ name: "callbackData", type: "bytes", internalType: "bytes" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "preLiquidate",
inputs: [
{ name: "borrower", type: "address", internalType: "address" },
{
name: "seizedAssets",
type: "uint256",
internalType: "uint256",
},
{
name: "repaidShares",
type: "uint256",
internalType: "uint256",
},
{ name: "data", type: "bytes", internalType: "bytes" },
],
outputs: [
{ name: "", type: "uint256", internalType: "uint256" },
{ name: "", type: "uint256", internalType: "uint256" },
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "preLiquidationParams",
inputs: [],
outputs: [
{
name: "",
type: "tuple",
internalType: "struct PreLiquidationParams",
components: [
{ name: "preLltv", type: "uint256", internalType: "uint256" },
{ name: "preLCF1", type: "uint256", internalType: "uint256" },
{ name: "preLCF2", type: "uint256", internalType: "uint256" },
{ name: "preLIF1", type: "uint256", internalType: "uint256" },
{ name: "preLIF2", type: "uint256", internalType: "uint256" },
{
name: "preLiquidationOracle",
type: "address",
internalType: "address",
},
],
},
],
stateMutability: "view",
},
{
type: "event",
name: "PreLiquidate",
inputs: [
{
name: "id",
type: "bytes32",
indexed: true,
internalType: "Id",
},
{
name: "liquidator",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "borrower",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "repaidAssets",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "repaidShares",
type: "uint256",
indexed: false,
internalType: "uint256",
},
{
name: "seizedAssets",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{ type: "error", name: "InconsistentInput", inputs: [] },
{ type: "error", name: "LiquidatablePosition", inputs: [] },
{ type: "error", name: "NonexistentMarket", inputs: [] },
{ type: "error", name: "NotMorpho", inputs: [] },
{ type: "error", name: "NotPreLiquidatablePosition", inputs: [] },
{ type: "error", name: "PreLCFDecreasing", inputs: [] },
{ type: "error", name: "PreLCFTooHigh", inputs: [] },
{ type: "error", name: "PreLIFDecreasing", inputs: [] },
{ type: "error", name: "PreLIFTooHigh", inputs: [] },
{ type: "error", name: "PreLIFTooLow", inputs: [] },
{
type: "error",
name: "PreLiquidationTooLarge",
inputs: [
{
name: "repaidShares",
type: "uint256",
internalType: "uint256",
},
{
name: "repayableShares",
type: "uint256",
internalType: "uint256",
},
],
},
{ type: "error", name: "PreLltvTooHigh", inputs: [] },
] as const;
Loading