From 1b71fe9bf68f8cd14559dca8ff85a5b0f64de1d0 Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Tue, 18 May 2021 22:23:20 -0700 Subject: [PATCH 1/8] Add compSpeeds and borrowCaps to Lens. --- contracts/Lens/CompoundLens.sol | 11 ++++++++++- tests/Lens/CompoundLensTest.js | 12 ++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/contracts/Lens/CompoundLens.sol b/contracts/Lens/CompoundLens.sol index 9aa3518ce..59f730080 100644 --- a/contracts/Lens/CompoundLens.sol +++ b/contracts/Lens/CompoundLens.sol @@ -15,6 +15,8 @@ interface ComptrollerLensInterface { function getAssetsIn(address) external view returns (CToken[] memory); function claimComp(address) external; function compAccrued(address) external view returns (uint); + function compSpeeds(address) external view returns (uint); + function borrowCaps(address) external view returns (uint); } interface GovernorBravoInterface { @@ -56,6 +58,8 @@ contract CompoundLens { address underlyingAssetAddress; uint cTokenDecimals; uint underlyingDecimals; + uint compSpeed; + uint borrowCap; } function cTokenMetadata(CToken cToken) public returns (CTokenMetadata memory) { @@ -74,6 +78,9 @@ contract CompoundLens { underlyingDecimals = EIP20Interface(cErc20.underlying()).decimals(); } + uint compSpeed = comptroller.compSpeeds(address(cToken)); //TODO: try/catch this depending on how it performs on networks where this no exists. + uint borrowCap = comptroller.borrowCaps(address(cToken)); //TODO: try/catch this depending on how it performs on networks where this no exists. + return CTokenMetadata({ cToken: address(cToken), exchangeRateCurrent: exchangeRateCurrent, @@ -88,7 +95,9 @@ contract CompoundLens { collateralFactorMantissa: collateralFactorMantissa, underlyingAssetAddress: underlyingAssetAddress, cTokenDecimals: cToken.decimals(), - underlyingDecimals: underlyingDecimals + underlyingDecimals: underlyingDecimals, + compSpeed: compSpeed, + borrowCap: borrowCap }); } diff --git a/tests/Lens/CompoundLensTest.js b/tests/Lens/CompoundLensTest.js index de26de925..7bc7e9a53 100644 --- a/tests/Lens/CompoundLensTest.js +++ b/tests/Lens/CompoundLensTest.js @@ -49,7 +49,9 @@ describe('CompoundLens', () => { collateralFactorMantissa: "0", underlyingAssetAddress: await call(cErc20, 'underlying', []), cTokenDecimals: "8", - underlyingDecimals: "18" + underlyingDecimals: "18", + compSpeed: "0", + borrowCap: "0", } ); }); @@ -73,6 +75,8 @@ describe('CompoundLens', () => { totalSupply: "0", underlyingAssetAddress: "0x0000000000000000000000000000000000000000", underlyingDecimals: "18", + compSpeed: "0", + borrowCap: "0", }); }); }); @@ -98,7 +102,9 @@ describe('CompoundLens', () => { collateralFactorMantissa: "0", underlyingAssetAddress: await call(cErc20, 'underlying', []), cTokenDecimals: "8", - underlyingDecimals: "18" + underlyingDecimals: "18", + compSpeed: "0", + borrowCap: "0", }, { borrowRatePerBlock: "0", @@ -115,6 +121,8 @@ describe('CompoundLens', () => { totalSupply: "0", underlyingAssetAddress: "0x0000000000000000000000000000000000000000", underlyingDecimals: "18", + compSpeed: "0", + borrowCap: "0", } ]); }); From 5cdde74576899d9275720343df62e70175b79f51 Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Wed, 19 May 2021 10:06:12 -0700 Subject: [PATCH 2/8] Updated compSpeed and borrowCap with wrappers to catch reverts which should only happen if the comptroller is older. --- contracts/Lens/CompoundLens.sol | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/contracts/Lens/CompoundLens.sol b/contracts/Lens/CompoundLens.sol index 59f730080..9d8697a46 100644 --- a/contracts/Lens/CompoundLens.sol +++ b/contracts/Lens/CompoundLens.sol @@ -78,8 +78,29 @@ contract CompoundLens { underlyingDecimals = EIP20Interface(cErc20.underlying()).decimals(); } - uint compSpeed = comptroller.compSpeeds(address(cToken)); //TODO: try/catch this depending on how it performs on networks where this no exists. - uint borrowCap = comptroller.borrowCaps(address(cToken)); //TODO: try/catch this depending on how it performs on networks where this no exists. + uint compSpeed = 0; + (bool compSpeedSuccess, bytes memory compSpeedReturnData) = + address(comptroller).call( + abi.encodePacked( + comptroller.compSpeeds.selector, + abi.encode(address(cToken)) + ) + ); + if (compSpeedSuccess) { + compSpeed = abi.decode(compSpeedReturnData, (uint)); + } + + uint borrowCap = 0; + (bool borrowCapSuccess, bytes memory borrowCapReturnData) = + address(comptroller).call( + abi.encodePacked( + comptroller.borrowCaps.selector, + abi.encode(address(cToken)) + ) + ); + if (borrowCapSuccess) { + borrowCap = abi.decode(borrowCapReturnData, (uint)); + } return CTokenMetadata({ cToken: address(cToken), From 10270aec814779a7eb2c8c7257d699aae6bc807a Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Wed, 19 May 2021 10:18:45 -0700 Subject: [PATCH 3/8] Updated Rinkeby and Kovan addresses & abis with latest Lens deploy. --- networks/kovan-abi.json | 105 +-- networks/kovan.json | 2 +- networks/rinkeby-abi.json | 1413 +++++++++++++++++++++---------------- networks/rinkeby.json | 718 +++++++++---------- 4 files changed, 1229 insertions(+), 1009 deletions(-) diff --git a/networks/kovan-abi.json b/networks/kovan-abi.json index 8e1d3d200..077edb5f4 100644 --- a/networks/kovan-abi.json +++ b/networks/kovan-abi.json @@ -1020,8 +1020,7 @@ ], "payable": false, "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbdf950c9" + "type": "function" }, { "constant": false, @@ -1079,8 +1078,7 @@ ], "payable": false, "stateMutability": "nonpayable", - "type": "function", - "signature": "0x0972bf8b" + "type": "function" }, { "constant": false, @@ -1164,6 +1162,16 @@ "internalType": "uint256", "name": "underlyingDecimals", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "compSpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" } ], "internalType": "struct CompoundLens.CTokenMetadata", @@ -1173,8 +1181,7 @@ ], "payable": false, "stateMutability": "nonpayable", - "type": "function", - "signature": "0x158eca8b" + "type": "function" }, { "constant": false, @@ -1258,6 +1265,16 @@ "internalType": "uint256", "name": "underlyingDecimals", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "compSpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" } ], "internalType": "struct CompoundLens.CTokenMetadata[]", @@ -1267,8 +1284,7 @@ ], "payable": false, "stateMutability": "nonpayable", - "type": "function", - "signature": "0x4b70d84b" + "type": "function" }, { "constant": false, @@ -1301,8 +1317,7 @@ ], "payable": false, "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc5ae5934" + "type": "function" }, { "constant": false, @@ -1335,14 +1350,13 @@ ], "payable": false, "stateMutability": "nonpayable", - "type": "function", - "signature": "0x2b2d5ed6" + "type": "function" }, { "constant": false, "inputs": [ { - "internalType": "contract Comptroller", + "internalType": "contract ComptrollerLensInterface", "name": "comptroller", "type": "address" }, @@ -1379,8 +1393,7 @@ ], "payable": false, "stateMutability": "nonpayable", - "type": "function", - "signature": "0x7dd8f6d9" + "type": "function" }, { "constant": true, @@ -1423,8 +1436,7 @@ ], "payable": false, "stateMutability": "view", - "type": "function", - "signature": "0x416405d7" + "type": "function" }, { "constant": false, @@ -1435,7 +1447,7 @@ "type": "address" }, { - "internalType": "contract Comptroller", + "internalType": "contract ComptrollerLensInterface", "name": "comptroller", "type": "address" }, @@ -1520,14 +1532,13 @@ ], "payable": false, "stateMutability": "view", - "type": "function", - "signature": "0x59564219" + "type": "function" }, { "constant": true, "inputs": [ { - "internalType": "contract GovernorAlpha", + "internalType": "contract GovernorBravoInterface", "name": "governor", "type": "address" }, @@ -1537,7 +1548,7 @@ "type": "uint256[]" } ], - "name": "getGovProposals", + "name": "getGovBravoProposals", "outputs": [ { "components": [ @@ -1596,6 +1607,11 @@ "name": "againstVotes", "type": "uint256" }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + }, { "internalType": "bool", "name": "canceled", @@ -1607,21 +1623,20 @@ "type": "bool" } ], - "internalType": "struct CompoundLens.GovProposal[]", + "internalType": "struct CompoundLens.GovBravoProposal[]", "name": "", "type": "tuple[]" } ], "payable": false, "stateMutability": "view", - "type": "function", - "signature": "0x96994869" + "type": "function" }, { "constant": true, "inputs": [ { - "internalType": "contract GovernorAlpha", + "internalType": "contract GovernorBravoInterface", "name": "governor", "type": "address" }, @@ -1636,7 +1651,7 @@ "type": "uint256[]" } ], - "name": "getGovReceipts", + "name": "getGovBravoReceipts", "outputs": [ { "components": [ @@ -1651,9 +1666,9 @@ "type": "bool" }, { - "internalType": "bool", + "internalType": "uint8", "name": "support", - "type": "bool" + "type": "uint8" }, { "internalType": "uint96", @@ -1661,21 +1676,20 @@ "type": "uint96" } ], - "internalType": "struct CompoundLens.GovReceipt[]", + "internalType": "struct CompoundLens.GovBravoReceipt[]", "name": "", "type": "tuple[]" } ], "payable": false, "stateMutability": "view", - "type": "function", - "signature": "0x995ed99f" + "type": "function" }, { "constant": true, "inputs": [ { - "internalType": "contract GovernorBravo", + "internalType": "contract GovernorAlpha", "name": "governor", "type": "address" }, @@ -1685,7 +1699,7 @@ "type": "uint256[]" } ], - "name": "getGovBravoProposals", + "name": "getGovProposals", "outputs": [ { "components": [ @@ -1744,11 +1758,6 @@ "name": "againstVotes", "type": "uint256" }, - { - "internalType": "uint256", - "name": "abstainVotes", - "type": "uint256" - }, { "internalType": "bool", "name": "canceled", @@ -1760,21 +1769,20 @@ "type": "bool" } ], - "internalType": "struct CompoundLens.GovBravoProposal[]", + "internalType": "struct CompoundLens.GovProposal[]", "name": "", "type": "tuple[]" } ], "payable": false, "stateMutability": "view", - "type": "function", - "signature": "0x96994869" + "type": "function" }, { "constant": true, "inputs": [ { - "internalType": "contract GovernorBravo", + "internalType": "contract GovernorAlpha", "name": "governor", "type": "address" }, @@ -1789,7 +1797,7 @@ "type": "uint256[]" } ], - "name": "getGovBravoReceipts", + "name": "getGovReceipts", "outputs": [ { "components": [ @@ -1804,9 +1812,9 @@ "type": "bool" }, { - "internalType": "uint8", + "internalType": "bool", "name": "support", - "type": "uint8" + "type": "bool" }, { "internalType": "uint96", @@ -1814,15 +1822,14 @@ "type": "uint96" } ], - "internalType": "struct CompoundLens.GovBravoReceipt[]", + "internalType": "struct CompoundLens.GovReceipt[]", "name": "", "type": "tuple[]" } ], "payable": false, "stateMutability": "view", - "type": "function", - "signature": "0x995ed99f" + "type": "function" } ], "Base200bps_Slope2000bps_Jump20000bps_Kink90": [ diff --git a/networks/kovan.json b/networks/kovan.json index 11906102e..e05423c46 100644 --- a/networks/kovan.json +++ b/networks/kovan.json @@ -1,7 +1,7 @@ { "Contracts": { "Comp": "0x61460874a7196d6a22D1eE4922473664b3E95270", - "CompoundLens": "0x08CcdB87966C4C7c3Ce7dA8C103c8E14627753D0", + "CompoundLens": "0x1C235cD4f8A3884f7aD9f6768E27C10fb5156D15", "Base200bps_Slope2000bps_Jump20000bps_Kink90": "0x255559E3608a4251F04C227E57F24d9af921940E", "Base200bps_Slope3000bps": "0x7BDf14574c844cD9B75073f91Bb1aEAb44aB0529", "Base500bps_Slope1200bps": "0xb9c437ff606d51666aC98078c4693f32A6091ac7", diff --git a/networks/rinkeby-abi.json b/networks/rinkeby-abi.json index 8a6161df2..3d3b5177f 100644 --- a/networks/rinkeby-abi.json +++ b/networks/rinkeby-abi.json @@ -5114,660 +5114,873 @@ ], "CompoundLens": [ { - "constant": false, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken", + "name": "cToken", + "type": "address" + }, + { + "internalType": "address payable", + "name": "account", + "type": "address" + } + ], + "name": "cTokenBalances", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balanceOf", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowBalanceCurrent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceOfUnderlying", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAllowance", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CTokenBalances", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract CToken[]", + "name": "cTokens", + "type": "address[]" + }, + { + "internalType": "address payable", + "name": "account", + "type": "address" + } + ], + "name": "cTokenBalancesAll", + "outputs": [ + { + "components": [ { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" + "internalType": "address", + "name": "cToken", + "type": "address" }, { - "internalType": "address payable", - "name": "account", - "type": "address" - } - ], - "name": "cTokenBalances", - "outputs": [ + "internalType": "uint256", + "name": "balanceOf", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balanceOf", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowBalanceCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balanceOfUnderlying", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenAllowance", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenBalances", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbdf950c9" - }, - { - "constant": false, - "inputs": [ + "internalType": "uint256", + "name": "borrowBalanceCurrent", + "type": "uint256" + }, { - "internalType": "contract CToken[]", - "name": "cTokens", - "type": "address[]" + "internalType": "uint256", + "name": "balanceOfUnderlying", + "type": "uint256" }, { - "internalType": "address payable", - "name": "account", - "type": "address" - } - ], - "name": "cTokenBalancesAll", - "outputs": [ + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balanceOf", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowBalanceCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balanceOfUnderlying", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenAllowance", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenBalances[]", - "name": "", - "type": "tuple[]" + "internalType": "uint256", + "name": "tokenAllowance", + "type": "uint256" } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x0972bf8b" + ], + "internalType": "struct CompoundLens.CTokenBalances[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "constant": false, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken", + "name": "cToken", + "type": "address" + } + ], + "name": "cTokenMetadata", + "outputs": [ + { + "components": [ { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" - } - ], - "name": "cTokenMetadata", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "exchangeRateCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "supplyRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveFactorMantissa", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalBorrows", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalReserves", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCash", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isListed", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "collateralFactorMantissa", - "type": "uint256" - }, - { - "internalType": "address", - "name": "underlyingAssetAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "cTokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "underlyingDecimals", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenMetadata", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x158eca8b" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract CToken[]", - "name": "cTokens", - "type": "address[]" - } - ], - "name": "cTokenMetadataAll", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "exchangeRateCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "supplyRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveFactorMantissa", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalBorrows", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalReserves", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCash", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isListed", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "collateralFactorMantissa", - "type": "uint256" - }, - { - "internalType": "address", - "name": "underlyingAssetAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "cTokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "underlyingDecimals", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenMetadata[]", - "name": "", - "type": "tuple[]" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x4b70d84b" - }, - { - "constant": false, - "inputs": [ + "internalType": "address", + "name": "cToken", + "type": "address" + }, { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" - } - ], - "name": "cTokenUnderlyingPrice", - "outputs": [ + "internalType": "uint256", + "name": "exchangeRateCurrent", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "underlyingPrice", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenUnderlyingPrice", - "name": "", - "type": "tuple" + "internalType": "uint256", + "name": "supplyRatePerBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRatePerBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalReserves", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "underlyingAssetAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "underlyingDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "compSpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc5ae5934" + ], + "internalType": "struct CompoundLens.CTokenMetadata", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "constant": false, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken[]", + "name": "cTokens", + "type": "address[]" + } + ], + "name": "cTokenMetadataAll", + "outputs": [ + { + "components": [ { - "internalType": "contract CToken[]", - "name": "cTokens", - "type": "address[]" - } - ], - "name": "cTokenUnderlyingPriceAll", - "outputs": [ + "internalType": "address", + "name": "cToken", + "type": "address" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "underlyingPrice", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenUnderlyingPrice[]", - "name": "", - "type": "tuple[]" + "internalType": "uint256", + "name": "exchangeRateCurrent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyRatePerBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRatePerBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalReserves", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "underlyingAssetAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "underlyingDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "compSpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x2b2d5ed6" + ], + "internalType": "struct CompoundLens.CTokenMetadata[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "constant": false, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken", + "name": "cToken", + "type": "address" + } + ], + "name": "cTokenUnderlyingPrice", + "outputs": [ + { + "components": [ { - "internalType": "contract Comptroller", - "name": "comptroller", - "type": "address" + "internalType": "address", + "name": "cToken", + "type": "address" }, { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getAccountLimits", - "outputs": [ + "internalType": "uint256", + "name": "underlyingPrice", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CTokenUnderlyingPrice", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract CToken[]", + "name": "cTokens", + "type": "address[]" + } + ], + "name": "cTokenUnderlyingPriceAll", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "underlyingPrice", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CTokenUnderlyingPrice[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLimits", + "outputs": [ + { + "components": [ + { + "internalType": "contract CToken[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.AccountLimits", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "contract Comp", + "name": "comp", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getCompBalanceMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "internalType": "struct CompoundLens.CompBalanceMetadata", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract Comp", + "name": "comp", + "type": "address" + }, + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getCompBalanceMetadataExt", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allocated", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CompBalanceMetadataExt", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "contract Comp", + "name": "comp", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint32[]", + "name": "blockNumbers", + "type": "uint32[]" + } + ], + "name": "getCompVotes", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CompVotes[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorBravoInterface", + "name": "governor", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovBravoProposals", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "eta", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "string[]", + "name": "signatures", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "startBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "againstVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + }, { - "components": [ - { - "internalType": "contract CToken[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "liquidity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortfall", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.AccountLimits", - "name": "", - "type": "tuple" + "internalType": "bool", + "name": "canceled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x7dd8f6d9" + ], + "internalType": "struct CompoundLens.GovBravoProposal[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "constant": true, - "inputs": [ + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorBravoInterface", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovBravoReceipts", + "outputs": [ + { + "components": [ { - "internalType": "contract Comp", - "name": "comp", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getCompBalanceMetadata", - "outputs": [ + "internalType": "bool", + "name": "hasVoted", + "type": "bool" + }, { - "components": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - }, - { - "internalType": "address", - "name": "delegate", - "type": "address" - } - ], - "internalType": "struct CompoundLens.CompBalanceMetadata", - "name": "", - "type": "tuple" + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "uint96", + "name": "votes", + "type": "uint96" } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x416405d7" + ], + "internalType": "struct CompoundLens.GovBravoReceipt[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "constant": true, - "inputs": [ + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorAlpha", + "name": "governor", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovProposals", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "eta", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "string[]", + "name": "signatures", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "startBlock", + "type": "uint256" + }, { - "internalType": "contract Comp", - "name": "comp", - "type": "address" + "internalType": "uint256", + "name": "endBlock", + "type": "uint256" }, { - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "uint256", + "name": "forVotes", + "type": "uint256" }, { - "internalType": "uint32[]", - "name": "blockNumbers", - "type": "uint32[]" - } - ], - "name": "getCompVotes", - "outputs": [ + "internalType": "uint256", + "name": "againstVotes", + "type": "uint256" + }, { - "components": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CompVotes[]", - "name": "", - "type": "tuple[]" + "internalType": "bool", + "name": "canceled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x59564219" + ], + "internalType": "struct CompoundLens.GovProposal[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "constant": true, - "inputs": [ + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorAlpha", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovReceipts", + "outputs": [ + { + "components": [ { - "internalType": "contract GovernorAlpha", - "name": "governor", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { - "internalType": "uint256[]", - "name": "proposalIds", - "type": "uint256[]" - } - ], - "name": "getGovProposals", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "eta", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "string[]", - "name": "signatures", - "type": "string[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256", - "name": "startBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "endBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "forVotes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "againstVotes", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "canceled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "executed", - "type": "bool" - } - ], - "internalType": "struct CompoundLens.GovProposal[]", - "name": "", - "type": "tuple[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x96994869" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract GovernorAlpha", - "name": "governor", - "type": "address" + "internalType": "bool", + "name": "hasVoted", + "type": "bool" }, { - "internalType": "address", - "name": "voter", - "type": "address" + "internalType": "bool", + "name": "support", + "type": "bool" }, { - "internalType": "uint256[]", - "name": "proposalIds", - "type": "uint256[]" - } - ], - "name": "getGovReceipts", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "hasVoted", - "type": "bool" - }, - { - "internalType": "bool", - "name": "support", - "type": "bool" - }, - { - "internalType": "uint96", - "name": "votes", - "type": "uint96" - } - ], - "internalType": "struct CompoundLens.GovReceipt[]", - "name": "", - "type": "tuple[]" + "internalType": "uint96", + "name": "votes", + "type": "uint96" } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x995ed99f" + ], + "internalType": "struct CompoundLens.GovReceipt[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" } - ], + ], "DAI": [ { "constant": true, diff --git a/networks/rinkeby.json b/networks/rinkeby.json index 83eb996a4..da97e03e7 100644 --- a/networks/rinkeby.json +++ b/networks/rinkeby.json @@ -1,374 +1,374 @@ { - "Contracts": { - "ZRX": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", - "cUSDC": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1", - "PriceOracle": "0xD2B1eCa822550d9358e97e72c6C1a93AE28408d0", - "ZeroComptroller": "0x16e175eE9f555E43FD01f3aFa359A37b10e5139b", - "PriceOracleProxy": "0x5722A3F60fa4F0EC5120DCD6C386289A4758D1b2", - "Maximillion": "0xFBBDBa59516adA2eADf50f96cE0151edC9e0A674", - "Base200bps_Slope2000bps_Jump20000bps_Kink90": "0x5e237767da01d6fEF0D238aFe6a1EE02c43D8218", - "cDAI": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14", - "CompoundLens": "0x2B833E2D24ac3c246664b986554A7485fDf75D8b", - "DAI": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", - "StdComptroller": "0x99127FD9840Cbc2bBfF43dF443887f4d96268916", - "Unitroller": "0x2EAa9D77AE4D8f9cdD9FAAcd44016E746485bddb", - "USDT": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", - "Comptroller": "0x2EAa9D77AE4D8f9cdD9FAAcd44016E746485bddb", - "cUSDT": "0x2fB298BDbeF468638AD6653FF8376575ea41e768", - "cBAT": "0xEBf1A11532b93a529b5bC942B4bAA98647913002", - "Base0bps_Slope2000bps": "0x1A43BFd39B15DcF444e17Ab408C4b5be32DEB7F5", - "BAT": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", - "cETH": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e", - "cUsdtDelegate": "0x98394a121D26F90F4841e7BFE9dD4Aba05E666E4", - "Base500bps_Slope1200bps": "0xE12630c8Fdd7d0096c9Cd72Cd228598AEBe58795", - "Timelock": "0xe4cD9a61431FbD268ea842D68533561262C17513", - "Base200bps_Slope3000bps": "0x6330D442A2D7eE4DC66C0adb9969e8702aEfc9fE", - "cREP": "0xEBe09eB3411D18F4FF8D859e096C533CAC5c6B60", - "ComptrollerG2": "0xb1983eE0064Fdb2A581966715DC9bA4D8B289A6A", - "WBTC": "0x577D296678535e4903D59A4C929B718e1D575e0A", - "REP": "0x6e894660985207feb7cf89Faf048998c71E8EE89", - "cZRX": "0x52201ff1720134bBbBB2f6BC97Bf3715490EC19B", - "cWBTC": "0x0014F450B8Ae7708593F4A46F8fa6E5D50620F96", - "USDC": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b" + "Contracts": { + "ZRX": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", + "cUSDC": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1", + "PriceOracle": "0xD2B1eCa822550d9358e97e72c6C1a93AE28408d0", + "ZeroComptroller": "0x16e175eE9f555E43FD01f3aFa359A37b10e5139b", + "PriceOracleProxy": "0x5722A3F60fa4F0EC5120DCD6C386289A4758D1b2", + "Maximillion": "0xFBBDBa59516adA2eADf50f96cE0151edC9e0A674", + "Base200bps_Slope2000bps_Jump20000bps_Kink90": "0x5e237767da01d6fEF0D238aFe6a1EE02c43D8218", + "cDAI": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14", + "CompoundLens": "0xc68BFb6D3150CCc26193007F3096a9B691d3692c", + "DAI": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "StdComptroller": "0x99127FD9840Cbc2bBfF43dF443887f4d96268916", + "Unitroller": "0x2EAa9D77AE4D8f9cdD9FAAcd44016E746485bddb", + "USDT": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", + "Comptroller": "0x2EAa9D77AE4D8f9cdD9FAAcd44016E746485bddb", + "cUSDT": "0x2fB298BDbeF468638AD6653FF8376575ea41e768", + "cBAT": "0xEBf1A11532b93a529b5bC942B4bAA98647913002", + "Base0bps_Slope2000bps": "0x1A43BFd39B15DcF444e17Ab408C4b5be32DEB7F5", + "BAT": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", + "cETH": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e", + "cUsdtDelegate": "0x98394a121D26F90F4841e7BFE9dD4Aba05E666E4", + "Base500bps_Slope1200bps": "0xE12630c8Fdd7d0096c9Cd72Cd228598AEBe58795", + "Timelock": "0xe4cD9a61431FbD268ea842D68533561262C17513", + "Base200bps_Slope3000bps": "0x6330D442A2D7eE4DC66C0adb9969e8702aEfc9fE", + "cREP": "0xEBe09eB3411D18F4FF8D859e096C533CAC5c6B60", + "ComptrollerG2": "0xb1983eE0064Fdb2A581966715DC9bA4D8B289A6A", + "WBTC": "0x577D296678535e4903D59A4C929B718e1D575e0A", + "REP": "0x6e894660985207feb7cf89Faf048998c71E8EE89", + "cZRX": "0x52201ff1720134bBbBB2f6BC97Bf3715490EC19B", + "cWBTC": "0x0014F450B8Ae7708593F4A46F8fa6E5D50620F96", + "USDC": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b" + }, + "Blocks": { + "cUSDC": 4319847, + "ZeroComptroller": 4347719, + "PriceOracleProxy": 6402199, + "Maximillion": 4319848, + "Base200bps_Slope2000bps_Jump20000bps_Kink90": 6402170, + "cDAI": 4319844, + "CompoundLens": 6312618, + "StdComptroller": 4319836, + "Unitroller": 4319835, + "USDT": 6402171, + "cUSDT": 6402173, + "cBAT": 4319843, + "Base0bps_Slope2000bps": 4319840, + "cETH": 4319846, + "cUsdtDelegate": 6402172, + "Base500bps_Slope1200bps": 4319839, + "Timelock": 5245966, + "Base200bps_Slope3000bps": 4319841, + "cREP": 4319845, + "ComptrollerG2": 5245967, + "WBTC": 4717533, + "cZRX": 4319842, + "cWBTC": 4717535 + }, + "PriceOracleProxy": { + "description": "Price Oracle Proxy", + "cETH": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e", + "cUSDC": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1", + "cSAI": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14", + "cDAI": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14", + "cUSDT": "0x2fB298BDbeF468638AD6653FF8376575ea41e768", + "address": "0x5722A3F60fa4F0EC5120DCD6C386289A4758D1b2" + }, + "Maximillion": { + "description": "Maximillion", + "cEtherAddress": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e", + "address": "0xFBBDBa59516adA2eADf50f96cE0151edC9e0A674" + }, + "CompoundLens": { + "name": "CompoundLens", + "contract": "CompoundLens" + }, + "Unitroller": { + "description": "Unitroller", + "address": "0x2EAa9D77AE4D8f9cdD9FAAcd44016E746485bddb" + }, + "Comptroller": { + "StdComptroller": { + "address": "0x99127FD9840Cbc2bBfF43dF443887f4d96268916", + "contract": "Comptroller", + "description": "Standard Comptroller Impl" }, - "Blocks": { - "cUSDC": 4319847, - "ZeroComptroller": 4347719, - "PriceOracleProxy": 6402199, - "Maximillion": 4319848, - "Base200bps_Slope2000bps_Jump20000bps_Kink90": 6402170, - "cDAI": 4319844, - "CompoundLens": 6312618, - "StdComptroller": 4319836, - "Unitroller": 4319835, - "USDT": 6402171, - "cUSDT": 6402173, - "cBAT": 4319843, - "Base0bps_Slope2000bps": 4319840, - "cETH": 4319846, - "cUsdtDelegate": 6402172, - "Base500bps_Slope1200bps": 4319839, - "Timelock": 5245966, - "Base200bps_Slope3000bps": 4319841, - "cREP": 4319845, - "ComptrollerG2": 5245967, - "WBTC": 4717533, - "cZRX": 4319842, - "cWBTC": 4717535 + "ZeroComptroller": { + "address": "0x16e175eE9f555E43FD01f3aFa359A37b10e5139b", + "contract": "Comptroller", + "description": "Standard Comptroller Impl" }, - "PriceOracleProxy": { - "description": "Price Oracle Proxy", - "cETH": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e", - "cUSDC": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1", - "cSAI": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14", - "cDAI": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14", - "cUSDT": "0x2fB298BDbeF468638AD6653FF8376575ea41e768", - "address": "0x5722A3F60fa4F0EC5120DCD6C386289A4758D1b2" + "ComptrollerG2": { + "address": "0xb1983eE0064Fdb2A581966715DC9bA4D8B289A6A", + "contract": "Comptroller", + "description": "Standard Comptroller Impl" + } + }, + "Timelock": { + "address": "0xe4cD9a61431FbD268ea842D68533561262C17513", + "contract": "Timelock", + "description": "Test Timelock" + }, + "Constructors": { + "ZRX": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000002307800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000", + "cUSDC": "0x0000000000000000000000004dbcdf9b62e891a7cec5a2568c3f4faf9e8abe2b0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000001a43bfd39b15dcf444e17ab408c4b5be32deb7f50000000000000000000000000000000000000000000000000000b5e620f4800000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000016436f6d706f756e642055534420436f696e20f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000000000056355534443000000000000000000000000000000000000000000000000000000", + "ZeroComptroller": "0x", + "PriceOracleProxy": "0x0000000000000000000000009c1856636d78c051dead6cab9c5699e4e25549e9000000000000000000000000d2b1eca822550d9358e97e72c6c1a93ae28408d0000000000000000000000000d6801a1dffcd0a410336ef88def4320d6df1883e0000000000000000000000005b281a6dda0b271e91ae35de655ad301c976edb10000000000000000000000006d7f0754ffeb405d23c51ce938289d4835be3b140000000000000000000000006d7f0754ffeb405d23c51ce938289d4835be3b140000000000000000000000002fb298bdbef468638ad6653ff8376575ea41e768", + "Maximillion": "0x000000000000000000000000d6801a1dffcd0a410336ef88def4320d6df1883e", + "Base200bps_Slope2000bps_Jump20000bps_Kink90": "0x00000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000002c68af0bb1400000000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000c7d713b49da0000", + "cDAI": "0x0000000000000000000000005592ec0cfb4dbc12d3ab100b257153436a1f0fea0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb000000000000000000000000e12630c8fdd7d0096c9cd72cd228598aebe58795000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000011436f6d706f756e642044616920f09f938800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046344414900000000000000000000000000000000000000000000000000000000", + "CompoundLens": "0x", + "DAI": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000003446169000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034441490000000000000000000000000000000000000000000000000000000000", + "StdComptroller": "0x", + "Unitroller": "0x", + "USDT": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000d436f6d706f756e6420555344540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045553445400000000000000000000000000000000000000000000000000000000", + "cUSDT": "0x000000000000000000000000d9ba894e0097f8cc2bbc9d24d308b98e36dc6d020000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000005e237767da01d6fef0d238afe6a1ee02c43d82180000000000000000000000000000000000000000000000000000b5e620f48000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000008000000000000000000000000e4cd9a61431fbd268ea842d68533561262c1751300000000000000000000000098394a121d26f90f4841e7bfe9dd4aba05e666e400000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000000d436f6d706f756e642055534454000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005635553445400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000", + "cBAT": "0x000000000000000000000000bf7a7169562078c96f0ec1a8afd6ae50f12e5a990000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000023436f6d706f756e6420426173696320417474656e74696f6e20546f6b656e20f09f9388000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046342415400000000000000000000000000000000000000000000000000000000", + "Base0bps_Slope2000bps": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c68af0bb140000", + "BAT": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000015426173696320417474656e74696f6e20546f6b656e000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000", + "cETH": "0x0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000001a43bfd39b15dcf444e17ab408c4b5be32deb7f5000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000013436f6d706f756e6420457468657220f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046345544800000000000000000000000000000000000000000000000000000000", + "cUsdtDelegate": "0x", + "Base500bps_Slope1200bps": "0x00000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000001aa535d3d0c0000", + "Timelock": "0x0000000000000000000000009c1856636d78c051dead6cab9c5699e4e25549e900000000000000000000000000000000000000000000000000000000000000b4", + "Base200bps_Slope3000bps": "0x00000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000429d069189e0000", + "cREP": "0x0000000000000000000000006e894660985207feb7cf89faf048998c71e8ee890000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000013436f6d706f756e6420417567757220f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046352455000000000000000000000000000000000000000000000000000000000", + "ComptrollerG2": "0x", + "WBTC": "0x", + "REP": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000005417567757200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035245500000000000000000000000000000000000000000000000000000000000", + "cZRX": "0x000000000000000000000000ddea378a6ddc8afec82c36e9b0078826bf9e68b60000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010436f6d706f756e6420307820f09f9388000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004635a525800000000000000000000000000000000000000000000000000000000", + "cWBTC": "0x000000000000000000000000577d296678535e4903d59a4c929b718e1d575e0a0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe00000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000019436f6d706f756e6420577261707065642042544320f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000056357425443000000000000000000000000000000000000000000000000000000", + "USDC": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000855534420436f696e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045553444300000000000000000000000000000000000000000000000000000000" + }, + "Tokens": { + "ZRX": { + "name": "0x", + "symbol": "ZRX", + "decimals": 18, + "address": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6" + }, + "cUSDC": { + "name": "Compound USD Coin 📈", + "symbol": "cUSDC", + "decimals": 8, + "underlying": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000", + "address": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1" + }, + "cDAI": { + "name": "Compound Dai 📈", + "symbol": "cDAI", + "decimals": 8, + "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14" + }, + "DAI": { + "name": "Dai", + "symbol": "DAI", + "decimals": 18, + "address": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa" + }, + "USDT": { + "description": "Standard", + "name": "Compound USDT", + "symbol": "USDT", + "decimals": 18, + "contract": "FaucetToken", + "address": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02" + }, + "cUSDT": { + "name": "Compound USDT", + "symbol": "cUSDT", + "decimals": 8, + "underlying": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", + "contract": "CErc20Delegator", + "initial_exchange_rate_mantissa": "200000000000000", + "admin": "0xe4cD9a61431FbD268ea842D68533561262C17513", + "address": "0x2fB298BDbeF468638AD6653FF8376575ea41e768" + }, + "cBAT": { + "name": "Compound Basic Attention Token 📈", + "symbol": "cBAT", + "decimals": 8, + "underlying": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0xEBf1A11532b93a529b5bC942B4bAA98647913002" + }, + "BAT": { + "name": "Basic Attention Token", + "symbol": "BAT", + "decimals": 18, + "address": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99" + }, + "cETH": { + "name": "Compound Ether 📈", + "symbol": "cETH", + "decimals": 8, + "underlying": "", + "contract": "CEther", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e" }, - "Maximillion": { - "description": "Maximillion", - "cEtherAddress": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e", - "address": "0xFBBDBa59516adA2eADf50f96cE0151edC9e0A674" + "cREP": { + "name": "Compound Augur 📈", + "symbol": "cREP", + "decimals": 8, + "underlying": "0x6e894660985207feb7cf89Faf048998c71E8EE89", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0xEBe09eB3411D18F4FF8D859e096C533CAC5c6B60" }, - "CompoundLens": { - "name": "CompoundLens", - "contract": "CompoundLens" + "WBTC": { + "description": "WBTC", + "name": "Wrapped BTC", + "symbol": "WBTC", + "decimals": 8, + "contract": "WBTCToken", + "address": "0x577D296678535e4903D59A4C929B718e1D575e0A" }, - "Unitroller": { - "description": "Unitroller", - "address": "0x2EAa9D77AE4D8f9cdD9FAAcd44016E746485bddb" + "REP": { + "name": "Augur", + "symbol": "REP", + "decimals": 18, + "address": "0x6e894660985207feb7cf89Faf048998c71E8EE89" }, - "Comptroller": { - "StdComptroller": { - "address": "0x99127FD9840Cbc2bBfF43dF443887f4d96268916", - "contract": "Comptroller", - "description": "Standard Comptroller Impl" - }, - "ZeroComptroller": { - "address": "0x16e175eE9f555E43FD01f3aFa359A37b10e5139b", - "contract": "Comptroller", - "description": "Standard Comptroller Impl" - }, - "ComptrollerG2": { - "address": "0xb1983eE0064Fdb2A581966715DC9bA4D8B289A6A", - "contract": "Comptroller", - "description": "Standard Comptroller Impl" - } + "cZRX": { + "name": "Compound 0x 📈", + "symbol": "cZRX", + "decimals": 8, + "underlying": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0x52201ff1720134bBbBB2f6BC97Bf3715490EC19B" }, - "Timelock": { - "address": "0xe4cD9a61431FbD268ea842D68533561262C17513", - "contract": "Timelock", - "description": "Test Timelock" + "cWBTC": { + "name": "Compound Wrapped BTC 📈", + "symbol": "cWBTC", + "decimals": 8, + "underlying": "0x577D296678535e4903D59A4C929B718e1D575e0A", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "20000000000000000", + "address": "0x0014F450B8Ae7708593F4A46F8fa6E5D50620F96" }, - "Constructors": { - "ZRX": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000002307800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000", - "cUSDC": "0x0000000000000000000000004dbcdf9b62e891a7cec5a2568c3f4faf9e8abe2b0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000001a43bfd39b15dcf444e17ab408c4b5be32deb7f50000000000000000000000000000000000000000000000000000b5e620f4800000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000016436f6d706f756e642055534420436f696e20f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000000000056355534443000000000000000000000000000000000000000000000000000000", - "ZeroComptroller": "0x", - "PriceOracleProxy": "0x0000000000000000000000009c1856636d78c051dead6cab9c5699e4e25549e9000000000000000000000000d2b1eca822550d9358e97e72c6c1a93ae28408d0000000000000000000000000d6801a1dffcd0a410336ef88def4320d6df1883e0000000000000000000000005b281a6dda0b271e91ae35de655ad301c976edb10000000000000000000000006d7f0754ffeb405d23c51ce938289d4835be3b140000000000000000000000006d7f0754ffeb405d23c51ce938289d4835be3b140000000000000000000000002fb298bdbef468638ad6653ff8376575ea41e768", - "Maximillion": "0x000000000000000000000000d6801a1dffcd0a410336ef88def4320d6df1883e", - "Base200bps_Slope2000bps_Jump20000bps_Kink90": "0x00000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000002c68af0bb1400000000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000c7d713b49da0000", - "cDAI": "0x0000000000000000000000005592ec0cfb4dbc12d3ab100b257153436a1f0fea0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb000000000000000000000000e12630c8fdd7d0096c9cd72cd228598aebe58795000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000011436f6d706f756e642044616920f09f938800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046344414900000000000000000000000000000000000000000000000000000000", - "CompoundLens": "0x", - "DAI": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000003446169000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034441490000000000000000000000000000000000000000000000000000000000", - "StdComptroller": "0x", - "Unitroller": "0x", - "USDT": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000d436f6d706f756e6420555344540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045553445400000000000000000000000000000000000000000000000000000000", - "cUSDT": "0x000000000000000000000000d9ba894e0097f8cc2bbc9d24d308b98e36dc6d020000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000005e237767da01d6fef0d238afe6a1ee02c43d82180000000000000000000000000000000000000000000000000000b5e620f48000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000008000000000000000000000000e4cd9a61431fbd268ea842d68533561262c1751300000000000000000000000098394a121d26f90f4841e7bfe9dd4aba05e666e400000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000000d436f6d706f756e642055534454000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005635553445400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000", - "cBAT": "0x000000000000000000000000bf7a7169562078c96f0ec1a8afd6ae50f12e5a990000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000023436f6d706f756e6420426173696320417474656e74696f6e20546f6b656e20f09f9388000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046342415400000000000000000000000000000000000000000000000000000000", - "Base0bps_Slope2000bps": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c68af0bb140000", - "BAT": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000015426173696320417474656e74696f6e20546f6b656e000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000", - "cETH": "0x0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000001a43bfd39b15dcf444e17ab408c4b5be32deb7f5000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000013436f6d706f756e6420457468657220f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046345544800000000000000000000000000000000000000000000000000000000", - "cUsdtDelegate": "0x", - "Base500bps_Slope1200bps": "0x00000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000001aa535d3d0c0000", - "Timelock": "0x0000000000000000000000009c1856636d78c051dead6cab9c5699e4e25549e900000000000000000000000000000000000000000000000000000000000000b4", - "Base200bps_Slope3000bps": "0x00000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000429d069189e0000", - "cREP": "0x0000000000000000000000006e894660985207feb7cf89faf048998c71e8ee890000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000013436f6d706f756e6420417567757220f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046352455000000000000000000000000000000000000000000000000000000000", - "ComptrollerG2": "0x", - "WBTC": "0x", - "REP": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000005417567757200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035245500000000000000000000000000000000000000000000000000000000000", - "cZRX": "0x000000000000000000000000ddea378a6ddc8afec82c36e9b0078826bf9e68b60000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe000000000000000000000000000000000000000000a56fa5b99019a5c800000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010436f6d706f756e6420307820f09f9388000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004635a525800000000000000000000000000000000000000000000000000000000", - "cWBTC": "0x000000000000000000000000577d296678535e4903d59a4c929b718e1d575e0a0000000000000000000000002eaa9d77ae4d8f9cdd9faacd44016e746485bddb0000000000000000000000006330d442a2d7ee4dc66c0adb9969e8702aefc9fe00000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000019436f6d706f756e6420577261707065642042544320f09f93880000000000000000000000000000000000000000000000000000000000000000000000000000056357425443000000000000000000000000000000000000000000000000000000", - "USDC": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000855534420436f696e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045553444300000000000000000000000000000000000000000000000000000000" + "USDC": { + "description": "Standard", + "name": "USD Coin", + "symbol": "USDC", + "decimals": 6, + "address": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", + "contract": "FaucetToken" + } + }, + "CTokenDelegate": { + "cUsdtDelegate": { + "address": "0x98394a121D26F90F4841e7BFE9dD4Aba05E666E4", + "contract": "CErc20Delegate", + "description": "Standard CErc20 Delegate" + } + }, + "cTokens": { + "cZRX": { + "name": "Compound 0x 📈", + "symbol": "cZRX", + "decimals": 8, + "underlying": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0x52201ff1720134bBbBB2f6BC97Bf3715490EC19B" + }, + "cBAT": { + "name": "Compound Basic Attention Token 📈", + "symbol": "cBAT", + "decimals": 8, + "underlying": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0xEBf1A11532b93a529b5bC942B4bAA98647913002" + }, + "cDAI": { + "name": "Compound Dai 📈", + "symbol": "cDAI", + "decimals": 8, + "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14" + }, + "cREP": { + "name": "Compound Augur 📈", + "symbol": "cREP", + "decimals": 8, + "underlying": "0x6e894660985207feb7cf89Faf048998c71E8EE89", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0xEBe09eB3411D18F4FF8D859e096C533CAC5c6B60" }, - "Tokens": { - "ZRX": { - "name": "0x", - "symbol": "ZRX", - "decimals": 18, - "address": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6" - }, - "cUSDC": { - "name": "Compound USD Coin 📈", - "symbol": "cUSDC", - "decimals": 8, - "underlying": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000", - "address": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1" - }, - "cDAI": { - "name": "Compound Dai 📈", - "symbol": "cDAI", - "decimals": 8, - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14" - }, - "DAI": { - "name": "Dai", - "symbol": "DAI", - "decimals": 18, - "address": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa" - }, - "USDT": { - "description": "Standard", - "name": "Compound USDT", - "symbol": "USDT", - "decimals": 18, - "contract": "FaucetToken", - "address": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02" - }, - "cUSDT": { - "name": "Compound USDT", - "symbol": "cUSDT", - "decimals": 8, - "underlying": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", - "contract": "CErc20Delegator", - "initial_exchange_rate_mantissa": "200000000000000", - "admin": "0xe4cD9a61431FbD268ea842D68533561262C17513", - "address": "0x2fB298BDbeF468638AD6653FF8376575ea41e768" - }, - "cBAT": { - "name": "Compound Basic Attention Token 📈", - "symbol": "cBAT", - "decimals": 8, - "underlying": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0xEBf1A11532b93a529b5bC942B4bAA98647913002" - }, - "BAT": { - "name": "Basic Attention Token", - "symbol": "BAT", - "decimals": 18, - "address": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99" - }, - "cETH": { - "name": "Compound Ether 📈", - "symbol": "cETH", - "decimals": 8, - "underlying": "", - "contract": "CEther", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e" - }, - "cREP": { - "name": "Compound Augur 📈", - "symbol": "cREP", - "decimals": 8, - "underlying": "0x6e894660985207feb7cf89Faf048998c71E8EE89", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0xEBe09eB3411D18F4FF8D859e096C533CAC5c6B60" - }, - "WBTC": { - "description": "WBTC", - "name": "Wrapped BTC", - "symbol": "WBTC", - "decimals": 8, - "contract": "WBTCToken", - "address": "0x577D296678535e4903D59A4C929B718e1D575e0A" - }, - "REP": { - "name": "Augur", - "symbol": "REP", - "decimals": 18, - "address": "0x6e894660985207feb7cf89Faf048998c71E8EE89" - }, - "cZRX": { - "name": "Compound 0x 📈", - "symbol": "cZRX", - "decimals": 8, - "underlying": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0x52201ff1720134bBbBB2f6BC97Bf3715490EC19B" - }, - "cWBTC": { - "name": "Compound Wrapped BTC 📈", - "symbol": "cWBTC", - "decimals": 8, - "underlying": "0x577D296678535e4903D59A4C929B718e1D575e0A", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "20000000000000000", - "address": "0x0014F450B8Ae7708593F4A46F8fa6E5D50620F96" - }, - "USDC": { - "description": "Standard", - "name": "USD Coin", - "symbol": "USDC", - "decimals": 6, - "address": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", - "contract": "FaucetToken" - } + "cETH": { + "name": "Compound Ether 📈", + "symbol": "cETH", + "decimals": 8, + "underlying": "", + "contract": "CEther", + "initial_exchange_rate_mantissa": "200000000000000000000000000", + "address": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e" + }, + "cUSDC": { + "name": "Compound USD Coin 📈", + "symbol": "cUSDC", + "decimals": 8, + "underlying": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "200000000000000", + "address": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1" + }, + "cWBTC": { + "name": "Compound Wrapped BTC 📈", + "symbol": "cWBTC", + "decimals": 8, + "underlying": "0x577D296678535e4903D59A4C929B718e1D575e0A", + "contract": "CErc20", + "initial_exchange_rate_mantissa": "20000000000000000", + "address": "0x0014F450B8Ae7708593F4A46F8fa6E5D50620F96" + }, + "cUSDT": { + "name": "Compound USDT", + "symbol": "cUSDT", + "decimals": 8, + "underlying": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", + "contract": "CErc20Delegator", + "initial_exchange_rate_mantissa": "200000000000000", + "admin": "0xe4cD9a61431FbD268ea842D68533561262C17513", + "address": "0x2fB298BDbeF468638AD6653FF8376575ea41e768" + } + }, + "InterestRateModel": { + "Base500bps_Slope1200bps": { + "name": "Base500bps_Slope1200bps", + "contract": "WhitePaperInterestRateModel", + "description": "WhitePaper baseRate=50000000000000000 multiplier=120000000000000000", + "base": "50000000000000000", + "slope": "120000000000000000", + "address": "0xE12630c8Fdd7d0096c9Cd72Cd228598AEBe58795" }, - "CTokenDelegate": { - "cUsdtDelegate": { - "address": "0x98394a121D26F90F4841e7BFE9dD4Aba05E666E4", - "contract": "CErc20Delegate", - "description": "Standard CErc20 Delegate" - } + "Base0bps_Slope2000bps": { + "name": "Base0bps_Slope2000bps", + "contract": "WhitePaperInterestRateModel", + "description": "WhitePaper baseRate=0 multiplier=200000000000000000", + "base": "0", + "slope": "200000000000000000", + "address": "0x1A43BFd39B15DcF444e17Ab408C4b5be32DEB7F5" }, - "cTokens": { - "cZRX": { - "name": "Compound 0x 📈", - "symbol": "cZRX", - "decimals": 8, - "underlying": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0x52201ff1720134bBbBB2f6BC97Bf3715490EC19B" - }, - "cBAT": { - "name": "Compound Basic Attention Token 📈", - "symbol": "cBAT", - "decimals": 8, - "underlying": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0xEBf1A11532b93a529b5bC942B4bAA98647913002" - }, - "cDAI": { - "name": "Compound Dai 📈", - "symbol": "cDAI", - "decimals": 8, - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0x6D7F0754FFeb405d23C51CE938289d4835bE3b14" - }, - "cREP": { - "name": "Compound Augur 📈", - "symbol": "cREP", - "decimals": 8, - "underlying": "0x6e894660985207feb7cf89Faf048998c71E8EE89", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0xEBe09eB3411D18F4FF8D859e096C533CAC5c6B60" - }, - "cETH": { - "name": "Compound Ether 📈", - "symbol": "cETH", - "decimals": 8, - "underlying": "", - "contract": "CEther", - "initial_exchange_rate_mantissa": "200000000000000000000000000", - "address": "0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e" - }, - "cUSDC": { - "name": "Compound USD Coin 📈", - "symbol": "cUSDC", - "decimals": 8, - "underlying": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "200000000000000", - "address": "0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1" - }, - "cWBTC": { - "name": "Compound Wrapped BTC 📈", - "symbol": "cWBTC", - "decimals": 8, - "underlying": "0x577D296678535e4903D59A4C929B718e1D575e0A", - "contract": "CErc20", - "initial_exchange_rate_mantissa": "20000000000000000", - "address": "0x0014F450B8Ae7708593F4A46F8fa6E5D50620F96" - }, - "cUSDT": { - "name": "Compound USDT", - "symbol": "cUSDT", - "decimals": 8, - "underlying": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", - "contract": "CErc20Delegator", - "initial_exchange_rate_mantissa": "200000000000000", - "admin": "0xe4cD9a61431FbD268ea842D68533561262C17513", - "address": "0x2fB298BDbeF468638AD6653FF8376575ea41e768" - } + "Base200bps_Slope3000bps": { + "name": "Base200bps_Slope3000bps", + "contract": "WhitePaperInterestRateModel", + "description": "WhitePaper baseRate=20000000000000000 multiplier=300000000000000000", + "base": "20000000000000000", + "slope": "300000000000000000", + "address": "0x6330D442A2D7eE4DC66C0adb9969e8702aEfc9fE" }, - "InterestRateModel": { - "Base500bps_Slope1200bps": { - "name": "Base500bps_Slope1200bps", - "contract": "WhitePaperInterestRateModel", - "description": "WhitePaper baseRate=50000000000000000 multiplier=120000000000000000", - "base": "50000000000000000", - "slope": "120000000000000000", - "address": "0xE12630c8Fdd7d0096c9Cd72Cd228598AEBe58795" - }, - "Base0bps_Slope2000bps": { - "name": "Base0bps_Slope2000bps", - "contract": "WhitePaperInterestRateModel", - "description": "WhitePaper baseRate=0 multiplier=200000000000000000", - "base": "0", - "slope": "200000000000000000", - "address": "0x1A43BFd39B15DcF444e17Ab408C4b5be32DEB7F5" - }, - "Base200bps_Slope3000bps": { - "name": "Base200bps_Slope3000bps", - "contract": "WhitePaperInterestRateModel", - "description": "WhitePaper baseRate=20000000000000000 multiplier=300000000000000000", - "base": "20000000000000000", - "slope": "300000000000000000", - "address": "0x6330D442A2D7eE4DC66C0adb9969e8702aEfc9fE" - }, - "Base200bps_Slope2000bps_Jump20000bps_Kink90": { - "name": "Base200bps_Slope2000bps_Jump20000bps_Kink90", - "contract": "JumpRateModel", - "description": "JumpRateModel baseRate=20000000000000000 multiplier=200000000000000000 jump=2000000000000000000 kink=900000000000000000", - "base": "20000000000000000", - "slope": "200000000000000000", - "jump": "2000000000000000000", - "kink": "900000000000000000", - "address": "0x5e237767da01d6fEF0D238aFe6a1EE02c43D8218" - } + "Base200bps_Slope2000bps_Jump20000bps_Kink90": { + "name": "Base200bps_Slope2000bps_Jump20000bps_Kink90", + "contract": "JumpRateModel", + "description": "JumpRateModel baseRate=20000000000000000 multiplier=200000000000000000 jump=2000000000000000000 kink=900000000000000000", + "base": "20000000000000000", + "slope": "200000000000000000", + "jump": "2000000000000000000", + "kink": "900000000000000000", + "address": "0x5e237767da01d6fEF0D238aFe6a1EE02c43D8218" } + } } \ No newline at end of file From 23fe5f626fba7090f75169a314833a347b73396b Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Wed, 19 May 2021 14:57:24 -0700 Subject: [PATCH 4/8] Updated Ropsten and Goerli addresses & abis with latest Lens deploy. --- networks/goerli-abi.json | 1399 ++++++++++++++++++++++---------------- networks/goerli.json | 2 +- 2 files changed, 807 insertions(+), 594 deletions(-) diff --git a/networks/goerli-abi.json b/networks/goerli-abi.json index 7d3ee4089..64f4e8b16 100644 --- a/networks/goerli-abi.json +++ b/networks/goerli-abi.json @@ -4585,658 +4585,871 @@ ], "CompoundLens": [ { - "constant": false, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken", + "name": "cToken", + "type": "address" + }, + { + "internalType": "address payable", + "name": "account", + "type": "address" + } + ], + "name": "cTokenBalances", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balanceOf", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowBalanceCurrent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceOfUnderlying", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAllowance", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CTokenBalances", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract CToken[]", + "name": "cTokens", + "type": "address[]" + }, + { + "internalType": "address payable", + "name": "account", + "type": "address" + } + ], + "name": "cTokenBalancesAll", + "outputs": [ + { + "components": [ { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" + "internalType": "address", + "name": "cToken", + "type": "address" }, { - "internalType": "address payable", - "name": "account", - "type": "address" - } - ], - "name": "cTokenBalances", - "outputs": [ + "internalType": "uint256", + "name": "balanceOf", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balanceOf", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowBalanceCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balanceOfUnderlying", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenAllowance", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenBalances", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbdf950c9" - }, - { - "constant": false, - "inputs": [ + "internalType": "uint256", + "name": "borrowBalanceCurrent", + "type": "uint256" + }, { - "internalType": "contract CToken[]", - "name": "cTokens", - "type": "address[]" + "internalType": "uint256", + "name": "balanceOfUnderlying", + "type": "uint256" }, { - "internalType": "address payable", - "name": "account", - "type": "address" - } - ], - "name": "cTokenBalancesAll", - "outputs": [ + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balanceOf", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowBalanceCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balanceOfUnderlying", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenAllowance", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenBalances[]", - "name": "", - "type": "tuple[]" + "internalType": "uint256", + "name": "tokenAllowance", + "type": "uint256" } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x0972bf8b" + ], + "internalType": "struct CompoundLens.CTokenBalances[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "constant": false, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken", + "name": "cToken", + "type": "address" + } + ], + "name": "cTokenMetadata", + "outputs": [ + { + "components": [ { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" - } - ], - "name": "cTokenMetadata", - "outputs": [ + "internalType": "address", + "name": "cToken", + "type": "address" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "exchangeRateCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "supplyRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveFactorMantissa", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalBorrows", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalReserves", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCash", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isListed", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "collateralFactorMantissa", - "type": "uint256" - }, - { - "internalType": "address", - "name": "underlyingAssetAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "cTokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "underlyingDecimals", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenMetadata", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x158eca8b" - }, - { - "constant": false, - "inputs": [ + "internalType": "uint256", + "name": "exchangeRateCurrent", + "type": "uint256" + }, { - "internalType": "contract CToken[]", - "name": "cTokens", - "type": "address[]" - } - ], - "name": "cTokenMetadataAll", - "outputs": [ + "internalType": "uint256", + "name": "supplyRatePerBlock", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "exchangeRateCurrent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "supplyRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowRatePerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveFactorMantissa", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalBorrows", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalReserves", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalCash", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isListed", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "collateralFactorMantissa", - "type": "uint256" - }, - { - "internalType": "address", - "name": "underlyingAssetAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "cTokenDecimals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "underlyingDecimals", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenMetadata[]", - "name": "", - "type": "tuple[]" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x4b70d84b" - }, - { - "constant": false, - "inputs": [ + "internalType": "uint256", + "name": "borrowRatePerBlock", + "type": "uint256" + }, { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" - } - ], - "name": "cTokenUnderlyingPrice", - "outputs": [ + "internalType": "uint256", + "name": "reserveFactorMantissa", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "underlyingPrice", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenUnderlyingPrice", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc5ae5934" - }, - { - "constant": false, - "inputs": [ + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + }, { - "internalType": "contract CToken[]", - "name": "cTokens", - "type": "address[]" - } - ], - "name": "cTokenUnderlyingPriceAll", - "outputs": [ + "internalType": "uint256", + "name": "totalReserves", + "type": "uint256" + }, { - "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "underlyingPrice", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CTokenUnderlyingPrice[]", - "name": "", - "type": "tuple[]" + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "underlyingAssetAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "underlyingDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "compSpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x2b2d5ed6" + ], + "internalType": "struct CompoundLens.CTokenMetadata", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "constant": false, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken[]", + "name": "cTokens", + "type": "address[]" + } + ], + "name": "cTokenMetadataAll", + "outputs": [ + { + "components": [ { - "internalType": "contract Comptroller", - "name": "comptroller", - "type": "address" + "internalType": "address", + "name": "cToken", + "type": "address" }, { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getAccountLimits", - "outputs": [ + "internalType": "uint256", + "name": "exchangeRateCurrent", + "type": "uint256" + }, { - "components": [ - { - "internalType": "contract CToken[]", - "name": "markets", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "liquidity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortfall", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.AccountLimits", - "name": "", - "type": "tuple" + "internalType": "uint256", + "name": "supplyRatePerBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRatePerBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalReserves", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCash", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "underlyingAssetAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cTokenDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "underlyingDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "compSpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x7dd8f6d9" + ], + "internalType": "struct CompoundLens.CTokenMetadata[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "constant": true, - "inputs": [ + "constant": false, + "inputs": [ + { + "internalType": "contract CToken", + "name": "cToken", + "type": "address" + } + ], + "name": "cTokenUnderlyingPrice", + "outputs": [ + { + "components": [ { - "internalType": "contract Comp", - "name": "comp", - "type": "address" + "internalType": "address", + "name": "cToken", + "type": "address" }, { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getCompBalanceMetadata", - "outputs": [ + "internalType": "uint256", + "name": "underlyingPrice", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CTokenUnderlyingPrice", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract CToken[]", + "name": "cTokens", + "type": "address[]" + } + ], + "name": "cTokenUnderlyingPriceAll", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "underlyingPrice", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CTokenUnderlyingPrice[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLimits", + "outputs": [ + { + "components": [ + { + "internalType": "contract CToken[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.AccountLimits", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "contract Comp", + "name": "comp", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getCompBalanceMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "internalType": "struct CompoundLens.CompBalanceMetadata", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract Comp", + "name": "comp", + "type": "address" + }, + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getCompBalanceMetadataExt", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allocated", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CompBalanceMetadataExt", + "name": "", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "contract Comp", + "name": "comp", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint32[]", + "name": "blockNumbers", + "type": "uint32[]" + } + ], + "name": "getCompVotes", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct CompoundLens.CompVotes[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorBravoInterface", + "name": "governor", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovBravoProposals", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "eta", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "string[]", + "name": "signatures", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "startBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "againstVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + }, { - "components": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - }, - { - "internalType": "address", - "name": "delegate", - "type": "address" - } - ], - "internalType": "struct CompoundLens.CompBalanceMetadata", - "name": "", - "type": "tuple" + "internalType": "bool", + "name": "canceled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x416405d7" + ], + "internalType": "struct CompoundLens.GovBravoProposal[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "constant": true, - "inputs": [ + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorBravoInterface", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovBravoReceipts", + "outputs": [ + { + "components": [ { - "internalType": "contract Comp", - "name": "comp", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "bool", + "name": "hasVoted", + "type": "bool" }, { - "internalType": "uint32[]", - "name": "blockNumbers", - "type": "uint32[]" - } - ], - "name": "getCompVotes", - "outputs": [ + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, { - "components": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - } - ], - "internalType": "struct CompoundLens.CompVotes[]", - "name": "", - "type": "tuple[]" + "internalType": "uint96", + "name": "votes", + "type": "uint96" } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x59564219" + ], + "internalType": "struct CompoundLens.GovBravoReceipt[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "constant": true, - "inputs": [ + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorAlpha", + "name": "governor", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovProposals", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "eta", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "string[]", + "name": "signatures", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "startBlock", + "type": "uint256" + }, { - "internalType": "contract GovernorAlpha", - "name": "governor", - "type": "address" + "internalType": "uint256", + "name": "endBlock", + "type": "uint256" }, { - "internalType": "uint256[]", - "name": "proposalIds", - "type": "uint256[]" - } - ], - "name": "getGovProposals", - "outputs": [ + "internalType": "uint256", + "name": "forVotes", + "type": "uint256" + }, { - "components": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "eta", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "string[]", - "name": "signatures", - "type": "string[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256", - "name": "startBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "endBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "forVotes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "againstVotes", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "canceled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "executed", - "type": "bool" - } - ], - "internalType": "struct CompoundLens.GovProposal[]", - "name": "", - "type": "tuple[]" + "internalType": "uint256", + "name": "againstVotes", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "canceled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x96994869" + ], + "internalType": "struct CompoundLens.GovProposal[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "constant": true, - "inputs": [ + "constant": true, + "inputs": [ + { + "internalType": "contract GovernorAlpha", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "proposalIds", + "type": "uint256[]" + } + ], + "name": "getGovReceipts", + "outputs": [ + { + "components": [ { - "internalType": "contract GovernorAlpha", - "name": "governor", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { - "internalType": "address", - "name": "voter", - "type": "address" + "internalType": "bool", + "name": "hasVoted", + "type": "bool" }, { - "internalType": "uint256[]", - "name": "proposalIds", - "type": "uint256[]" - } - ], - "name": "getGovReceipts", - "outputs": [ + "internalType": "bool", + "name": "support", + "type": "bool" + }, { - "components": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "hasVoted", - "type": "bool" - }, - { - "internalType": "bool", - "name": "support", - "type": "bool" - }, - { - "internalType": "uint96", - "name": "votes", - "type": "uint96" - } - ], - "internalType": "struct CompoundLens.GovReceipt[]", - "name": "", - "type": "tuple[]" + "internalType": "uint96", + "name": "votes", + "type": "uint96" } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x995ed99f" + ], + "internalType": "struct CompoundLens.GovReceipt[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" } ], "DAI": [ diff --git a/networks/goerli.json b/networks/goerli.json index 1e708c628..0e96efa2d 100644 --- a/networks/goerli.json +++ b/networks/goerli.json @@ -8,7 +8,7 @@ "CNT1": "0x5E5bB47a4F5c14115f39Ce9207720fD730939c19", "GovernorAlphaHarness": "0x25E105E4f8B0039dbBEAc3BC5a362C1e06F43D8a", "cDAI": "0x822397d9a55d0fefd20F5c4bCaB33C5F65bd28Eb", - "CompoundLens": "0xE6F46170535FAE86BDbF0Cb033595e060cD99333", + "CompoundLens": "0xA1Bd4a10185F30932C78185f86641f11902E873F", "DAI": "0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60", "StdComptroller": "0x95aACAf2342dcF58C08d221404f370c4b1BBD6E6", "Unitroller": "0x627EA49279FD0dE89186A58b8758aD02B6Be2867", From 08f7ba64ba53f1e74106da615fe506e97dfae801 Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Wed, 29 Sep 2021 14:06:42 -0700 Subject: [PATCH 5/8] Add in bandaid fix for split comp speeds change. Return existing compSpeed field by taking the compSupplySpeed only value if it exists. --- contracts/Lens/CompoundLens.sol | 59 +++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/contracts/Lens/CompoundLens.sol b/contracts/Lens/CompoundLens.sol index 9d8697a46..fe7f11bae 100644 --- a/contracts/Lens/CompoundLens.sol +++ b/contracts/Lens/CompoundLens.sol @@ -16,6 +16,8 @@ interface ComptrollerLensInterface { function claimComp(address) external; function compAccrued(address) external view returns (uint); function compSpeeds(address) external view returns (uint); + function compSupplySpeeds(address) external view returns (uint); + function compBorrowSpeeds(address) external view returns (uint); function borrowCaps(address) external view returns (uint); } @@ -62,6 +64,49 @@ contract CompoundLens { uint borrowCap; } + function getCompSpeeds(ComptrollerLensInterface comptroller, CToken cToken) internal returns (uint, uint) { + // Getting comp speeds is gnarly due to not every network having the + // split comp speeds from Proposal 62 and other networks don't even + // have comp speeds. + uint compSupplySpeed = 0; + (bool compSupplySpeedSuccess, bytes memory compSupplySpeedReturnData) = + address(comptroller).call( + abi.encodePacked( + comptroller.compSupplySpeeds.selector, + abi.encode(address(cToken)) + ) + ); + if (compSupplySpeedSuccess) { + compSupplySpeed = abi.decode(compSupplySpeedReturnData, (uint)); + } + + uint compBorrowSpeed = 0; + (bool compBorrowSpeedSuccess, bytes memory compBorrowSpeedReturnData) = + address(comptroller).call( + abi.encodePacked( + comptroller.compBorrowSpeeds.selector, + abi.encode(address(cToken)) + ) + ); + if (compBorrowSpeedSuccess) { + compBorrowSpeed = abi.decode(compBorrowSpeedReturnData, (uint)); + } + + if (!compSupplySpeedSuccess || compBorrowSpeedSuccess) { + (bool compSpeedSuccess, bytes memory compSpeedReturnData) = + address(comptroller).call( + abi.encodePacked( + comptroller.compSpeeds.selector, + abi.encode(address(cToken)) + ) + ); + if (compSpeedSuccess) { + compSupplySpeed = compBorrowSpeed = abi.decode(compSpeedReturnData, (uint)); + } + } + return (compSupplySpeed, compBorrowSpeed); + } + function cTokenMetadata(CToken cToken) public returns (CTokenMetadata memory) { uint exchangeRateCurrent = cToken.exchangeRateCurrent(); ComptrollerLensInterface comptroller = ComptrollerLensInterface(address(cToken.comptroller())); @@ -78,17 +123,9 @@ contract CompoundLens { underlyingDecimals = EIP20Interface(cErc20.underlying()).decimals(); } - uint compSpeed = 0; - (bool compSpeedSuccess, bytes memory compSpeedReturnData) = - address(comptroller).call( - abi.encodePacked( - comptroller.compSpeeds.selector, - abi.encode(address(cToken)) - ) - ); - if (compSpeedSuccess) { - compSpeed = abi.decode(compSpeedReturnData, (uint)); - } + (uint compSupplySpeed, uint compBorrowSpeed) = getCompSpeeds(comptroller, cToken); + //TODO: This needs to be fixed the correct way. For now we'll continue to return a single field. + uint compSpeed = compSupplySpeed; uint borrowCap = 0; (bool borrowCapSuccess, bytes memory borrowCapReturnData) = From b7643324c1a71bab1f06dfca712fb938d8fb8000 Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Wed, 29 Sep 2021 15:03:48 -0700 Subject: [PATCH 6/8] Tiny bug fix on fallback to old compSpeed parsing and added latest mainnet deploy. --- contracts/Lens/CompoundLens.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/Lens/CompoundLens.sol b/contracts/Lens/CompoundLens.sol index fe7f11bae..c95d9f038 100644 --- a/contracts/Lens/CompoundLens.sol +++ b/contracts/Lens/CompoundLens.sol @@ -92,7 +92,7 @@ contract CompoundLens { compBorrowSpeed = abi.decode(compBorrowSpeedReturnData, (uint)); } - if (!compSupplySpeedSuccess || compBorrowSpeedSuccess) { + if (!compSupplySpeedSuccess || !compBorrowSpeedSuccess) { (bool compSpeedSuccess, bytes memory compSpeedReturnData) = address(comptroller).call( abi.encodePacked( From 62625fa1609d73cce587a15004edb776407d2453 Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Thu, 21 Oct 2021 17:28:53 -0400 Subject: [PATCH 7/8] Update tests for new split comp speeds. --- contracts/Lens/CompoundLens.sol | 9 ++++---- tests/Lens/CompoundLensTest.js | 41 +++++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/contracts/Lens/CompoundLens.sol b/contracts/Lens/CompoundLens.sol index c95d9f038..feda52478 100644 --- a/contracts/Lens/CompoundLens.sol +++ b/contracts/Lens/CompoundLens.sol @@ -60,7 +60,8 @@ contract CompoundLens { address underlyingAssetAddress; uint cTokenDecimals; uint underlyingDecimals; - uint compSpeed; + uint compSupplySpeed; + uint compBorrowSpeed; uint borrowCap; } @@ -92,6 +93,7 @@ contract CompoundLens { compBorrowSpeed = abi.decode(compBorrowSpeedReturnData, (uint)); } + // If the split comp speeds call doesn't work, try the oldest non-spit version. if (!compSupplySpeedSuccess || !compBorrowSpeedSuccess) { (bool compSpeedSuccess, bytes memory compSpeedReturnData) = address(comptroller).call( @@ -124,8 +126,6 @@ contract CompoundLens { } (uint compSupplySpeed, uint compBorrowSpeed) = getCompSpeeds(comptroller, cToken); - //TODO: This needs to be fixed the correct way. For now we'll continue to return a single field. - uint compSpeed = compSupplySpeed; uint borrowCap = 0; (bool borrowCapSuccess, bytes memory borrowCapReturnData) = @@ -154,7 +154,8 @@ contract CompoundLens { underlyingAssetAddress: underlyingAssetAddress, cTokenDecimals: cToken.decimals(), underlyingDecimals: underlyingDecimals, - compSpeed: compSpeed, + compSupplySpeed: compSupplySpeed, + compBorrowSpeed: compBorrowSpeed, borrowCap: borrowCap }); } diff --git a/tests/Lens/CompoundLensTest.js b/tests/Lens/CompoundLensTest.js index 7bc7e9a53..f9b15f45c 100644 --- a/tests/Lens/CompoundLensTest.js +++ b/tests/Lens/CompoundLensTest.js @@ -1,6 +1,7 @@ const { address, encodeParameters, + etherExp, } = require('../Utils/Ethereum'); const { makeComptroller, @@ -50,7 +51,8 @@ describe('CompoundLens', () => { underlyingAssetAddress: await call(cErc20, 'underlying', []), cTokenDecimals: "8", underlyingDecimals: "18", - compSpeed: "0", + compSupplySpeed: "0", + compBorrowSpeed: "0", borrowCap: "0", } ); @@ -75,10 +77,39 @@ describe('CompoundLens', () => { totalSupply: "0", underlyingAssetAddress: "0x0000000000000000000000000000000000000000", underlyingDecimals: "18", - compSpeed: "0", + compSupplySpeed: "0", + compBorrowSpeed: "0", borrowCap: "0", }); }); + it('is correct for cErc20 with set comp speeds', async () => { + let comptroller = await makeComptroller(); + let cErc20 = await makeCToken({comptroller, supportMarket: true}); + await send(comptroller, '_setCompSpeeds', [[cErc20._address], [etherExp(0.25)], [etherExp(0.75)]]); + expect( + cullTuple(await call(compoundLens, 'cTokenMetadata', [cErc20._address])) + ).toEqual( + { + cToken: cErc20._address, + exchangeRateCurrent: "1000000000000000000", + supplyRatePerBlock: "0", + borrowRatePerBlock: "0", + reserveFactorMantissa: "0", + totalBorrows: "0", + totalReserves: "0", + totalSupply: "0", + totalCash: "0", + isListed: true, + collateralFactorMantissa: "0", + underlyingAssetAddress: await call(cErc20, 'underlying', []), + cTokenDecimals: "8", + underlyingDecimals: "18", + compSupplySpeed: "250000000000000000", + compBorrowSpeed: "750000000000000000", + borrowCap: "0", + } + ); + }); }); describe('cTokenMetadataAll', () => { @@ -103,7 +134,8 @@ describe('CompoundLens', () => { underlyingAssetAddress: await call(cErc20, 'underlying', []), cTokenDecimals: "8", underlyingDecimals: "18", - compSpeed: "0", + compSupplySpeed: "0", + compBorrowSpeed: "0", borrowCap: "0", }, { @@ -121,7 +153,8 @@ describe('CompoundLens', () => { totalSupply: "0", underlyingAssetAddress: "0x0000000000000000000000000000000000000000", underlyingDecimals: "18", - compSpeed: "0", + compSupplySpeed: "0", + compBorrowSpeed: "0", borrowCap: "0", } ]); From 8547f5cbb515e2dfa415e0079c5f556006a26120 Mon Sep 17 00:00:00 2001 From: arr00 <13561405+arr00@users.noreply.github.com> Date: Fri, 22 Oct 2021 13:19:50 -0400 Subject: [PATCH 8/8] Deploy new lens to mainnet --- networks/mainnet-abi.json | 338 +++++++------------------------------- networks/mainnet.json | 4 +- 2 files changed, 64 insertions(+), 278 deletions(-) diff --git a/networks/mainnet-abi.json b/networks/mainnet-abi.json index 4b35f41fa..71e9dfc1e 100755 --- a/networks/mainnet-abi.json +++ b/networks/mainnet-abi.json @@ -23715,16 +23715,8 @@ "outputs": [ { "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balanceOf", - "type": "uint256" - }, + { "internalType": "address", "name": "cToken", "type": "address" }, + { "internalType": "uint256", "name": "balanceOf", "type": "uint256" }, { "internalType": "uint256", "name": "borrowBalanceCurrent", @@ -23773,16 +23765,8 @@ "outputs": [ { "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balanceOf", - "type": "uint256" - }, + { "internalType": "address", "name": "cToken", "type": "address" }, + { "internalType": "uint256", "name": "balanceOf", "type": "uint256" }, { "internalType": "uint256", "name": "borrowBalanceCurrent", @@ -23816,21 +23800,13 @@ { "constant": false, "inputs": [ - { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" - } + { "internalType": "contract CToken", "name": "cToken", "type": "address" } ], "name": "cTokenMetadata", "outputs": [ { "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, + { "internalType": "address", "name": "cToken", "type": "address" }, { "internalType": "uint256", "name": "exchangeRateCurrent", @@ -23866,16 +23842,8 @@ "name": "totalSupply", "type": "uint256" }, - { - "internalType": "uint256", - "name": "totalCash", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isListed", - "type": "bool" - }, + { "internalType": "uint256", "name": "totalCash", "type": "uint256" }, + { "internalType": "bool", "name": "isListed", "type": "bool" }, { "internalType": "uint256", "name": "collateralFactorMantissa", @@ -23898,14 +23866,15 @@ }, { "internalType": "uint256", - "name": "compSpeed", + "name": "compSupplySpeed", "type": "uint256" }, { "internalType": "uint256", - "name": "borrowCap", + "name": "compBorrowSpeed", "type": "uint256" - } + }, + { "internalType": "uint256", "name": "borrowCap", "type": "uint256" } ], "internalType": "struct CompoundLens.CTokenMetadata", "name": "", @@ -23929,11 +23898,7 @@ "outputs": [ { "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, + { "internalType": "address", "name": "cToken", "type": "address" }, { "internalType": "uint256", "name": "exchangeRateCurrent", @@ -23969,16 +23934,8 @@ "name": "totalSupply", "type": "uint256" }, - { - "internalType": "uint256", - "name": "totalCash", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isListed", - "type": "bool" - }, + { "internalType": "uint256", "name": "totalCash", "type": "uint256" }, + { "internalType": "bool", "name": "isListed", "type": "bool" }, { "internalType": "uint256", "name": "collateralFactorMantissa", @@ -24001,14 +23958,15 @@ }, { "internalType": "uint256", - "name": "compSpeed", + "name": "compSupplySpeed", "type": "uint256" }, { "internalType": "uint256", - "name": "borrowCap", + "name": "compBorrowSpeed", "type": "uint256" - } + }, + { "internalType": "uint256", "name": "borrowCap", "type": "uint256" } ], "internalType": "struct CompoundLens.CTokenMetadata[]", "name": "", @@ -24022,21 +23980,13 @@ { "constant": false, "inputs": [ - { - "internalType": "contract CToken", - "name": "cToken", - "type": "address" - } + { "internalType": "contract CToken", "name": "cToken", "type": "address" } ], "name": "cTokenUnderlyingPrice", "outputs": [ { "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, + { "internalType": "address", "name": "cToken", "type": "address" }, { "internalType": "uint256", "name": "underlyingPrice", @@ -24065,11 +24015,7 @@ "outputs": [ { "components": [ - { - "internalType": "address", - "name": "cToken", - "type": "address" - }, + { "internalType": "address", "name": "cToken", "type": "address" }, { "internalType": "uint256", "name": "underlyingPrice", @@ -24093,11 +24039,7 @@ "name": "comptroller", "type": "address" }, - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "internalType": "address", "name": "account", "type": "address" } ], "name": "getAccountLimits", "outputs": [ @@ -24108,16 +24050,8 @@ "name": "markets", "type": "address[]" }, - { - "internalType": "uint256", - "name": "liquidity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortfall", - "type": "uint256" - } + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } ], "internalType": "struct CompoundLens.AccountLimits", "name": "", @@ -24131,36 +24065,16 @@ { "constant": true, "inputs": [ - { - "internalType": "contract Comp", - "name": "comp", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "internalType": "contract Comp", "name": "comp", "type": "address" }, + { "internalType": "address", "name": "account", "type": "address" } ], "name": "getCompBalanceMetadata", "outputs": [ { "components": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - }, - { - "internalType": "address", - "name": "delegate", - "type": "address" - } + { "internalType": "uint256", "name": "balance", "type": "uint256" }, + { "internalType": "uint256", "name": "votes", "type": "uint256" }, + { "internalType": "address", "name": "delegate", "type": "address" } ], "internalType": "struct CompoundLens.CompBalanceMetadata", "name": "", @@ -24174,46 +24088,22 @@ { "constant": false, "inputs": [ - { - "internalType": "contract Comp", - "name": "comp", - "type": "address" - }, + { "internalType": "contract Comp", "name": "comp", "type": "address" }, { "internalType": "contract ComptrollerLensInterface", "name": "comptroller", "type": "address" }, - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "internalType": "address", "name": "account", "type": "address" } ], "name": "getCompBalanceMetadataExt", "outputs": [ { "components": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - }, - { - "internalType": "address", - "name": "delegate", - "type": "address" - }, - { - "internalType": "uint256", - "name": "allocated", - "type": "uint256" - } + { "internalType": "uint256", "name": "balance", "type": "uint256" }, + { "internalType": "uint256", "name": "votes", "type": "uint256" }, + { "internalType": "address", "name": "delegate", "type": "address" }, + { "internalType": "uint256", "name": "allocated", "type": "uint256" } ], "internalType": "struct CompoundLens.CompBalanceMetadataExt", "name": "", @@ -24227,21 +24117,9 @@ { "constant": true, "inputs": [ - { - "internalType": "contract Comp", - "name": "comp", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint32[]", - "name": "blockNumbers", - "type": "uint32[]" - } + { "internalType": "contract Comp", "name": "comp", "type": "address" }, + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "uint32[]", "name": "blockNumbers", "type": "uint32[]" } ], "name": "getCompVotes", "outputs": [ @@ -24252,11 +24130,7 @@ "name": "blockNumber", "type": "uint256" }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - } + { "internalType": "uint256", "name": "votes", "type": "uint256" } ], "internalType": "struct CompoundLens.CompVotes[]", "name": "", @@ -24290,16 +24164,8 @@ "name": "proposalId", "type": "uint256" }, - { - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "eta", - "type": "uint256" - }, + { "internalType": "address", "name": "proposer", "type": "address" }, + { "internalType": "uint256", "name": "eta", "type": "uint256" }, { "internalType": "address[]", "name": "targets", @@ -24315,26 +24181,14 @@ "name": "signatures", "type": "string[]" }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, + { "internalType": "bytes[]", "name": "calldatas", "type": "bytes[]" }, { "internalType": "uint256", "name": "startBlock", "type": "uint256" }, - { - "internalType": "uint256", - "name": "endBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "forVotes", - "type": "uint256" - }, + { "internalType": "uint256", "name": "endBlock", "type": "uint256" }, + { "internalType": "uint256", "name": "forVotes", "type": "uint256" }, { "internalType": "uint256", "name": "againstVotes", @@ -24345,16 +24199,8 @@ "name": "abstainVotes", "type": "uint256" }, - { - "internalType": "bool", - "name": "canceled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "executed", - "type": "bool" - } + { "internalType": "bool", "name": "canceled", "type": "bool" }, + { "internalType": "bool", "name": "executed", "type": "bool" } ], "internalType": "struct CompoundLens.GovBravoProposal[]", "name": "", @@ -24373,11 +24219,7 @@ "name": "governor", "type": "address" }, - { - "internalType": "address", - "name": "voter", - "type": "address" - }, + { "internalType": "address", "name": "voter", "type": "address" }, { "internalType": "uint256[]", "name": "proposalIds", @@ -24393,21 +24235,9 @@ "name": "proposalId", "type": "uint256" }, - { - "internalType": "bool", - "name": "hasVoted", - "type": "bool" - }, - { - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "internalType": "uint96", - "name": "votes", - "type": "uint96" - } + { "internalType": "bool", "name": "hasVoted", "type": "bool" }, + { "internalType": "uint8", "name": "support", "type": "uint8" }, + { "internalType": "uint96", "name": "votes", "type": "uint96" } ], "internalType": "struct CompoundLens.GovBravoReceipt[]", "name": "", @@ -24441,16 +24271,8 @@ "name": "proposalId", "type": "uint256" }, - { - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "eta", - "type": "uint256" - }, + { "internalType": "address", "name": "proposer", "type": "address" }, + { "internalType": "uint256", "name": "eta", "type": "uint256" }, { "internalType": "address[]", "name": "targets", @@ -24466,41 +24288,21 @@ "name": "signatures", "type": "string[]" }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, + { "internalType": "bytes[]", "name": "calldatas", "type": "bytes[]" }, { "internalType": "uint256", "name": "startBlock", "type": "uint256" }, - { - "internalType": "uint256", - "name": "endBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "forVotes", - "type": "uint256" - }, + { "internalType": "uint256", "name": "endBlock", "type": "uint256" }, + { "internalType": "uint256", "name": "forVotes", "type": "uint256" }, { "internalType": "uint256", "name": "againstVotes", "type": "uint256" }, - { - "internalType": "bool", - "name": "canceled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "executed", - "type": "bool" - } + { "internalType": "bool", "name": "canceled", "type": "bool" }, + { "internalType": "bool", "name": "executed", "type": "bool" } ], "internalType": "struct CompoundLens.GovProposal[]", "name": "", @@ -24519,11 +24321,7 @@ "name": "governor", "type": "address" }, - { - "internalType": "address", - "name": "voter", - "type": "address" - }, + { "internalType": "address", "name": "voter", "type": "address" }, { "internalType": "uint256[]", "name": "proposalIds", @@ -24539,21 +24337,9 @@ "name": "proposalId", "type": "uint256" }, - { - "internalType": "bool", - "name": "hasVoted", - "type": "bool" - }, - { - "internalType": "bool", - "name": "support", - "type": "bool" - }, - { - "internalType": "uint96", - "name": "votes", - "type": "uint96" - } + { "internalType": "bool", "name": "hasVoted", "type": "bool" }, + { "internalType": "bool", "name": "support", "type": "bool" }, + { "internalType": "uint96", "name": "votes", "type": "uint96" } ], "internalType": "struct CompoundLens.GovReceipt[]", "name": "", diff --git a/networks/mainnet.json b/networks/mainnet.json index f1ba7328d..50d4d4f08 100755 --- a/networks/mainnet.json +++ b/networks/mainnet.json @@ -28,7 +28,7 @@ "Base200bps_Slope2000bps_Jump20000bps_Kink90": "0x6bc8fE27D0c7207733656595e73c0D5Cf7AfaE36", "GovernorAlpha": "0xc0dA01a04C3f3E0be433606045bB7017A7323E38", "cDAI": "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643", - "CompoundLens": "0xA1Bd4a10185F30932C78185f86641f11902E873F", + "CompoundLens": "0xdCbDb7306c6Ff46f77B349188dC18cEd9DF30299", "DAI": "0x6B175474E89094C44Da98b954EedeAC495271d0F", "StdComptroller": "0x62F18C451af964197341d3c86D27e98C41BB8fcC", "Poster": "0x3c6809319201b978d821190ba03fa19a3523bd96", @@ -118,7 +118,7 @@ "Base200bps_Slope2000bps_Jump20000bps_Kink90": 9879332, "GovernorAlpha": 9601447, "cDAI": 8983575, - "CompoundLens": 9833393, + "CompoundLens": 13468648, "StdComptroller": 7710672, "Unitroller": 7710671, "cDaiDelegate": 9122579,