mirror of
https://github.com/Instadapp/fluid-contracts-public.git
synced 2024-07-29 21:57:37 +00:00
269 lines
30 KiB
JSON
269 lines
30 KiB
JSON
|
{
|
||
|
"address": "0x2005617238a8E1C153D19A33fd32fB168f3626e7",
|
||
|
"abi": [
|
||
|
{
|
||
|
"inputs": [
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "duration_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "startTvl_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "rewardAmount_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "address",
|
||
|
"name": "initiator_",
|
||
|
"type": "address"
|
||
|
}
|
||
|
],
|
||
|
"stateMutability": "nonpayable",
|
||
|
"type": "constructor"
|
||
|
},
|
||
|
{
|
||
|
"inputs": [
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "errorId_",
|
||
|
"type": "uint256"
|
||
|
}
|
||
|
],
|
||
|
"name": "FluidLendingError",
|
||
|
"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"
|
||
|
},
|
||
|
{
|
||
|
"inputs": [],
|
||
|
"name": "getConfig",
|
||
|
"outputs": [
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "duration_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "startTime_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "endTime_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "startTvl_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "maxRate_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "rewardAmount_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "address",
|
||
|
"name": "initiator_",
|
||
|
"type": "address"
|
||
|
}
|
||
|
],
|
||
|
"stateMutability": "view",
|
||
|
"type": "function"
|
||
|
},
|
||
|
{
|
||
|
"inputs": [
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "totalAssets_",
|
||
|
"type": "uint256"
|
||
|
}
|
||
|
],
|
||
|
"name": "getRate",
|
||
|
"outputs": [
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "rate_",
|
||
|
"type": "uint256"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "bool",
|
||
|
"name": "ended_",
|
||
|
"type": "bool"
|
||
|
},
|
||
|
{
|
||
|
"internalType": "uint256",
|
||
|
"name": "startTime_",
|
||
|
"type": "uint256"
|
||
|
}
|
||
|
],
|
||
|
"stateMutability": "view",
|
||
|
"type": "function"
|
||
|
},
|
||
|
{
|
||
|
"inputs": [],
|
||
|
"name": "start",
|
||
|
"outputs": [],
|
||
|
"stateMutability": "nonpayable",
|
||
|
"type": "function"
|
||
|
}
|
||
|
],
|
||
|
"transactionHash": "0xa5d32b11f900a1ac84e7834f06d95c959ef9f0bd19742f59792350771273b997",
|
||
|
"receipt": {
|
||
|
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
|
||
|
"from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A",
|
||
|
"contractAddress": null,
|
||
|
"transactionIndex": 40,
|
||
|
"gasUsed": "369069",
|
||
|
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||
|
"blockHash": "0x110df052701f31b89160b1a50177cffb7d0dc3384ddf709c0435f835da8e49ad",
|
||
|
"transactionHash": "0xa5d32b11f900a1ac84e7834f06d95c959ef9f0bd19742f59792350771273b997",
|
||
|
"logs": [],
|
||
|
"blockNumber": 19851874,
|
||
|
"cumulativeGasUsed": "3504364",
|
||
|
"status": 1,
|
||
|
"byzantium": true
|
||
|
},
|
||
|
"args": [
|
||
|
3490560,
|
||
|
"1000000000",
|
||
|
"222200000000",
|
||
|
"0x0Ed35B1609Ec45c7079E80d11149a52717e4859A"
|
||
|
],
|
||
|
"numDeployments": 1,
|
||
|
"solcInputHash": "98f8e49e6b0ff74dde4176f150c6c4e8",
|
||
|
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"duration_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTvl_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardAmount_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initiator_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"errorId_\",\"type\":\"uint256\"}],\"name\":\"FluidLendingError\",\"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\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"duration_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTime_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTvl_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxRate_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardAmount_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initiator_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"totalAssets_\",\"type\":\"uint256\"}],\"name\":\"getRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rate_\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"ended_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"startTime_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"start\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"duration_\":\"for how long rewards should run\",\"initiator_\":\"address which has access to kickstart the rewards\",\"rewardAmount_\":\"total amount of underlying asset to be distributed as rewards\",\"startTvl_\":\"tvl below which rate is 0\"}},\"getRate(uint256)\":{\"params\":{\"totalAssets_\":\"amount of assets in the lending\"},\"returns\":{\"ended_\":\"flag to signal that rewards have ended (always 0 going forward)\",\"rate_\":\"rewards rate percentage per year with 1e12 RATE_PRECISION, e.g. 1e12 = 1%, 1e14 = 100%\",\"startTime_\":\"start time of rewards to compare against last update timestamp\"}}},\"stateVariables\":{\"DURATION\":{\"details\":\"for how long rewards should run\"},\"INITIATOR\":{\"details\":\"address which has access to call start() which kickstarts the rewards\"},\"MAX_RATE\":{\"details\":\"maximum rewards rate is 50%. no config higher than this should be possible.\"},\"RATE_PRECISION\":{\"details\":\"precision decimals for rewards rate\"},\"REWARD_AMOUNT\":{\"details\":\"total amounts to be distributed. not needed but stored for easier tracking via `getConfig`\"},\"START_TVL\":{\"details\":\"tvl below which rewards rate is 0\"},\"YEARLY_REWARD\":{\"details\":\"annualized reward based on constructor input params (duration, rewardAmount)\"},\"endTime\":{\"details\":\"when rewards will get over\"},\"startTime\":{\"details\":\"when rewards got started\"}},\"title\":\"LendingRewardsRateModel\",\"version\":1},\"userdoc\":{\"events\":{\"LogRewardsStarted(uint256,uint256)\":{\"notice\":\"Emitted when rewards are started\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"sets immutable vars for rewards rate config based on input params.\"},\"getConfig()\":{\"notice\":\"Returns config constants for rewards rate model\"},\"getRate(uint256)\":{\"notice\":\"Calculates the current rewards rate (APR)\"}},\"notice\":\"Calculates rewards rate used for an fToken based on a rewardAmount over a given duration. Rewards start once t
|
||
|
"bytecode": "0x61012060405234801561001157600080fd5b50604051610773380380610773833981016040819052610030916100db565b806001600160a01b0381166100615760405163694bda1d60e01b81526159dd60048201526024015b60405180910390fd5b84158061006c575082155b80610075575083155b156100975760405163694bda1d60e01b81526159d96004820152602401610058565b608084905260a085905260e08390526001600160a01b03821661010052846100c36301e133808561012a565b6100cd9190610155565b60c052506101779350505050565b600080600080608085870312156100f157600080fd5b845160208601516040870151606088015192965090945092506001600160a01b038116811461011f57600080fd5b939692955090935050565b808202811582820484141761014f57634e487b7160e01b600052601160045260246000fd5b92915050565b60008261017257634e487b7160e01b600052601260045260246000fd5b500490565b60805160a05160c05160e051610100516105a36101d0600039600081816101f60152610495015260006104720152600061016c01526000818161031101526103dd015260008181610133015261042101526105a36000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80635776409414610046578063be9a655514610079578063c3f909d414610083575b600080fd5b6100596100543660046104ba565b6100d6565b604080519384529115156020840152908201526060015b60405180910390f35b6100816101de565b005b61008b6103cb565b604080519788526020880196909652948601939093526060850191909152608084015260a083015273ffffffffffffffffffffffffffffffffffffffff1660c082015260e001610070565b6000805481906bffffffffffffffffffffffff808216916c01000000000000000000000000900416811580610109575080155b1561011b5760008093509350506101d7565b80421115610131576000600193509350506101d7565b7f00000000000000000000000000000000000000000000000000000000000000008510156101665760008093509350506101d7565b846101977f0000000000000000000000000000000000000000000000000000000000000000655af3107a4000610502565b6101a1919061051f565b93506101b364e8d4a510006032610502565b84116101bf57836101cf565b6101cf64e8d4a510006032610502565b600093509350505b9193909250565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610256576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159db60048201526024015b60405180910390fd5b6000546bffffffffffffffffffffffff1615158061029357506000546c0100000000000000000000000090046bffffffffffffffffffffffff1615155b156102ce576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159dc600482015260240161024d565b600080547fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016426bffffffffffffffffffffffff811691909117909155610336907f00000000000000000000000000000000000000000000000000000000000000009061055a565b600080546bffffffffffffffffffffffff9283166c010000000000000000000000009081027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff831681179384905560408051918616938616939093178152920490921660208201527fc46a00a5f8de6e404178aaf0795f118716058fca1012ad21f1e0253a05188c44910160405180910390a1565b600080548190819081908190819081907f0000000000000000000000000000000000000000000000000000000000000000906bffffffffffffffffffffffff808216916c010000000000000000000000009004167f000000000000000000000000000000000000000000000000000000000000000061045064e8d4a510006032610502565b939b6bffffffffffffffffffffffff9384169b509190921698509096509094507f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000602082840312156104cc57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610519576105196104d3565b92915050565b600082610555577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820180821115610519576105196104d356fea2646970667358221220958e66ab697460b9a3e2ad3e13d6490382bfe5f44440228ddc8638e26d633b0564736f6c63430008150033",
|
||
|
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80635776409414610046578063be9a655514610079578063c3f909d414610083575b600080fd5b6100596100543660046104ba565b6100d6565b604080519384529115156020840152908201526060015b60405180910390f35b6100816101de565b005b61008b6103cb565b604080519788526020880196909652948601939093526060850191909152608084015260a083015273ffffffffffffffffffffffffffffffffffffffff1660c082015260e001610070565b6000805481906bffffffffffffffffffffffff808216916c01000000000000000000000000900416811580610109575080155b1561011b5760008093509350506101d7565b80421115610131576000600193509350506101d7565b7f00000000000000000000000000000000000000000000000000000000000000008510156101665760008093509350506101d7565b846101977f0000000000000000000000000000000000000000000000000000000000000000655af3107a4000610502565b6101a1919061051f565b93506101b364e8d4a510006032610502565b84116101bf57836101cf565b6101cf64e8d4a510006032610502565b600093509350505b9193909250565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610256576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159db60048201526024015b60405180910390fd5b6000546bffffffffffffffffffffffff1615158061029357506000546c0100000000000000000000000090046bffffffffffffffffffffffff1615155b156102ce576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159dc600482015260240161024d565b600080547fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016426bffffffffffffffffffffffff811691909117909155610336907f00000000000000000000000000000000000000000000000000000000000000009061055a565b600080546bffffffffffffffffffffffff9283166c010000000000000000000000009081027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff831681179384905560408051918616938616939093178152920490921660208201527fc46a00a5f8de6e404178aaf0795f118716058fca1012ad21f1e0253a05188c44910160405180910390a1565b600080548190819081908190819081907f0000000000000000000000000000000000000000000000000000000000000000906bffffffffffffffffffffffff808216916c010000000000000000000000009004167f000000000000000000000000000000000000000000000000000000000000000061045064e8d4a510006032610502565b939b6bffffffffffffffffffffffff9384169b509190921698509096509094507f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000602082840312156104cc57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610519576105196104d3565b92915050565b600082610555577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820180821115610519576105196104d356fea2646970667358221220958e66ab697460b9a3e2ad3e13d6490382bfe5f44440228ddc8638e26d633b0564736f6c63430008150033",
|
||
|
"devdoc": {
|
||
|
"kind": "dev",
|
||
|
"methods": {
|
||
|
"constructor": {
|
||
|
"params": {
|
||
|
"duration_": "for how long rewards should run",
|
||
|
"initiator_": "address which has access to kickstart the rewards",
|
||
|
"rewardAmount_": "total amount of underlying asset to be distributed as rewards",
|
||
|
"startTvl_": "tvl below which rate is 0"
|
||
|
}
|
||
|
},
|
||
|
"getRate(uint256)": {
|
||
|
"params": {
|
||
|
"totalAssets_": "amount of assets in the lending"
|
||
|
},
|
||
|
"returns": {
|
||
|
"ended_": "flag to signal that rewards have ended (always 0 going forward)",
|
||
|
"rate_": "rewards rate percentage per year with 1e12 RATE_PRECISION, e.g. 1e12 = 1%, 1e14 = 100%",
|
||
|
"startTime_": "start time of rewards to compare against last update timestamp"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"stateVariables": {
|
||
|
"DURATION": {
|
||
|
"details": "for how long rewards should run"
|
||
|
},
|
||
|
"INITIATOR": {
|
||
|
"details": "address which has access to call start() which kickstarts the rewards"
|
||
|
},
|
||
|
"MAX_RATE": {
|
||
|
"details": "maximum rewards rate is 50%. no config higher than this should be possible."
|
||
|
},
|
||
|
"RATE_PRECISION": {
|
||
|
"details": "precision decimals for rewards rate"
|
||
|
},
|
||
|
"REWARD_AMOUNT": {
|
||
|
"details": "total amounts to be distributed. not needed but stored for easier tracking via `getConfig`"
|
||
|
},
|
||
|
"START_TVL": {
|
||
|
"details": "tvl below which rewards rate is 0"
|
||
|
},
|
||
|
"YEARLY_REWARD": {
|
||
|
"details": "annualized reward based on constructor input params (duration, rewardAmount)"
|
||
|
},
|
||
|
"endTime": {
|
||
|
"details": "when rewards will get over"
|
||
|
},
|
||
|
"startTime": {
|
||
|
"details": "when rewards got started"
|
||
|
}
|
||
|
},
|
||
|
"title": "LendingRewardsRateModel",
|
||
|
"version": 1
|
||
|
},
|
||
|
"userdoc": {
|
||
|
"events": {
|
||
|
"LogRewardsStarted(uint256,uint256)": {
|
||
|
"notice": "Emitted when rewards are started"
|
||
|
}
|
||
|
},
|
||
|
"kind": "user",
|
||
|
"methods": {
|
||
|
"constructor": {
|
||
|
"notice": "sets immutable vars for rewards rate config based on input params."
|
||
|
},
|
||
|
"getConfig()": {
|
||
|
"notice": "Returns config constants for rewards rate model"
|
||
|
},
|
||
|
"getRate(uint256)": {
|
||
|
"notice": "Calculates the current rewards rate (APR)"
|
||
|
}
|
||
|
},
|
||
|
"notice": "Calculates rewards rate used for an fToken based on a rewardAmount over a given duration. Rewards start once the allowed initiator address triggers `start()` and only accrue above a certain startTVL. Max rate cap is at 50%.",
|
||
|
"version": 1
|
||
|
},
|
||
|
"storageLayout": {
|
||
|
"storage": [
|
||
|
{
|
||
|
"astId": 43168,
|
||
|
"contract": "contracts/protocols/lending/lendingRewardsRateModel/main.sol:FluidLendingRewardsRateModel",
|
||
|
"label": "startTime",
|
||
|
"offset": 0,
|
||
|
"slot": "0",
|
||
|
"type": "t_uint96"
|
||
|
},
|
||
|
{
|
||
|
"astId": 43171,
|
||
|
"contract": "contracts/protocols/lending/lendingRewardsRateModel/main.sol:FluidLendingRewardsRateModel",
|
||
|
"label": "endTime",
|
||
|
"offset": 12,
|
||
|
"slot": "0",
|
||
|
"type": "t_uint96"
|
||
|
}
|
||
|
],
|
||
|
"types": {
|
||
|
"t_uint96": {
|
||
|
"encoding": "inplace",
|
||
|
"label": "uint96",
|
||
|
"numberOfBytes": "12"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|