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

455 lines
154 KiB
JSON
Raw Normal View History

{
"address": "0xF561347c306E3Ccf213b73Ce2353D6ed79f92408",
"abi": [
{
"inputs": [
{
"internalType": "contract IFluidReserveContract",
"name": "reserveContract_",
"type": "address"
},
{
"internalType": "contract IFluidVaultT1",
"name": "vault_",
"type": "address"
},
{
"internalType": "contract IFluidLiquidity",
"name": "liquidity_",
"type": "address"
},
{
"internalType": "uint256",
"name": "rewardsAmt_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "duration_",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator_",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "colLiquidated",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "debtLiquidated",
"type": "uint256"
}
],
"name": "FluidLiquidateResult",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "errorId_",
"type": "uint256"
}
],
"name": "FluidVaultError",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "startTime",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
}
],
"name": "LogRewardsStarted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newMagnifier",
"type": "uint256"
}
],
"name": "LogUpdateMagnifier",
"type": "event"
},
{
"inputs": [],
"name": "DURATION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "INITIATOR",
"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": "RESERVE_CONTRACT",
"outputs": [
{
"internalType": "contract IFluidReserveContract",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "REWARDS_AMOUNT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "REWARDS_AMOUNT_PER_YEAR",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VAULT",
"outputs": [
{
"internalType": "contract IFluidVaultT1",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VAULT_COLLATERAL_TOKEN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "calculateMagnifier",
"outputs": [
{
"internalType": "uint256",
"name": "magnifier_",
"type": "uint256"
},
{
"internalType": "bool",
"name": "ended_",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "currentMagnifier",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "endTime",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ended",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getSupplyRate",
"outputs": [
{
"internalType": "uint256",
"name": "supplyRate_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "rebalance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "start",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "startTime",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "vaultTVL",
"outputs": [
{
"internalType": "uint256",
"name": "tvl_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x3e92aec3daeae63d927c92c1b9987eb8d765ef66d3de1ddb6fb00e711153433e",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A",
"contractAddress": null,
"transactionIndex": 138,
"gasUsed": "926489",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xce4378edc5c181a2b31375bddf1c023c3d2abc29ecd0bd2e5a61c2da5bff0760",
"transactionHash": "0x3e92aec3daeae63d927c92c1b9987eb8d765ef66d3de1ddb6fb00e711153433e",
"logs": [],
"blockNumber": 20217834,
"cumulativeGasUsed": "11647403",
"status": 1,
"byzantium": true
},
"args": [
"0x264786EF916af64a1DB19F513F24a3681734ce92",
"0x6F72895Cf6904489Bcd862c941c3D02a3eE4f03e",
"0x52Aa899454998Be5b000Ad077a46Bbe360F4e497",
"80000000",
2592000,
"0x4F6F977aCDD1177DCD81aB83074855EcB9C2D49e",
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
],
"numDeployments": 1,
"solcInputHash": "09ef5f25427412692b8e9ff1980d94df",
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IFluidReserveContract\",\"name\":\"reserveContract_\",\"type\":\"address\"},{\"internalType\":\"contract IFluidVaultT1\",\"name\":\"vault_\",\"type\":\"address\"},{\"internalType\":\"contract IFluidLiquidity\",\"name\":\"liquidity_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rewardsAmt_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initiator_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"collateralToken_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"colLiquidated\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"debtLiquidated\",\"type\":\"uint256\"}],\"name\":\"FluidLiquidateResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"errorId_\",\"type\":\"uint256\"}],\"name\":\"FluidVaultError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"}],\"name\":\"LogRewardsStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMagnifier\",\"type\":\"uint256\"}],\"name\":\"LogUpdateMagnifier\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"INITIATOR\",\"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\":\"RESERVE_CONTRACT\",\"outputs\":[{\"internalType\":\"contract IFluidReserveContract\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARDS_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARDS_AMOUNT_PER_YEAR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAULT\",\"outputs\":[{\"internalType\":\"contract IFluidVaultT1\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAULT_COLLATERAL_TOKEN\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calculateMagnifier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"magnifier_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"ended_\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentMagnifier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ended\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSupplyRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"supplyRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[
"bytecode": "0x6101c06040523480156200001257600080fd5b506040516200138338038062001383833981016040819052620000359162000235565b866001600160a01b03811662000067576040516330090e6560e11b81526184d260048201526024015b60405180910390fd5b856001600160a01b03811662000095576040516330090e6560e11b81526184d260048201526024016200005e565b876001600160a01b038116620000c3576040516330090e6560e11b81526184d260048201526024016200005e565b846001600160a01b038116620000f1576040516330090e6560e11b81526184d260048201526024016200005e565b846001600160a01b0381166200011f576040516330090e6560e11b81526184d260048201526024016200005e565b8815806200012b575087155b156200014f576040516330090e6560e11b81526184d360048201526024016200005e565b6001600160a01b03808d1660a0528b1660c05260e089905287620001786301e133808b620002c9565b620001849190620002ef565b610100526101208890526001600160a01b03808816610140528a8116608052861661016052620001b6600787620001de565b61018052620001c7600587620001de565b6101a05250620003129a5050505050505050505050565b604080516001600160a01b03831660208201529081018390526000906060016040516020818303038152906040528051906020012090505b92915050565b6001600160a01b03811681146200023257600080fd5b50565b600080600080600080600060e0888a0312156200025157600080fd5b87516200025e816200021c565b602089015190975062000271816200021c565b604089015190965062000284816200021c565b80955050606088015193506080880151925060a0880151620002a6816200021c565b60c0890151909250620002b9816200021c565b8091505092959891949750929550565b80820281158282048414176200021657634e487b7160e01b600052601160045260246000fd5b6000826200030d57634e487b7160e01b600052601260045260246000fd5b500490565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051610fa8620003db6000396000610814015260006108e7015260006102e101526000818161032d0152610bb40152600081816101470152610cd70152600081816102ba0152610b210152600061028b01526000818161020e0152818161038c01528181610456015281816107070152818161077a0152610dc701526000818161023d015261059201526000818161017c0152818161085401526109280152610fa86000f3fe608060405234801561001057600080fd5b506004361061011b5760003560e01c80637d7c2a1c116100b257806398bf1caa11610081578063be9a655511610066578063be9a655514610320578063e601fcfb14610328578063f3d915ad1461034f57600080fd5b806398bf1caa146102dc578063a09291b61461030357600080fd5b80637d7c2a1c1461027c578063849689ce1461028657806384bdc9a8146102ad578063973b834d146102b557600080fd5b8063411557d1116100ee578063411557d1146102095780634e637ba9146102305780636449b8d71461023857806378e979251461025f57600080fd5b806312fa6feb146101205780631be05289146101425780632861c7d1146101775780633197cbb6146101c3575b600080fd5b60005461012d9060ff1681565b60405190151581526020015b60405180910390f35b6101697f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610139565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610139565b6000546101ec906d010000000000000000000000000090046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff9091168152602001610139565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b610169610357565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b6000546101ec9061010090046bffffffffffffffffffffffff1681565b610284610564565b005b6101697f000000000000000000000000000000000000000000000000000000000000000081565b6101696107ec565b6101697f000000000000000000000000000000000000000000000000000000000000000081565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b61030b610a66565b60408051928352901515602083015201610139565b610284610b9c565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b610169610d91565b6040517fb5c736e4000000000000000000000000000000000000000000000000000000008152600060048201819052906052907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa1580156103e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040c9190610e4d565b6040517fb5c736e400000000000000
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061011b5760003560e01c80637d7c2a1c116100b257806398bf1caa11610081578063be9a655511610066578063be9a655514610320578063e601fcfb14610328578063f3d915ad1461034f57600080fd5b806398bf1caa146102dc578063a09291b61461030357600080fd5b80637d7c2a1c1461027c578063849689ce1461028657806384bdc9a8146102ad578063973b834d146102b557600080fd5b8063411557d1116100ee578063411557d1146102095780634e637ba9146102305780636449b8d71461023857806378e979251461025f57600080fd5b806312fa6feb146101205780631be05289146101425780632861c7d1146101775780633197cbb6146101c3575b600080fd5b60005461012d9060ff1681565b60405190151581526020015b60405180910390f35b6101697f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610139565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610139565b6000546101ec906d010000000000000000000000000090046bffffffffffffffffffffffff1681565b6040516bffffffffffffffffffffffff9091168152602001610139565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b610169610357565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b6000546101ec9061010090046bffffffffffffffffffffffff1681565b610284610564565b005b6101697f000000000000000000000000000000000000000000000000000000000000000081565b6101696107ec565b6101697f000000000000000000000000000000000000000000000000000000000000000081565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b61030b610a66565b60408051928352901515602083015201610139565b610284610b9c565b61019e7f000000000000000000000000000000000000000000000000000000000000000081565b610169610d91565b6040517fb5c736e4000000000000000000000000000000000000000000000000000000008152600060048201819052906052907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa1580156103e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040c9190610e4d565b6040517fb5c736e400000000000000000000000000000000000000000000000000000000815260016004820152911c600881901c66ffffffffffffff1660ff9091161b91506000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906309f0d8cb90829063b5c736e490602401602060405180830381865afa1580156104ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104de9190610e4d565b6040518263ffffffff1660e01b81526004016104fc91815260200190565b608060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053d9190610e66565b509250505064e8d4a5100081836105549190610ecb565b61055e9190610ee8565b91505090565b6040517f467c9eff0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063467c9eff906024016020604051808303816000875af11580156105f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106149190610f23565b610653576040517f60121cca0000000000000000000000000000000000000000000000000000000081526184d160048201526024015b60405180910390fd5b60008061065e610a66565b91509150801561069457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b61069c610d91565b82036106d8576040517f60121cca0000000000000000000000000000000000000000000000000000000081526184d4600482015260240161064a565b6040517f4a138a71000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690634a138a7190602401600060405180830381600087803b15801561076057600080fd5b505af1158015610774573d6000803e3d6000fd5b505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167ffeb3b5c7ae5acdfc2e3abb4ed84d56c4da29799e1913895763c4c135aceacb4f836040516107e091815260200190565b60405180910390a25050565b6040517fb5c7
"devdoc": {
"kind": "dev",
"methods": {
"calculateMagnifier()": {
"returns": {
"magnifier_": "The calculated magnifier value."
}
},
"constructor": {
"params": {
"collateralToken_": "vault collateral token address",
"duration_": "rewards duration",
"initiator_": "address that can start rewards with `start()`",
"liquidity_": "Fluid liquidity address",
"reserveContract_": "The address of the reserve contract where rebalancers are defined.",
"rewardsAmt_": "Amounts of rewards to distribute",
"vault_": "The vault to which this contract will apply new magnifier parameter."
}
}
},
"title": "VaultRewards",
"version": 1
},
"userdoc": {
"errors": {
"FluidLiquidateResult(uint256,uint256)": [
{
"notice": "used to simulate liquidation to find the maximum liquidatable amounts"
}
]
},
"events": {
"LogRewardsStarted(uint256,uint256)": {
"notice": "Emitted when rewards are started"
},
"LogUpdateMagnifier(address,uint256)": {
"notice": "Emitted when magnifier is updated"
}
},
"kind": "user",
"methods": {
"calculateMagnifier()": {
"notice": "Calculates the new supply rate magnifier based on the current collateral supply (`vaultTVL()`)."
},
"constructor": {
"notice": "Constructs the FluidVaultRewards contract."
},
"currentMagnifier()": {
"notice": "returns the currently configured supply magnifier at the `VAULT`."
},
"rebalance()": {
"notice": "Rebalances the supply rate magnifier based on the current collateral supply. Can only be called by an authorized rebalancer."
},
"vaultTVL()": {
"notice": "returns the current total value locked as collateral (TVL) in the `VAULT`."
}
},
"notice": "This contract is designed to adjust the supply rate magnifier for a vault based on the current collateral supply & supply rate. The adjustment aims to dynamically scale the rewards given to lenders as the TVL in the vault changes. The magnifier is adjusted based on a regular most used reward type where rewardRate = totalRewardsAnnually / totalSupply. Reward rate is applied by adjusting the supply magnifier on vault. Adjustments are made via the rebalance function, which is restricted to be called by designated rebalancers only.",
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 41348,
"contract": "contracts/protocols/vault/rewards/main.sol:FluidVaultRewards",
"label": "ended",
"offset": 0,
"slot": "0",
"type": "t_bool"
},
{
"astId": 41350,
"contract": "contracts/protocols/vault/rewards/main.sol:FluidVaultRewards",
"label": "startTime",
"offset": 1,
"slot": "0",
"type": "t_uint96"
},
{
"astId": 41352,
"contract": "contracts/protocols/vault/rewards/main.sol:FluidVaultRewards",
"label": "endTime",
"offset": 13,
"slot": "0",
"type": "t_uint96"
}
],
"types": {
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_uint96": {
"encoding": "inplace",
"label": "uint96",
"numberOfBytes": "12"
}
}
}
}