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": "0xfB20Ff156Abe35aABaf6c2E9F798413aC90176fA",
|
||
|
"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": "0x3119a874c0691c6e0f9db5060247cd8c3dcf02f2211867058341df7c0185305d",
|
||
|
"receipt": {
|
||
|
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
|
||
|
"from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A",
|
||
|
"contractAddress": null,
|
||
|
"transactionIndex": 98,
|
||
|
"gasUsed": "373607",
|
||
|
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||
|
"blockHash": "0x14ed6daa99efb629460dbca4582d0672d948c4721f915dc7876187268124888e",
|
||
|
"transactionHash": "0x3119a874c0691c6e0f9db5060247cd8c3dcf02f2211867058341df7c0185305d",
|
||
|
"logs": [],
|
||
|
"blockNumber": 19245681,
|
||
|
"cumulativeGasUsed": "15244520",
|
||
|
"status": 1,
|
||
|
"byzantium": true
|
||
|
},
|
||
|
"args": [
|
||
|
7776000,
|
||
|
"1000000000",
|
||
|
"250000000000",
|
||
|
"0x4F6F977aCDD1177DCD81aB83074855EcB9C2D49e"
|
||
|
],
|
||
|
"numDeployments": 1,
|
||
|
"solcInputHash": "1f22fdbe9105b3785c386ffdea0d074f",
|
||
|
"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": "0x61012060405234801561001157600080fd5b50604051610788380380610788833981016040819052610030916100db565b806001600160a01b0381166100615760405163694bda1d60e01b81526159dd60048201526024015b60405180910390fd5b84158061006c575082155b80610075575083155b156100975760405163694bda1d60e01b81526159d96004820152602401610058565b608084905260a085905260e08390526001600160a01b03821661010052846100c36301e133808561012a565b6100cd9190610155565b60c052506101779350505050565b600080600080608085870312156100f157600080fd5b845160208601516040870151606088015192965090945092506001600160a01b038116811461011f57600080fd5b939692955090935050565b808202811582820484141761014f57634e487b7160e01b600052601160045260246000fd5b92915050565b60008261017257634e487b7160e01b600052601260045260246000fd5b500490565b60805160a05160c05160e051610100516105b86101d06000396000818161020b01526104aa015260006104870152600061018101526000818161032601526103f2015260008181610148015261043601526105b86000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80635776409414610046578063be9a655514610079578063c3f909d414610083575b600080fd5b6100596100543660046104cf565b6100d6565b604080519384529115156020840152908201526060015b60405180910390f35b6100816101f3565b005b61008b6103e0565b604080519788526020880196909652948601939093526060850191909152608084015260a083015273ffffffffffffffffffffffffffffffffffffffff1660c082015260e001610070565b6000805481906bffffffffffffffffffffffff808216916c01000000000000000000000000900416811580610109575080155b1561011b5760008093509350506101ec565b80421115610131576000600193509350506101ec565b814210156101465760008093509350506101ec565b7f000000000000000000000000000000000000000000000000000000000000000085101561017b5760008093509350506101ec565b846101ac7f0000000000000000000000000000000000000000000000000000000000000000655af3107a4000610517565b6101b69190610534565b93506101c864e8d4a510006032610517565b84116101d457836101e4565b6101e464e8d4a510006032610517565b600093509350505b9193909250565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461026b576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159db60048201526024015b60405180910390fd5b6000546bffffffffffffffffffffffff161515806102a857506000546c0100000000000000000000000090046bffffffffffffffffffffffff1615155b156102e3576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159dc6004820152602401610262565b600080547fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016426bffffffffffffffffffffffff81169190911790915561034b907f00000000000000000000000000000000000000000000000000000000000000009061056f565b600080546bffffffffffffffffffffffff9283166c010000000000000000000000009081027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff831681179384905560408051918616938616939093178152920490921660208201527fc46a00a5f8de6e404178aaf0795f118716058fca1012ad21f1e0253a05188c44910160405180910390a1565b600080548190819081908190819081907f0000000000000000000000000000000000000000000000000000000000000000906bffffffffffffffffffffffff808216916c010000000000000000000000009004167f000000000000000000000000000000000000000000000000000000000000000061046564e8d4a510006032610517565b939b6bffffffffffffffffffffffff9384169b509190921698509096509094507f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000602082840312156104e157600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761052e5761052e6104e8565b92915050565b60008261056a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561052e5761052e6104e856fea26469706673582212202d6d5350d42d4fc1f61c11b232845617ba3c8547239deba56784101ac3c1afef64736f6c63430008150033",
|
||
|
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80635776409414610046578063be9a655514610079578063c3f909d414610083575b600080fd5b6100596100543660046104cf565b6100d6565b604080519384529115156020840152908201526060015b60405180910390f35b6100816101f3565b005b61008b6103e0565b604080519788526020880196909652948601939093526060850191909152608084015260a083015273ffffffffffffffffffffffffffffffffffffffff1660c082015260e001610070565b6000805481906bffffffffffffffffffffffff808216916c01000000000000000000000000900416811580610109575080155b1561011b5760008093509350506101ec565b80421115610131576000600193509350506101ec565b814210156101465760008093509350506101ec565b7f000000000000000000000000000000000000000000000000000000000000000085101561017b5760008093509350506101ec565b846101ac7f0000000000000000000000000000000000000000000000000000000000000000655af3107a4000610517565b6101b69190610534565b93506101c864e8d4a510006032610517565b84116101d457836101e4565b6101e464e8d4a510006032610517565b600093509350505b9193909250565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461026b576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159db60048201526024015b60405180910390fd5b6000546bffffffffffffffffffffffff161515806102a857506000546c0100000000000000000000000090046bffffffffffffffffffffffff1615155b156102e3576040517f694bda1d0000000000000000000000000000000000000000000000000000000081526159dc6004820152602401610262565b600080547fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016426bffffffffffffffffffffffff81169190911790915561034b907f00000000000000000000000000000000000000000000000000000000000000009061056f565b600080546bffffffffffffffffffffffff9283166c010000000000000000000000009081027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff831681179384905560408051918616938616939093178152920490921660208201527fc46a00a5f8de6e404178aaf0795f118716058fca1012ad21f1e0253a05188c44910160405180910390a1565b600080548190819081908190819081907f0000000000000000000000000000000000000000000000000000000000000000906bffffffffffffffffffffffff808216916c010000000000000000000000009004167f000000000000000000000000000000000000000000000000000000000000000061046564e8d4a510006032610517565b939b6bffffffffffffffffffffffff9384169b509190921698509096509094507f000000000000000000000000000000000000000000000000000000000000000093507f000000000000000000000000000000000000000000000000000000000000000092509050565b6000602082840312156104e157600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761052e5761052e6104e8565b92915050565b60008261056a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561052e5761052e6104e856fea26469706673582212202d6d5350d42d4fc1f61c11b232845617ba3c8547239deba56784101ac3c1afef64736f6c63430008150033",
|
||
|
"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": 20010,
|
||
|
"contract": "contracts/protocols/lending/lendingRewardsRateModel/main.sol:FluidLendingRewardsRateModel",
|
||
|
"label": "startTime",
|
||
|
"offset": 0,
|
||
|
"slot": "0",
|
||
|
"type": "t_uint96"
|
||
|
},
|
||
|
{
|
||
|
"astId": 20013,
|
||
|
"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"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|