fluid-contracts-public/deployments/mainnet/Vault_weETH_wstETH_MaxBorrowHandler.json

349 lines
129 KiB
JSON
Raw Normal View History

{
"address": "0x383683D4414Fc27CC9669b7Cc6c7067716814b6a",
"abi": [
{
"inputs": [
{
"internalType": "contract IFluidReserveContract",
"name": "reserveContract_",
"type": "address"
},
{
"internalType": "contract IFluidLiquidity",
"name": "liquidity_",
"type": "address"
},
{
"internalType": "contract IFluidLiquidityResolver",
"name": "liquidityResolver_",
"type": "address"
},
{
"internalType": "address",
"name": "protocol_",
"type": "address"
},
{
"internalType": "address",
"name": "borrowToken_",
"type": "address"
},
{
"internalType": "uint256",
"name": "maxUtilization_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minUpdateDiff_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "errorId_",
"type": "uint256"
}
],
"name": "FluidConfigError",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "errorId_",
"type": "uint256"
}
],
"name": "FluidLiquidityCalcsError",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "totalSupplyNormal",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "oldMaxDebtCeilingRaw",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "maxDebtCeilingRaw",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "borrowExchangePrice",
"type": "uint256"
}
],
"name": "LogUpdateBorrowMaxDebtCeiling",
"type": "event"
},
{
"inputs": [],
"name": "BORROW_TOKEN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LIQUIDITY",
"outputs": [
{
"internalType": "contract IFluidLiquidity",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LIQUIDITY_RESOLVER",
"outputs": [
{
"internalType": "contract IFluidLiquidityResolver",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_UTILIZATION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_UPDATE_DIFF",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PROTOCOL",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RESERVE_CONTRACT",
"outputs": [
{
"internalType": "contract IFluidReserveContract",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_getTotalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "totalSupplyNormal_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "borrowExchangePrice_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "calcMaxDebtCeiling",
"outputs": [
{
"internalType": "uint256",
"name": "maxDebtCeiling_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "calcMaxDebtCeilingNormal",
"outputs": [
{
"internalType": "uint256",
"name": "maxDebtCeilingNormal_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "configPercentDiff",
"outputs": [
{
"internalType": "uint256",
"name": "configPercentDiff_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "currentMaxDebtCeiling",
"outputs": [
{
"internalType": "uint256",
"name": "maxDebtCeiling_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "totalSupplyNormal_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "rebalance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x98e0cba2294bfa468a51f1373b2826ae7c66a3c91603bbb27594bc18a1f01e1d",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A",
"contractAddress": null,
"transactionIndex": 210,
"gasUsed": "945146",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x2c36ff0013759ee158a4ea6681e3ab766186a72ccc2a99be75c71d31a43bba41",
"transactionHash": "0x98e0cba2294bfa468a51f1373b2826ae7c66a3c91603bbb27594bc18a1f01e1d",
"logs": [],
"blockNumber": 19631308,
"cumulativeGasUsed": "17178801",
"status": 1,
"byzantium": true
},
"args": [
"0x264786EF916af64a1DB19F513F24a3681734ce92",
"0x52Aa899454998Be5b000Ad077a46Bbe360F4e497",
"0x741c2Cd25f053a55fd94afF1afAEf146523E1249",
"0x40D9b8417E6E1DcD358f04E3328bCEd061018A82",
"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
8500,
100
],
"numDeployments": 2,
"solcInputHash": "fff19fac118acb472b89fa10e41facd7",
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IFluidReserveContract\",\"name\":\"reserveContract_\",\"type\":\"address\"},{\"internalType\":\"contract IFluidLiquidity\",\"name\":\"liquidity_\",\"type\":\"address\"},{\"internalType\":\"contract IFluidLiquidityResolver\",\"name\":\"liquidityResolver_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"protocol_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"borrowToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxUtilization_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minUpdateDiff_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"errorId_\",\"type\":\"uint256\"}],\"name\":\"FluidConfigError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"errorId_\",\"type\":\"uint256\"}],\"name\":\"FluidLiquidityCalcsError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalSupplyNormal\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMaxDebtCeilingRaw\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maxDebtCeilingRaw\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"borrowExchangePrice\",\"type\":\"uint256\"}],\"name\":\"LogUpdateBorrowMaxDebtCeiling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BORROW_TOKEN\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIQUIDITY\",\"outputs\":[{\"internalType\":\"contract IFluidLiquidity\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIQUIDITY_RESOLVER\",\"outputs\":[{\"internalType\":\"contract IFluidLiquidityResolver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_UTILIZATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_UPDATE_DIFF\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PROTOCOL\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RESERVE_CONTRACT\",\"outputs\":[{\"internalType\":\"contract IFluidReserveContract\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_getTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalSupplyNormal_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrowExchangePrice_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calcMaxDebtCeiling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"maxDebtCeiling_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calcMaxDebtCeilingNormal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"maxDebtCeilingNormal_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"configPercentDiff\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"configPercentDiff_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentMaxDebtCeiling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"maxDebtCeiling_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalSupplyNormal_\",\"type\":\"uint2
"bytecode": "0x6101806040523480156200001257600080fd5b506040516200136538038062001365833981016040819052620000359162000210565b866001600160a01b0381166200006857604051636801712d60e11b8152620186b560048201526024015b60405180910390fd5b866001600160a01b0381166200009757604051636801712d60e11b8152620186b560048201526024016200005f565b866001600160a01b038116620000c657604051636801712d60e11b8152620186b560048201526024016200005f565b866001600160a01b038116620000f557604051636801712d60e11b8152620186b560048201526024016200005f565b866001600160a01b0381166200012457604051636801712d60e11b8152620186b560048201526024016200005f565b6001600160a01b03808d166080528b811660a0528a811660c05289811660e05288166101005261271087118062000159575085155b156200017e57604051636801712d60e11b8152620186b760048201526024016200005f565b5050604080516001600160a01b0398891660208083019190915260098284015282518083038401815260608301845280519082012098909916608082015260a0808201989098528151808203909801885260c001905250508351939094019290922061016052610120526101405250620002a392505050565b6001600160a01b03811681146200020d57600080fd5b50565b600080600080600080600060e0888a0312156200022c57600080fd5b87516200023981620001f7565b60208901519097506200024c81620001f7565b60408901519096506200025f81620001f7565b60608901519095506200027281620001f7565b60808901519094506200028581620001f7565b8093505060a0880151915060c0880151905092959891949750929550565b60805160a05160c05160e0516101005161012051610140516101605161100262000363600039600081816102d001526107750152600081816101a9015261087601526000818160f401526107030152600081816101820152818161050d015281816105ed015261098e01526000818161024d01526109520152600081816101ff01528181610540015261061f01526000818161012e015281816102940152818161079e0152610a560152600081816101d801526103c901526110026000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80636902f79f1161008c57806391b9b8271161006657806391b9b827146102485780639dc105661461026f578063abe3177914610277578063c4e41b221461027f57600080fd5b80636902f79f146101fa5780637d7c2a1c1461022157806382e1350a1461022b57600080fd5b80634c90f25c116100c85780634c90f25c1461017d578063535af56d146101a4578063591e3d44146101cb5780636449b8d7146101d357600080fd5b8063124fea4f146100ef5780632861c7d1146101295780634a46d11614610175575b600080fd5b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101507f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610120565b610116610287565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b6101167f000000000000000000000000000000000000000000000000000000000000000081565b610116610364565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b61022961039b565b005b6102336104d0565b60408051928352602083019190915201610120565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b610116610699565b6101166106bf565b6101166106d3565b600061035f6203ffff60da7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b5c736e47f00000000000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b815260040161030d91815260200190565b602060405180830381865afa15801561032a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034e9190610de1565b901c16600860ff9082901c91161b90565b905090565b60008060006103716106e3565b5050925050915064e8d4a51000818361038a9190610e29565b6103949190610e75565b9250505090565b6040517f467c9eff0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063467c9eff906024016020604051808303816000875af1158015610427573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044b9190610eb0565b61048b576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186b660048201526024015b60405180910390fd5b610493610848565b
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80636902f79f1161008c57806391b9b8271161006657806391b9b827146102485780639dc105661461026f578063abe3177914610277578063c4e41b221461027f57600080fd5b80636902f79f146101fa5780637d7c2a1c1461022157806382e1350a1461022b57600080fd5b80634c90f25c116100c85780634c90f25c1461017d578063535af56d146101a4578063591e3d44146101cb5780636449b8d7146101d357600080fd5b8063124fea4f146100ef5780632861c7d1146101295780634a46d11614610175575b600080fd5b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101507f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610120565b610116610287565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b6101167f000000000000000000000000000000000000000000000000000000000000000081565b610116610364565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b61022961039b565b005b6102336104d0565b60408051928352602083019190915201610120565b6101507f000000000000000000000000000000000000000000000000000000000000000081565b610116610699565b6101166106bf565b6101166106d3565b600061035f6203ffff60da7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b5c736e47f00000000000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b815260040161030d91815260200190565b602060405180830381865afa15801561032a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034e9190610de1565b901c16600860ff9082901c91161b90565b905090565b60008060006103716106e3565b5050925050915064e8d4a51000818361038a9190610e29565b6103949190610e75565b9250505090565b6040517f467c9eff0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063467c9eff906024016020604051808303816000875af1158015610427573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044b9190610eb0565b61048b576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186b660048201526024015b60405180910390fd5b610493610848565b6104ce576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186b86004820152602401610482565b565b6040517f2b00183300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600091829182916105b0917f00000000000000000000000000000000000000000000000000000000000000001690632b00183390602401602060405180830381865afa158015610587573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ab9190610de1565b610b15565b6040517f6e93840600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152919450919250610692917f000000000000000000000000000000000000000000000000000000000000000090911690636e93840690602401602060405180830381865afa158015610668573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068c9190610de1565b82610d23565b9250509091565b60008060006106a66106e3565b509350505091506106b78183610d76565b509392505050565b60006106c96106e3565b5092949350505050565b60006106dd6104d0565b50919050565b60008060008060006106f36104d0565b90945092506000612710610727867f0000000000000000000000000000000000000000000000000000000000000000610e29565b6107319190610e75565b90508361074364e8d4a5100083610e29565b61074d9190610e75565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201529096507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa1580156107fa573d60
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"events": {
"LogUpdateBorrowMaxDebtCeiling(uint256,uint256,uint256,uint256)": {
"notice": "emitted when borrow max limit is updated"
}
},
"kind": "user",
"methods": {
"calcMaxDebtCeiling()": {
"notice": "returns the max debt ceiling that should be set according to current state (in raw for mode with interest!)."
},
"calcMaxDebtCeilingNormal()": {
"notice": "returns the max debt ceiling that should be set according to current state (in normal)."
},
"configPercentDiff()": {
"notice": "returns how much new config would be different from current config in percent (100 = 1%, 1 = 0.01%)."
},
"currentMaxDebtCeiling()": {
"notice": "returns the currently set max debt ceiling (in raw for mode with interest!)."
},
"getTotalSupply()": {
"notice": "returns `BORROW_TOKEN` total supply at Liquidity (in normal)."
},
"rebalance()": {
"notice": "Rebalances the configs for `PROTOCOL` at Fluid Liquidity based on protocol total supply & total borrow. Emits `LogUpdateBorrowMaxDebtCeiling` if update is executed. Reverts if no update is needed. Can only be called by an authorized rebalancer."
}
},
"notice": "Sets max borrow limit for a protocol on Liquidity based on utilization of total supply of the same borrow token",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}