Skip to content

Instantly share code, notes, and snippets.

@PaulRBerg
Created August 6, 2021 12:47
Show Gist options
  • Save PaulRBerg/ac962c7aac4560b46d6df13c642b22c0 to your computer and use it in GitHub Desktop.
Save PaulRBerg/ac962c7aac4560b46d6df13c642b22c0 to your computer and use it in GitHub Desktop.
ABI for HifiProxyTarget (with the `depositCollateralAndBorrowHTokenAndAddLiquidity` function)
[
{
"inputs": [
{
"internalType": "address",
"name": "target",
"type": "address"
}
],
"name": "CallToNonContract",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "expectedHTokenRequired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "actualHTokenRequired",
"type": "uint256"
}
],
"name": "HifiProxyTarget__AddLiquiditySlippageTooHigh",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "expectedAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "actualAmount",
"type": "uint256"
}
],
"name": "HifiProxyTarget__TradeSlippageTooHigh",
"type": "error"
},
{
"inputs": [],
"name": "NoReturnData",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "borrower",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "underlyingAmount",
"type": "uint256"
}
],
"name": "BorrowHTokenAndBuyUnderlying",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "borrower",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "underlyingAmount",
"type": "uint256"
}
],
"name": "BorrowHTokenAndSellHToken",
"type": "event"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "underlyingOffered",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxHTokenRequired",
"type": "uint256"
}
],
"name": "addLiquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IHToken",
"name": "hToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
}
],
"name": "borrowHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "maxBorrowAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "underlyingOffered",
"type": "uint256"
}
],
"name": "borrowHTokenAndAddLiquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "maxBorrowAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "underlyingOut",
"type": "uint256"
}
],
"name": "borrowHTokenAndBuyUnderlying",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minUnderlyingOut",
"type": "uint256"
}
],
"name": "borrowHTokenAndSellHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "hTokenOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxUnderlyingIn",
"type": "uint256"
}
],
"name": "buyHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "maxUnderlyingIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "underlyingOffered",
"type": "uint256"
}
],
"name": "buyHTokenAndAddLiquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "uint256",
"name": "maxUnderlyingIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "hTokenOut",
"type": "uint256"
}
],
"name": "buyHTokenAndRepayBorrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "underlyingOut",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxHTokenIn",
"type": "uint256"
}
],
"name": "buyUnderlying",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "maxHTokenAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "underlyingOffered",
"type": "uint256"
}
],
"name": "buyUnderlyingAndAddLiquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IErc20",
"name": "collateral",
"type": "address"
},
{
"internalType": "uint256",
"name": "depositAmount",
"type": "uint256"
}
],
"name": "depositCollateral",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IErc20",
"name": "collateral",
"type": "address"
},
{
"internalType": "contract IHToken",
"name": "hToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "depositAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
}
],
"name": "depositCollateralAndBorrowHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IErc20",
"name": "collateral",
"type": "address"
},
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "depositAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxBorrowAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "underlyingOffered",
"type": "uint256"
}
],
"name": "depositCollateralAndBorrowHTokenAndAddLiquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IErc20",
"name": "collateral",
"type": "address"
},
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "depositAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minUnderlyingOut",
"type": "uint256"
}
],
"name": "depositCollateralAndBorrowHTokenAndSellHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHToken",
"name": "hToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "hTokenAmount",
"type": "uint256"
}
],
"name": "redeemHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "poolTokensBurned",
"type": "uint256"
}
],
"name": "removeLiquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "poolTokensBurned",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minUnderlyingOut",
"type": "uint256"
}
],
"name": "removeLiquidityAndSellHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "uint256",
"name": "poolTokensBurned",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minHTokenOut",
"type": "uint256"
}
],
"name": "removeLiquidityAndSellUnderlyingAndRepayBorrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IHToken",
"name": "hToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "repayAmount",
"type": "uint256"
}
],
"name": "repayBorrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "hTokenIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minUnderlyingOut",
"type": "uint256"
}
],
"name": "sellHToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "underlyingIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minHTokenOut",
"type": "uint256"
}
],
"name": "sellUnderlying",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "uint256",
"name": "underlyingIn",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minHTokenOut",
"type": "uint256"
}
],
"name": "sellUnderlyingAndRepayBorrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHToken",
"name": "hToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "underlyingAmount",
"type": "uint256"
}
],
"name": "supplyUnderlying",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IHToken",
"name": "hToken",
"type": "address"
},
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "uint256",
"name": "underlyingAmount",
"type": "uint256"
}
],
"name": "supplyUnderlyingAndRepayBorrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IErc20",
"name": "collateral",
"type": "address"
},
{
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
}
],
"name": "withdrawCollateral",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract WethInterface",
"name": "weth",
"type": "address"
},
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
},
{
"internalType": "contract IHifiPool",
"name": "hifiPool",
"type": "address"
},
{
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minUnderlyingOut",
"type": "uint256"
}
],
"name": "wrapEthAndDepositAndBorrowHTokenAndSellHToken",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract WethInterface",
"name": "weth",
"type": "address"
},
{
"internalType": "contract IBalanceSheetV1",
"name": "balanceSheet",
"type": "address"
}
],
"name": "wrapEthAndDepositCollateral",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment