@venusprotocol/venus-protocol 9.8.0-dev.17 → 9.8.0-dev.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy/016-rate-model-checkpoint.ts +6 -6
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope1000bps_jump20000bps_kink7500bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope1000bps_jump50000bps_kink8000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope1500bps_jump30000bps_kink6000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope2000bps_jump30000bps_kink5000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope300bps_jump45000bps_kink9000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope750bps_jump5000bps_kink8000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope900bps_jump20000bps_kink5000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope900bps_jump20000bps_kink7500bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base0bps_slope900bps_jump35000bps_kink4500bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base200bps_slope10000bps_jump30000bps_kink100bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base200bps_slope1200bps_jump30000bps_kink6000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base200bps_slope1500bps_jump30000bps_kink6000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base200bps_slope2000bps_jump30000bps_kink5000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_JumpRateModel_base5000bps_slope3000bps_jump30000bps_kink6000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_TwoKinks_base0bps_slope450bps_kink7000bps_slope214000bps_base20bps_kink28000bps_jump30000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_WhitePaperInterestRateModel_base0bps_slope0bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/CheckpointView_From_WhitePaperInterestRateModel_base0bps_slope24000bps_bpy21024000_To_bpy42048000_At_1751250600.json +153 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope1000bps_jump20000bps_kink7500bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope1000bps_jump50000bps_kink8000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope1500bps_jump30000bps_kink6000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope2000bps_jump30000bps_kink5000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope300bps_jump45000bps_kink9000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope750bps_jump5000bps_kink8000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope900bps_jump20000bps_kink5000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope900bps_jump20000bps_kink7500bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base0bps_slope900bps_jump35000bps_kink4500bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base200bps_slope10000bps_jump30000bps_kink100bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base200bps_slope1200bps_jump30000bps_kink6000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base200bps_slope1500bps_jump30000bps_kink6000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base200bps_slope2000bps_jump30000bps_kink5000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/JumpRateModel_base5000bps_slope3000bps_jump30000bps_kink6000bps_bpy42048000.json +394 -0
- package/deployments/bscmainnet/SetCheckpointBscmainnet.json +13 -13
- package/deployments/bscmainnet/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_bpy42048000.json +443 -0
- package/deployments/bscmainnet/TwoKinks_base0bps_slope450bps_kink7000bps_slope214000bps_base20bps_kink28000bps_jump30000bps_bpy42048000.json +443 -0
- package/deployments/bscmainnet/WhitePaperInterestRateModel_base0bps_slope0bps_bpy42048000.json +325 -0
- package/deployments/bscmainnet/WhitePaperInterestRateModel_base0bps_slope24000bps_bpy42048000.json +325 -0
- package/deployments/bscmainnet/solcInputs/562ab186f59f60709f089c3eb137d5e4.json +34 -0
- package/deployments/bscmainnet/solcInputs/9ff62a1d4992e88b10501b0dc555f416.json +340 -0
- package/deployments/bscmainnet/solcInputs/c5572179a30630626defa699e42df19f.json +34 -0
- package/deployments/bscmainnet.json +9662 -3169
- package/deployments/bscmainnet_addresses.json +39 -1
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope1000bps_jump10900bps_kink8000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope1000bps_jump20000bps_kink7500bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope2000bps_jump30000bps_kink5000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope500bps_jump5000bps_kink8000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope750bps_jump5000bps_kink8000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope900bps_jump20000bps_kink5000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base0bps_slope900bps_jump35000bps_kink4500bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base200bps_slope1500bps_jump30000bps_kink6000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_JumpRateModel_base200bps_slope2000bps_jump30000bps_kink5000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_TwoKinks_base0bps_slope350bps_kink8000bps_slope217500bps_base20bps_kink29000bps_jump30000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_WhitePaperInterestRateModel_base0bps_slope10000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/CheckpointView_From_WhitePaperInterestRateModel_base200bps_slope1000bps_bpy21024000_To_bpy42048000_At_1748243100.json +153 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope1000bps_jump10900bps_kink8000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope1000bps_jump20000bps_kink7500bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope2000bps_jump30000bps_kink5000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope500bps_jump5000bps_kink8000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope750bps_jump5000bps_kink8000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope900bps_jump20000bps_kink5000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base0bps_slope900bps_jump35000bps_kink4500bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base200bps_slope1500bps_jump30000bps_kink6000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/JumpRateModel_base200bps_slope2000bps_jump30000bps_kink5000bps_bpy42048000.json +394 -0
- package/deployments/bsctestnet/SetCheckpointBsctestnet.json +12 -12
- package/deployments/bsctestnet/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_bpy42048000.json +443 -0
- package/deployments/bsctestnet/TwoKinks_base0bps_slope350bps_kink8000bps_slope217500bps_base20bps_kink29000bps_jump30000bps_bpy42048000.json +443 -0
- package/deployments/bsctestnet/WhitePaperInterestRateModel_base0bps_slope10000bps_bpy42048000.json +325 -0
- package/deployments/bsctestnet/WhitePaperInterestRateModel_base200bps_slope1000bps_bpy42048000.json +325 -0
- package/deployments/bsctestnet/solcInputs/2ed6cb8f8bf831211e3bb044371ae657.json +34 -0
- package/deployments/bsctestnet/solcInputs/8251c7f4c76847afe95bbea4bdd1127f.json +34 -0
- package/deployments/bsctestnet/solcInputs/9ff62a1d4992e88b10501b0dc555f416.json +340 -0
- package/deployments/bsctestnet/solcInputs/dee41539f978b3def31e02aaee92eb7b.json +34 -0
- package/deployments/bsctestnet.json +6780 -2002
- package/deployments/bsctestnet_addresses.json +29 -1
- package/dist/deploy/016-rate-model-checkpoint.js +6 -6
- package/dist/deployments/bscmainnet.json +9662 -3169
- package/dist/deployments/bsctestnet.json +6780 -2002
- package/dist/helpers/chains.d.ts +2 -2
- package/dist/helpers/chains.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "0x170bE58D5C1983f03DC287AB9aBffC7DA16f862b",
|
|
3
|
+
"abi": [
|
|
4
|
+
{
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "address",
|
|
8
|
+
"name": "dataSource1",
|
|
9
|
+
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "address",
|
|
13
|
+
"name": "dataSource2",
|
|
14
|
+
"type": "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "uint256",
|
|
18
|
+
"name": "checkpointTimestamp",
|
|
19
|
+
"type": "uint256"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"stateMutability": "nonpayable",
|
|
23
|
+
"type": "constructor"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"inputs": [],
|
|
27
|
+
"name": "ZeroAddressNotAllowed",
|
|
28
|
+
"type": "error"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"stateMutability": "nonpayable",
|
|
32
|
+
"type": "fallback"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"inputs": [],
|
|
36
|
+
"name": "CHECKPOINT_TIMESTAMP",
|
|
37
|
+
"outputs": [
|
|
38
|
+
{
|
|
39
|
+
"internalType": "uint256",
|
|
40
|
+
"name": "",
|
|
41
|
+
"type": "uint256"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"stateMutability": "view",
|
|
45
|
+
"type": "function"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [],
|
|
49
|
+
"name": "DATA_SOURCE_1",
|
|
50
|
+
"outputs": [
|
|
51
|
+
{
|
|
52
|
+
"internalType": "address",
|
|
53
|
+
"name": "",
|
|
54
|
+
"type": "address"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"stateMutability": "view",
|
|
58
|
+
"type": "function"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"inputs": [],
|
|
62
|
+
"name": "DATA_SOURCE_2",
|
|
63
|
+
"outputs": [
|
|
64
|
+
{
|
|
65
|
+
"internalType": "address",
|
|
66
|
+
"name": "",
|
|
67
|
+
"type": "address"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"stateMutability": "view",
|
|
71
|
+
"type": "function"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"inputs": [],
|
|
75
|
+
"name": "currentDataSource",
|
|
76
|
+
"outputs": [
|
|
77
|
+
{
|
|
78
|
+
"internalType": "address",
|
|
79
|
+
"name": "",
|
|
80
|
+
"type": "address"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"stateMutability": "view",
|
|
84
|
+
"type": "function"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"transactionHash": "0x752624a9bff2eefd2873df0a82db2188d1e7d7307391b61e86b1c2efc35e9751",
|
|
88
|
+
"receipt": {
|
|
89
|
+
"to": null,
|
|
90
|
+
"from": "0x55A9f5374Af30E3045FB491f1da3C2E8a74d168D",
|
|
91
|
+
"contractAddress": "0x170bE58D5C1983f03DC287AB9aBffC7DA16f862b",
|
|
92
|
+
"transactionIndex": 247,
|
|
93
|
+
"gasUsed": "275951",
|
|
94
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
95
|
+
"blockHash": "0x40fa11f4c6e8f411d3f65883232ea502a4884c25b8497f1adb55606915c3d35f",
|
|
96
|
+
"transactionHash": "0x752624a9bff2eefd2873df0a82db2188d1e7d7307391b61e86b1c2efc35e9751",
|
|
97
|
+
"logs": [],
|
|
98
|
+
"blockNumber": 51200720,
|
|
99
|
+
"cumulativeGasUsed": "48810217",
|
|
100
|
+
"status": 1,
|
|
101
|
+
"byzantium": true
|
|
102
|
+
},
|
|
103
|
+
"args": ["0x2d0A2955C3321743ea3B63109Ce2d7E388Bb35DB", "0x92cdF922902440Fdcdd1c987F984Bf86eEd10397", 1751250600],
|
|
104
|
+
"numDeployments": 1,
|
|
105
|
+
"solcInputHash": "9ff62a1d4992e88b10501b0dc555f416",
|
|
106
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dataSource1\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dataSource2\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"checkpointTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"stateMutability\":\"nonpayable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"CHECKPOINT_TIMESTAMP\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DATA_SOURCE_1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DATA_SOURCE_2\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentDataSource\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"checkpointTimestamp\":\"Checkpoint timestamp\",\"dataSource1\":\"Data source to use before the checkpoint\",\"dataSource2\":\"Data source to use after the checkpoint\"}},\"currentDataSource()\":{\"returns\":{\"_0\":\"Data source contract in use\"}}},\"title\":\"Venus CheckpointView Contract\",\"version\":1},\"userdoc\":{\"errors\":{\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}]},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructor\"},\"currentDataSource()\":{\"notice\":\"Returns the current data source contract (either the old one or the new one)\"}},\"notice\":\"A contract that calls a view function from two different contracts based on whether a checkpoint in time has passed. Using this contract, we can change dependencies at a certain timestamp, which is useful for scheduled changes in, e.g., interest rate models.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Utils/CheckpointView.sol\":\"CheckpointView\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Utils/CheckpointView.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\n/**\\n * @title Venus CheckpointView Contract\\n * @notice A contract that calls a view function from two different contracts\\n * based on whether a checkpoint in time has passed. Using this contract, we\\n * can change dependencies at a certain timestamp, which is useful for\\n * scheduled changes in, e.g., interest rate models.\\n * @author Venus\\n */\\ncontract CheckpointView {\\n using Address for address;\\n\\n address public immutable DATA_SOURCE_1;\\n address public immutable DATA_SOURCE_2;\\n uint256 public immutable CHECKPOINT_TIMESTAMP;\\n\\n /**\\n * @notice Constructor\\n * @param dataSource1 Data source to use before the checkpoint\\n * @param dataSource2 Data source to use after the checkpoint\\n * @param checkpointTimestamp Checkpoint timestamp\\n */\\n constructor(address dataSource1, address dataSource2, uint256 checkpointTimestamp) {\\n ensureNonzeroAddress(address(dataSource1));\\n ensureNonzeroAddress(address(dataSource2));\\n DATA_SOURCE_1 = dataSource1;\\n DATA_SOURCE_2 = dataSource2;\\n CHECKPOINT_TIMESTAMP = checkpointTimestamp;\\n }\\n\\n /**\\n * @notice Fallback function that proxies the view calls to the current data source\\n * @param input Input data (with a function selector) for the call\\n * @return The data returned by the called function on the current data source\\n */\\n fallback(bytes calldata input) external returns (bytes memory) {\\n return _getCurrentDataSource().functionStaticCall(input);\\n }\\n\\n /**\\n * @notice Returns the current data source contract (either the old one or the new one)\\n * @return Data source contract in use\\n */\\n function currentDataSource() external view returns (address) {\\n return _getCurrentDataSource();\\n }\\n\\n /**\\n * @dev Returns the current data source contract (either the old one or the new one)\\n * @return Data source contract in use\\n */\\n function _getCurrentDataSource() internal view returns (address) {\\n return (block.timestamp < CHECKPOINT_TIMESTAMP) ? DATA_SOURCE_1 : DATA_SOURCE_2;\\n }\\n}\\n\",\"keccak256\":\"0xee00197e76d3a1923787ae0f86b44998382bf8f493aa51e3dbf8ff0ebc5da849\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
|
|
107
|
+
"bytecode": "0x60e060405234801561001057600080fd5b5060405161051838038061051883398101604081905261002f916100a2565b6100388361005c565b6100418261005c565b6001600160a01b03928316608052911660a05260c0526100de565b6001600160a01b038116610083576040516342bcdf7f60e11b815260040160405180910390fd5b50565b80516001600160a01b038116811461009d57600080fd5b919050565b6000806000606084860312156100b757600080fd5b6100c084610086565b92506100ce60208501610086565b9150604084015190509250925092565b60805160a05160c0516103f86101206000396000818160f8015261015b01526000818161012d015261018301526000818160b401526101a701526103f86000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063539ef45a146100af5780636eec7c78146100f3578063b169ca2c14610128578063b1e3f3ca1461014f575b60003660606100a383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506100949250610157915050565b6001600160a01b0316906101cc565b80519350602001915050f35b6100d67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61011a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100ea565b6100d67f000000000000000000000000000000000000000000000000000000000000000081565b6100d66101f8565b60007f000000000000000000000000000000000000000000000000000000000000000042106101a557507f000000000000000000000000000000000000000000000000000000000000000090565b7f00000000000000000000000000000000000000000000000000000000000000005b905090565b60606101f1838360405180606001604052806025815260200161039e60259139610202565b9392505050565b60006101c7610157565b6060600080856001600160a01b03168560405161021f919061034e565b600060405180830381855afa9150503d806000811461025a576040519150601f19603f3d011682016040523d82523d6000602084013e61025f565b606091505b50915091506102708683838761027a565b9695505050505050565b606083156102ee5782516000036102e7576001600160a01b0385163b6102e75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816102f8565b6102f88383610300565b949350505050565b8151156103105781518083602001fd5b8060405162461bcd60e51b81526004016102de919061036a565b60005b8381101561034557818101518382015260200161032d565b50506000910152565b6000825161036081846020870161032a565b9190910192915050565b602081526000825180602084015261038981604085016020870161032a565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a2646970667358221220eca66ee30baa1f137c05183519a166a921ad59eea1d7c5756184f9d6a48edffc64736f6c63430008190033",
|
|
108
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063539ef45a146100af5780636eec7c78146100f3578063b169ca2c14610128578063b1e3f3ca1461014f575b60003660606100a383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506100949250610157915050565b6001600160a01b0316906101cc565b80519350602001915050f35b6100d67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61011a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100ea565b6100d67f000000000000000000000000000000000000000000000000000000000000000081565b6100d66101f8565b60007f000000000000000000000000000000000000000000000000000000000000000042106101a557507f000000000000000000000000000000000000000000000000000000000000000090565b7f00000000000000000000000000000000000000000000000000000000000000005b905090565b60606101f1838360405180606001604052806025815260200161039e60259139610202565b9392505050565b60006101c7610157565b6060600080856001600160a01b03168560405161021f919061034e565b600060405180830381855afa9150503d806000811461025a576040519150601f19603f3d011682016040523d82523d6000602084013e61025f565b606091505b50915091506102708683838761027a565b9695505050505050565b606083156102ee5782516000036102e7576001600160a01b0385163b6102e75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816102f8565b6102f88383610300565b949350505050565b8151156103105781518083602001fd5b8060405162461bcd60e51b81526004016102de919061036a565b60005b8381101561034557818101518382015260200161032d565b50506000910152565b6000825161036081846020870161032a565b9190910192915050565b602081526000825180602084015261038981604085016020870161032a565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a2646970667358221220eca66ee30baa1f137c05183519a166a921ad59eea1d7c5756184f9d6a48edffc64736f6c63430008190033",
|
|
109
|
+
"devdoc": {
|
|
110
|
+
"author": "Venus",
|
|
111
|
+
"kind": "dev",
|
|
112
|
+
"methods": {
|
|
113
|
+
"constructor": {
|
|
114
|
+
"params": {
|
|
115
|
+
"checkpointTimestamp": "Checkpoint timestamp",
|
|
116
|
+
"dataSource1": "Data source to use before the checkpoint",
|
|
117
|
+
"dataSource2": "Data source to use after the checkpoint"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"currentDataSource()": {
|
|
121
|
+
"returns": {
|
|
122
|
+
"_0": "Data source contract in use"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"title": "Venus CheckpointView Contract",
|
|
127
|
+
"version": 1
|
|
128
|
+
},
|
|
129
|
+
"userdoc": {
|
|
130
|
+
"errors": {
|
|
131
|
+
"ZeroAddressNotAllowed()": [
|
|
132
|
+
{
|
|
133
|
+
"notice": "Thrown if the supplied address is a zero address where it is not allowed"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"kind": "user",
|
|
138
|
+
"methods": {
|
|
139
|
+
"constructor": {
|
|
140
|
+
"notice": "Constructor"
|
|
141
|
+
},
|
|
142
|
+
"currentDataSource()": {
|
|
143
|
+
"notice": "Returns the current data source contract (either the old one or the new one)"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"notice": "A contract that calls a view function from two different contracts based on whether a checkpoint in time has passed. Using this contract, we can change dependencies at a certain timestamp, which is useful for scheduled changes in, e.g., interest rate models.",
|
|
147
|
+
"version": 1
|
|
148
|
+
},
|
|
149
|
+
"storageLayout": {
|
|
150
|
+
"storage": [],
|
|
151
|
+
"types": null
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "0xcc542643521D5e4dE63f48682e7f577f805e7651",
|
|
3
|
+
"abi": [
|
|
4
|
+
{
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "uint256",
|
|
8
|
+
"name": "baseRatePerYear",
|
|
9
|
+
"type": "uint256"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "uint256",
|
|
13
|
+
"name": "multiplierPerYear",
|
|
14
|
+
"type": "uint256"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "uint256",
|
|
18
|
+
"name": "jumpMultiplierPerYear",
|
|
19
|
+
"type": "uint256"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"internalType": "uint256",
|
|
23
|
+
"name": "kink_",
|
|
24
|
+
"type": "uint256"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"internalType": "uint256",
|
|
28
|
+
"name": "blocksPerYear_",
|
|
29
|
+
"type": "uint256"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"payable": false,
|
|
33
|
+
"stateMutability": "nonpayable",
|
|
34
|
+
"type": "constructor"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"anonymous": false,
|
|
38
|
+
"inputs": [
|
|
39
|
+
{
|
|
40
|
+
"indexed": false,
|
|
41
|
+
"internalType": "uint256",
|
|
42
|
+
"name": "baseRatePerBlock",
|
|
43
|
+
"type": "uint256"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"indexed": false,
|
|
47
|
+
"internalType": "uint256",
|
|
48
|
+
"name": "multiplierPerBlock",
|
|
49
|
+
"type": "uint256"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"indexed": false,
|
|
53
|
+
"internalType": "uint256",
|
|
54
|
+
"name": "jumpMultiplierPerBlock",
|
|
55
|
+
"type": "uint256"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"indexed": false,
|
|
59
|
+
"internalType": "uint256",
|
|
60
|
+
"name": "kink",
|
|
61
|
+
"type": "uint256"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"name": "NewInterestParams",
|
|
65
|
+
"type": "event"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"constant": true,
|
|
69
|
+
"inputs": [],
|
|
70
|
+
"name": "baseRatePerBlock",
|
|
71
|
+
"outputs": [
|
|
72
|
+
{
|
|
73
|
+
"internalType": "uint256",
|
|
74
|
+
"name": "",
|
|
75
|
+
"type": "uint256"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"payable": false,
|
|
79
|
+
"stateMutability": "view",
|
|
80
|
+
"type": "function"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"constant": true,
|
|
84
|
+
"inputs": [],
|
|
85
|
+
"name": "blocksPerYear",
|
|
86
|
+
"outputs": [
|
|
87
|
+
{
|
|
88
|
+
"internalType": "uint256",
|
|
89
|
+
"name": "",
|
|
90
|
+
"type": "uint256"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"payable": false,
|
|
94
|
+
"stateMutability": "view",
|
|
95
|
+
"type": "function"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"constant": true,
|
|
99
|
+
"inputs": [
|
|
100
|
+
{
|
|
101
|
+
"internalType": "uint256",
|
|
102
|
+
"name": "cash",
|
|
103
|
+
"type": "uint256"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"internalType": "uint256",
|
|
107
|
+
"name": "borrows",
|
|
108
|
+
"type": "uint256"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"internalType": "uint256",
|
|
112
|
+
"name": "reserves",
|
|
113
|
+
"type": "uint256"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"name": "getBorrowRate",
|
|
117
|
+
"outputs": [
|
|
118
|
+
{
|
|
119
|
+
"internalType": "uint256",
|
|
120
|
+
"name": "",
|
|
121
|
+
"type": "uint256"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"payable": false,
|
|
125
|
+
"stateMutability": "view",
|
|
126
|
+
"type": "function"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"constant": true,
|
|
130
|
+
"inputs": [
|
|
131
|
+
{
|
|
132
|
+
"internalType": "uint256",
|
|
133
|
+
"name": "cash",
|
|
134
|
+
"type": "uint256"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"internalType": "uint256",
|
|
138
|
+
"name": "borrows",
|
|
139
|
+
"type": "uint256"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"internalType": "uint256",
|
|
143
|
+
"name": "reserves",
|
|
144
|
+
"type": "uint256"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"internalType": "uint256",
|
|
148
|
+
"name": "reserveFactorMantissa",
|
|
149
|
+
"type": "uint256"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"name": "getSupplyRate",
|
|
153
|
+
"outputs": [
|
|
154
|
+
{
|
|
155
|
+
"internalType": "uint256",
|
|
156
|
+
"name": "",
|
|
157
|
+
"type": "uint256"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"payable": false,
|
|
161
|
+
"stateMutability": "view",
|
|
162
|
+
"type": "function"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"constant": true,
|
|
166
|
+
"inputs": [],
|
|
167
|
+
"name": "isInterestRateModel",
|
|
168
|
+
"outputs": [
|
|
169
|
+
{
|
|
170
|
+
"internalType": "bool",
|
|
171
|
+
"name": "",
|
|
172
|
+
"type": "bool"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"payable": false,
|
|
176
|
+
"stateMutability": "view",
|
|
177
|
+
"type": "function"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"constant": true,
|
|
181
|
+
"inputs": [],
|
|
182
|
+
"name": "jumpMultiplierPerBlock",
|
|
183
|
+
"outputs": [
|
|
184
|
+
{
|
|
185
|
+
"internalType": "uint256",
|
|
186
|
+
"name": "",
|
|
187
|
+
"type": "uint256"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"payable": false,
|
|
191
|
+
"stateMutability": "view",
|
|
192
|
+
"type": "function"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"constant": true,
|
|
196
|
+
"inputs": [],
|
|
197
|
+
"name": "kink",
|
|
198
|
+
"outputs": [
|
|
199
|
+
{
|
|
200
|
+
"internalType": "uint256",
|
|
201
|
+
"name": "",
|
|
202
|
+
"type": "uint256"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"payable": false,
|
|
206
|
+
"stateMutability": "view",
|
|
207
|
+
"type": "function"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"constant": true,
|
|
211
|
+
"inputs": [],
|
|
212
|
+
"name": "multiplierPerBlock",
|
|
213
|
+
"outputs": [
|
|
214
|
+
{
|
|
215
|
+
"internalType": "uint256",
|
|
216
|
+
"name": "",
|
|
217
|
+
"type": "uint256"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"payable": false,
|
|
221
|
+
"stateMutability": "view",
|
|
222
|
+
"type": "function"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"constant": true,
|
|
226
|
+
"inputs": [
|
|
227
|
+
{
|
|
228
|
+
"internalType": "uint256",
|
|
229
|
+
"name": "cash",
|
|
230
|
+
"type": "uint256"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"internalType": "uint256",
|
|
234
|
+
"name": "borrows",
|
|
235
|
+
"type": "uint256"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"internalType": "uint256",
|
|
239
|
+
"name": "reserves",
|
|
240
|
+
"type": "uint256"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"name": "utilizationRate",
|
|
244
|
+
"outputs": [
|
|
245
|
+
{
|
|
246
|
+
"internalType": "uint256",
|
|
247
|
+
"name": "",
|
|
248
|
+
"type": "uint256"
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"payable": false,
|
|
252
|
+
"stateMutability": "pure",
|
|
253
|
+
"type": "function"
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"transactionHash": "0x8a734f67e9cd86ca3cb92123d972581dfe80b6988fc9eb4f414b574b53854053",
|
|
257
|
+
"receipt": {
|
|
258
|
+
"to": null,
|
|
259
|
+
"from": "0x55A9f5374Af30E3045FB491f1da3C2E8a74d168D",
|
|
260
|
+
"contractAddress": "0xcc542643521D5e4dE63f48682e7f577f805e7651",
|
|
261
|
+
"transactionIndex": 364,
|
|
262
|
+
"gasUsed": "490844",
|
|
263
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000080000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
264
|
+
"blockHash": "0x9f4b89e10dd9bdcc419d00256eac7f3427266c7d2f708db9937b56c85c8f08b4",
|
|
265
|
+
"transactionHash": "0x8a734f67e9cd86ca3cb92123d972581dfe80b6988fc9eb4f414b574b53854053",
|
|
266
|
+
"logs": [
|
|
267
|
+
{
|
|
268
|
+
"transactionIndex": 364,
|
|
269
|
+
"blockNumber": 51200538,
|
|
270
|
+
"transactionHash": "0x8a734f67e9cd86ca3cb92123d972581dfe80b6988fc9eb4f414b574b53854053",
|
|
271
|
+
"address": "0xcc542643521D5e4dE63f48682e7f577f805e7651",
|
|
272
|
+
"topics": ["0x6960ab234c7ef4b0c9197100f5393cfcde7c453ac910a27bd2000aa1dd4c068d"],
|
|
273
|
+
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008dc0fa1e0000000000000000000000000000000000000000000000000000000b13138a670000000000000000000000000000000000000000000000000a688906bd8b0000",
|
|
274
|
+
"logIndex": 2769,
|
|
275
|
+
"blockHash": "0x9f4b89e10dd9bdcc419d00256eac7f3427266c7d2f708db9937b56c85c8f08b4"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"blockNumber": 51200538,
|
|
279
|
+
"cumulativeGasUsed": "67732620",
|
|
280
|
+
"status": 1,
|
|
281
|
+
"byzantium": true
|
|
282
|
+
},
|
|
283
|
+
"args": ["0", "100000000000000000", "2000000000000000000", "750000000000000000", 42048000],
|
|
284
|
+
"numDeployments": 1,
|
|
285
|
+
"solcInputHash": "e320c561182ff12e19eb2c016b653f9e",
|
|
286
|
+
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"baseRatePerYear\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"multiplierPerYear\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jumpMultiplierPerYear\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"kink_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blocksPerYear_\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baseRatePerBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"multiplierPerBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"jumpMultiplierPerBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"kink\",\"type\":\"uint256\"}],\"name\":\"NewInterestParams\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"baseRatePerBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"blocksPerYear\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"}],\"name\":\"getBorrowRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveFactorMantissa\",\"type\":\"uint256\"}],\"name\":\"getSupplyRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isInterestRateModel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"jumpMultiplierPerBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"kink\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"multiplierPerBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"}],\"name\":\"utilizationRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"methods\":{\"constructor\":{\"params\":{\"baseRatePerYear\":\"The approximate target base APR, as a mantissa (scaled by 1e18)\",\"blocksPerYear_\":\"The approximate number of blocks per year to assume\",\"jumpMultiplierPerYear\":\"The multiplierPerBlock after hitting a specified utilization point\",\"kink_\":\"The utilization point at which the jump multiplier is applied\",\"multiplierPerYear\":\"The rate of increase in interest rate wrt utilization (scaled by 1e18)\"}},\"getBorrowRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"return\":\"The borrow rate percentage per block as a mantissa (scaled by 1e18)\"},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserveFactorMantissa\":\"The current reserve factor for the market\",\"reserves\":\"The amount of reserves in the market\"},\"return\":\"The supply rate percentage per block as a mantissa (scaled by 1e18)\"},\"utilizationRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market (currently unused)\"},\"return\":\"The utilization rate as a mantissa between [0, 1e18]\"}},\"title\":\"Venus's JumpRateModel Contract\"},\"userdoc\":{\"methods\":{\"constructor\":\"Construct an interest rate model\",\"getBorrowRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the current borrow rate per block, with the error code expected by the market\"},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the current supply rate per block\"},\"utilizationRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\"}}}},\"settings\":{\"compilationTarget\":{\"contracts/InterestRateModels/JumpRateModel.sol\":\"JumpRateModel\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/InterestRateModels/InterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title Venus's InterestRateModel Interface\\n * @author Venus\\n */\\ncontract InterestRateModel {\\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\\n bool public constant isInterestRateModel = true;\\n\\n /**\\n * @notice Calculates the current borrow interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);\\n\\n /**\\n * @notice Calculates the current supply interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @param reserveFactorMantissa The current reserve factor the market has\\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getSupplyRate(\\n uint cash,\\n uint borrows,\\n uint reserves,\\n uint reserveFactorMantissa\\n ) external view returns (uint);\\n}\\n\",\"keccak256\":\"0x786416e63346afec50151e44b993dbbdb12f94cd3f2c9dba631afe237353605f\"},\"contracts/InterestRateModels/JumpRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.5.16;\\n\\nimport \\\"../Utils/SafeMath.sol\\\";\\nimport \\\"./InterestRateModel.sol\\\";\\n\\n/**\\n * @title Venus's JumpRateModel Contract\\n * @author Venus\\n */\\ncontract JumpRateModel is InterestRateModel {\\n using SafeMath for uint;\\n\\n event NewInterestParams(uint baseRatePerBlock, uint multiplierPerBlock, uint jumpMultiplierPerBlock, uint kink);\\n\\n /**\\n * @notice The approximate number of blocks per year that is assumed by the interest rate model\\n */\\n uint public blocksPerYear;\\n\\n /**\\n * @notice The multiplier of utilization rate that gives the slope of the interest rate\\n */\\n uint public multiplierPerBlock;\\n\\n /**\\n * @notice The base interest rate which is the y-intercept when utilization rate is 0\\n */\\n uint public baseRatePerBlock;\\n\\n /**\\n * @notice The multiplierPerBlock after hitting a specified utilization point\\n */\\n uint public jumpMultiplierPerBlock;\\n\\n /**\\n * @notice The utilization point at which the jump multiplier is applied\\n */\\n uint public kink;\\n\\n /**\\n * @notice Construct an interest rate model\\n * @param baseRatePerYear The approximate target base APR, as a mantissa (scaled by 1e18)\\n * @param multiplierPerYear The rate of increase in interest rate wrt utilization (scaled by 1e18)\\n * @param jumpMultiplierPerYear The multiplierPerBlock after hitting a specified utilization point\\n * @param kink_ The utilization point at which the jump multiplier is applied\\n * @param blocksPerYear_ The approximate number of blocks per year to assume\\n */\\n constructor(\\n uint baseRatePerYear,\\n uint multiplierPerYear,\\n uint jumpMultiplierPerYear,\\n uint kink_,\\n uint blocksPerYear_\\n ) public {\\n blocksPerYear = blocksPerYear_;\\n baseRatePerBlock = baseRatePerYear.div(blocksPerYear_);\\n multiplierPerBlock = multiplierPerYear.div(blocksPerYear_);\\n jumpMultiplierPerBlock = jumpMultiplierPerYear.div(blocksPerYear_);\\n kink = kink_;\\n\\n emit NewInterestParams(baseRatePerBlock, multiplierPerBlock, jumpMultiplierPerBlock, kink);\\n }\\n\\n /**\\n * @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market (currently unused)\\n * @return The utilization rate as a mantissa between [0, 1e18]\\n */\\n function utilizationRate(uint cash, uint borrows, uint reserves) public pure returns (uint) {\\n // Utilization rate is 0 when there are no borrows\\n if (borrows == 0) {\\n return 0;\\n }\\n\\n return borrows.mul(1e18).div(cash.add(borrows).sub(reserves));\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per block, with the error code expected by the market\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The borrow rate percentage per block as a mantissa (scaled by 1e18)\\n */\\n function getBorrowRate(uint cash, uint borrows, uint reserves) public view returns (uint) {\\n uint util = utilizationRate(cash, borrows, reserves);\\n\\n if (util <= kink) {\\n return util.mul(multiplierPerBlock).div(1e18).add(baseRatePerBlock);\\n } else {\\n uint normalRate = kink.mul(multiplierPerBlock).div(1e18).add(baseRatePerBlock);\\n uint excessUtil = util.sub(kink);\\n return excessUtil.mul(jumpMultiplierPerBlock).div(1e18).add(normalRate);\\n }\\n }\\n\\n /**\\n * @notice Calculates the current supply rate per block\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @param reserveFactorMantissa The current reserve factor for the market\\n * @return The supply rate percentage per block as a mantissa (scaled by 1e18)\\n */\\n function getSupplyRate(\\n uint cash,\\n uint borrows,\\n uint reserves,\\n uint reserveFactorMantissa\\n ) public view returns (uint) {\\n uint oneMinusReserveFactor = uint(1e18).sub(reserveFactorMantissa);\\n uint borrowRate = getBorrowRate(cash, borrows, reserves);\\n uint rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18);\\n return utilizationRate(cash, borrows, reserves).mul(rateToPool).div(1e18);\\n }\\n}\\n\",\"keccak256\":\"0x87c701db44c54772c6884ef71da11a78747be65a705065c25d8deb8b85b98c98\"},\"contracts/Utils/SafeMath.sol\":{\"content\":\"pragma solidity ^0.5.16;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n return add(a, b, \\\"SafeMath: addition overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, errorMessage);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n // Solidity only automatically asserts when dividing by 0\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0x9431fd772ed4abc038cdfe9ce6c0066897bd1685ad45848748d1952935d5b8ef\"}},\"version\":1}",
|
|
287
|
+
"bytecode": "0x608060405234801561001057600080fd5b50604051610812380380610812833981810160405260a081101561003357600080fd5b50805160208083015160408401516060850151608090950151600081905593949193909261006c908690839061039d6100ff821b17901c565b60025561008484826100ff602090811b61039d17901c565b60015561009c83826100ff602090811b61039d17901c565b60038190556004839055600254600154604080519283526020830191909152818101929092526060810184905290517f6960ab234c7ef4b0c9197100f5393cfcde7c453ac910a27bd2000aa1dd4c068d9181900360800190a150505050506101f0565b600061014783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061014e60201b60201c565b9392505050565b600081836101da5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816101e657fe5b0495945050505050565b610613806101ff6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063a385fb9611610066578063a385fb9614610120578063b816881614610128578063b9f9850a14610157578063f14039de1461015f578063fd2da3391461016757610093565b806315f24053146100985780632191f92a146100d35780636e71e2d8146100ef5780638726bb8914610118575b600080fd5b6100c1600480360360608110156100ae57600080fd5b508035906020810135906040013561016f565b60408051918252519081900360200190f35b6100db610247565b604080519115158252519081900360200190f35b6100c16004803603606081101561010557600080fd5b508035906020810135906040013561024c565b6100c161029e565b6100c16102a4565b6100c16004803603608081101561013e57600080fd5b50803590602081013590604081013590606001356102aa565b6100c1610329565b6100c161032f565b6100c1610335565b60008061017d85858561024c565b905060045481116101cf576101c76002546101bb670de0b6b3a76400006101af6001548661033b90919063ffffffff16565b9063ffffffff61039d16565b9063ffffffff6103df16565b915050610240565b60006101fa6002546101bb670de0b6b3a76400006101af60015460045461033b90919063ffffffff16565b905060006102136004548461042190919063ffffffff16565b905061023a826101bb670de0b6b3a76400006101af6003548661033b90919063ffffffff16565b93505050505b9392505050565b600181565b60008261025b57506000610240565b61029661027e83610272878763ffffffff6103df16565b9063ffffffff61042116565b6101af85670de0b6b3a764000063ffffffff61033b16565b949350505050565b60015481565b60005481565b6000806102c5670de0b6b3a76400008463ffffffff61042116565b905060006102d487878761016f565b905060006102f4670de0b6b3a76400006101af848663ffffffff61033b16565b905061031d670de0b6b3a76400006101af836103118c8c8c61024c565b9063ffffffff61033b16565b98975050505050505050565b60035481565b60025481565b60045481565b60008261034a57506000610397565b8282028284828161035757fe5b04146103945760405162461bcd60e51b81526004018080602001828103825260218152602001806105be6021913960400191505060405180910390fd5b90505b92915050565b600061039483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610463565b600061039483836040518060400160405280601b81526020017f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815250610505565b600061039483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610563565b600081836104ef5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156104b457818101518382015260200161049c565b50505050905090810190601f1680156104e15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816104fb57fe5b0495945050505050565b6000838301828582101561055a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156104b457818101518382015260200161049c565b50949350505050565b600081848411156105b55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156104b457818101518382015260200161049c565b50505090039056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a7231582076f402780e45198caeb5a97509b16371116a983a8839bd7e095f45668ff596b864736f6c63430005100032",
|
|
288
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063a385fb9611610066578063a385fb9614610120578063b816881614610128578063b9f9850a14610157578063f14039de1461015f578063fd2da3391461016757610093565b806315f24053146100985780632191f92a146100d35780636e71e2d8146100ef5780638726bb8914610118575b600080fd5b6100c1600480360360608110156100ae57600080fd5b508035906020810135906040013561016f565b60408051918252519081900360200190f35b6100db610247565b604080519115158252519081900360200190f35b6100c16004803603606081101561010557600080fd5b508035906020810135906040013561024c565b6100c161029e565b6100c16102a4565b6100c16004803603608081101561013e57600080fd5b50803590602081013590604081013590606001356102aa565b6100c1610329565b6100c161032f565b6100c1610335565b60008061017d85858561024c565b905060045481116101cf576101c76002546101bb670de0b6b3a76400006101af6001548661033b90919063ffffffff16565b9063ffffffff61039d16565b9063ffffffff6103df16565b915050610240565b60006101fa6002546101bb670de0b6b3a76400006101af60015460045461033b90919063ffffffff16565b905060006102136004548461042190919063ffffffff16565b905061023a826101bb670de0b6b3a76400006101af6003548661033b90919063ffffffff16565b93505050505b9392505050565b600181565b60008261025b57506000610240565b61029661027e83610272878763ffffffff6103df16565b9063ffffffff61042116565b6101af85670de0b6b3a764000063ffffffff61033b16565b949350505050565b60015481565b60005481565b6000806102c5670de0b6b3a76400008463ffffffff61042116565b905060006102d487878761016f565b905060006102f4670de0b6b3a76400006101af848663ffffffff61033b16565b905061031d670de0b6b3a76400006101af836103118c8c8c61024c565b9063ffffffff61033b16565b98975050505050505050565b60035481565b60025481565b60045481565b60008261034a57506000610397565b8282028284828161035757fe5b04146103945760405162461bcd60e51b81526004018080602001828103825260218152602001806105be6021913960400191505060405180910390fd5b90505b92915050565b600061039483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610463565b600061039483836040518060400160405280601b81526020017f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815250610505565b600061039483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610563565b600081836104ef5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156104b457818101518382015260200161049c565b50505050905090810190601f1680156104e15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816104fb57fe5b0495945050505050565b6000838301828582101561055a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156104b457818101518382015260200161049c565b50949350505050565b600081848411156105b55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156104b457818101518382015260200161049c565b50505090039056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a7231582076f402780e45198caeb5a97509b16371116a983a8839bd7e095f45668ff596b864736f6c63430005100032",
|
|
289
|
+
"devdoc": {
|
|
290
|
+
"author": "Venus",
|
|
291
|
+
"methods": {
|
|
292
|
+
"constructor": {
|
|
293
|
+
"params": {
|
|
294
|
+
"baseRatePerYear": "The approximate target base APR, as a mantissa (scaled by 1e18)",
|
|
295
|
+
"blocksPerYear_": "The approximate number of blocks per year to assume",
|
|
296
|
+
"jumpMultiplierPerYear": "The multiplierPerBlock after hitting a specified utilization point",
|
|
297
|
+
"kink_": "The utilization point at which the jump multiplier is applied",
|
|
298
|
+
"multiplierPerYear": "The rate of increase in interest rate wrt utilization (scaled by 1e18)"
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"getBorrowRate(uint256,uint256,uint256)": {
|
|
302
|
+
"params": {
|
|
303
|
+
"borrows": "The amount of borrows in the market",
|
|
304
|
+
"cash": "The amount of cash in the market",
|
|
305
|
+
"reserves": "The amount of reserves in the market"
|
|
306
|
+
},
|
|
307
|
+
"return": "The borrow rate percentage per block as a mantissa (scaled by 1e18)"
|
|
308
|
+
},
|
|
309
|
+
"getSupplyRate(uint256,uint256,uint256,uint256)": {
|
|
310
|
+
"params": {
|
|
311
|
+
"borrows": "The amount of borrows in the market",
|
|
312
|
+
"cash": "The amount of cash in the market",
|
|
313
|
+
"reserveFactorMantissa": "The current reserve factor for the market",
|
|
314
|
+
"reserves": "The amount of reserves in the market"
|
|
315
|
+
},
|
|
316
|
+
"return": "The supply rate percentage per block as a mantissa (scaled by 1e18)"
|
|
317
|
+
},
|
|
318
|
+
"utilizationRate(uint256,uint256,uint256)": {
|
|
319
|
+
"params": {
|
|
320
|
+
"borrows": "The amount of borrows in the market",
|
|
321
|
+
"cash": "The amount of cash in the market",
|
|
322
|
+
"reserves": "The amount of reserves in the market (currently unused)"
|
|
323
|
+
},
|
|
324
|
+
"return": "The utilization rate as a mantissa between [0, 1e18]"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"title": "Venus's JumpRateModel Contract"
|
|
328
|
+
},
|
|
329
|
+
"userdoc": {
|
|
330
|
+
"methods": {
|
|
331
|
+
"constructor": "Construct an interest rate model",
|
|
332
|
+
"getBorrowRate(uint256,uint256,uint256)": {
|
|
333
|
+
"notice": "Calculates the current borrow rate per block, with the error code expected by the market"
|
|
334
|
+
},
|
|
335
|
+
"getSupplyRate(uint256,uint256,uint256,uint256)": {
|
|
336
|
+
"notice": "Calculates the current supply rate per block"
|
|
337
|
+
},
|
|
338
|
+
"utilizationRate(uint256,uint256,uint256)": {
|
|
339
|
+
"notice": "Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`"
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"storageLayout": {
|
|
344
|
+
"storage": [
|
|
345
|
+
{
|
|
346
|
+
"astId": 9365,
|
|
347
|
+
"contract": "contracts/InterestRateModels/JumpRateModel.sol:JumpRateModel",
|
|
348
|
+
"label": "blocksPerYear",
|
|
349
|
+
"offset": 0,
|
|
350
|
+
"slot": "0",
|
|
351
|
+
"type": "t_uint256"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"astId": 9367,
|
|
355
|
+
"contract": "contracts/InterestRateModels/JumpRateModel.sol:JumpRateModel",
|
|
356
|
+
"label": "multiplierPerBlock",
|
|
357
|
+
"offset": 0,
|
|
358
|
+
"slot": "1",
|
|
359
|
+
"type": "t_uint256"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"astId": 9369,
|
|
363
|
+
"contract": "contracts/InterestRateModels/JumpRateModel.sol:JumpRateModel",
|
|
364
|
+
"label": "baseRatePerBlock",
|
|
365
|
+
"offset": 0,
|
|
366
|
+
"slot": "2",
|
|
367
|
+
"type": "t_uint256"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"astId": 9371,
|
|
371
|
+
"contract": "contracts/InterestRateModels/JumpRateModel.sol:JumpRateModel",
|
|
372
|
+
"label": "jumpMultiplierPerBlock",
|
|
373
|
+
"offset": 0,
|
|
374
|
+
"slot": "3",
|
|
375
|
+
"type": "t_uint256"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"astId": 9373,
|
|
379
|
+
"contract": "contracts/InterestRateModels/JumpRateModel.sol:JumpRateModel",
|
|
380
|
+
"label": "kink",
|
|
381
|
+
"offset": 0,
|
|
382
|
+
"slot": "4",
|
|
383
|
+
"type": "t_uint256"
|
|
384
|
+
}
|
|
385
|
+
],
|
|
386
|
+
"types": {
|
|
387
|
+
"t_uint256": {
|
|
388
|
+
"encoding": "inplace",
|
|
389
|
+
"label": "uint256",
|
|
390
|
+
"numberOfBytes": "32"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|