protoscan 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +163 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2648 -0
- package/package.json +45 -0
- package/protoscan.config.json +20 -0
- package/src/chains.ts +38 -0
- package/src/config.ts +36 -0
- package/src/diff.ts +113 -0
- package/src/index.ts +289 -0
- package/src/protocols/common.ts +66 -0
- package/src/protocols/index.ts +2 -0
- package/src/protocols/proxy.ts +50 -0
- package/src/registry/aave-v3.ts +242 -0
- package/src/registry/compound-v3.ts +238 -0
- package/src/registry/eigenlayer.ts +190 -0
- package/src/registry/index.ts +38 -0
- package/src/registry/lido.ts +557 -0
- package/src/registry/maker.ts +176 -0
- package/src/registry/morpho-blue.ts +347 -0
- package/src/registry/pendle.ts +120 -0
- package/src/registry/schema.ts +40 -0
- package/src/registry/uniswap-v3.ts +198 -0
- package/src/scanner.ts +181 -0
- package/src/snapshot.ts +70 -0
- package/src/types.ts +67 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { parseAbi } from 'viem';
|
|
2
|
+
import type { ProtocolDef } from './schema.js';
|
|
3
|
+
|
|
4
|
+
const poolAbi = parseAbi([
|
|
5
|
+
'function getReservesList() view returns (address[])',
|
|
6
|
+
'function getReserveData(address asset) view returns ((uint256 configuration, uint128 liquidityIndex, uint128 currentLiquidityRate, uint128 variableBorrowIndex, uint128 currentVariableBorrowRate, uint40 lastUpdateTimestamp, uint16 id, address aTokenAddress, address variableDebtTokenAddress, address interestRateStrategyAddress, uint128 accruedToTreasury, uint128 unbacked, uint128 isolationModeTotalDebt))',
|
|
7
|
+
'function FLASHLOAN_PREMIUM_TOTAL() view returns (uint128)',
|
|
8
|
+
'function FLASHLOAN_PREMIUM_TO_PROTOCOL() view returns (uint128)',
|
|
9
|
+
'function MAX_NUMBER_RESERVES() view returns (uint16)',
|
|
10
|
+
'function BRIDGE_PROTOCOL_FEE() view returns (uint256)',
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const poolConfiguratorAbi = parseAbi([
|
|
14
|
+
'function getConfiguratorLogic() view returns (address)',
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const aclManagerAbi = parseAbi([
|
|
18
|
+
'function isPoolAdmin(address admin) view returns (bool)',
|
|
19
|
+
'function isEmergencyAdmin(address admin) view returns (bool)',
|
|
20
|
+
'function isRiskAdmin(address admin) view returns (bool)',
|
|
21
|
+
'function isFlashBorrower(address borrower) view returns (bool)',
|
|
22
|
+
'function isAssetListingAdmin(address admin) view returns (bool)',
|
|
23
|
+
'function isBridge(address bridge) view returns (bool)',
|
|
24
|
+
'function DEFAULT_ADMIN_ROLE() view returns (bytes32)',
|
|
25
|
+
'function POOL_ADMIN_ROLE() view returns (bytes32)',
|
|
26
|
+
'function EMERGENCY_ADMIN_ROLE() view returns (bytes32)',
|
|
27
|
+
'function RISK_ADMIN_ROLE() view returns (bytes32)',
|
|
28
|
+
'function FLASH_BORROWER_ROLE() view returns (bytes32)',
|
|
29
|
+
'function ASSET_LISTING_ADMIN_ROLE() view returns (bytes32)',
|
|
30
|
+
'function getRoleAdmin(bytes32 role) view returns (bytes32)',
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
const addressProviderAbi = parseAbi([
|
|
34
|
+
'function getPool() view returns (address)',
|
|
35
|
+
'function getPoolConfigurator() view returns (address)',
|
|
36
|
+
'function getPriceOracle() view returns (address)',
|
|
37
|
+
'function getACLManager() view returns (address)',
|
|
38
|
+
'function getACLAdmin() view returns (address)',
|
|
39
|
+
'function getPoolDataProvider() view returns (address)',
|
|
40
|
+
'function owner() view returns (address)',
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
const oracleAbi = parseAbi([
|
|
44
|
+
'function getSourceOfAsset(address asset) view returns (address)',
|
|
45
|
+
'function getFallbackOracle() view returns (address)',
|
|
46
|
+
'function BASE_CURRENCY() view returns (address)',
|
|
47
|
+
'function BASE_CURRENCY_UNIT() view returns (uint256)',
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
const ownerAbi = parseAbi([
|
|
51
|
+
'function owner() view returns (address)',
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
export const aaveV3: ProtocolDef = {
|
|
55
|
+
id: 'aave-v3',
|
|
56
|
+
name: 'Aave V3',
|
|
57
|
+
version: '3.0',
|
|
58
|
+
website: 'https://aave.com',
|
|
59
|
+
description: 'Decentralized non-custodial liquidity protocol',
|
|
60
|
+
|
|
61
|
+
contracts: {
|
|
62
|
+
PoolAddressesProvider: { name: 'PoolAddressesProvider', role: 'Registry for protocol addresses', type: 'raw' },
|
|
63
|
+
Pool: { name: 'Pool', role: 'Main lending/borrowing pool', type: 'proxy' },
|
|
64
|
+
PoolConfigurator: { name: 'PoolConfigurator', role: 'Protocol parameter configuration', type: 'proxy' },
|
|
65
|
+
ACLManager: { name: 'ACLManager', role: 'Access control management', type: 'raw' },
|
|
66
|
+
AaveOracle: { name: 'AaveOracle', role: 'Price oracle aggregator', type: 'raw' },
|
|
67
|
+
PoolDataProvider: { name: 'PoolDataProvider', role: 'Data provider for protocol state', type: 'raw' },
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
deployments: {
|
|
71
|
+
ethereum: {
|
|
72
|
+
PoolAddressesProvider: '0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e',
|
|
73
|
+
Pool: '0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2',
|
|
74
|
+
PoolConfigurator: '0x64b761D848206f447Fe2dd461b0c635Ec39EbB27',
|
|
75
|
+
ACLManager: '0xc2aaCf6553D20d1e9571216fA22D988C6Cb18E6',
|
|
76
|
+
AaveOracle: '0x54586bE62E3c3580375aE3723C145253060Ca0C2',
|
|
77
|
+
PoolDataProvider: '0x7B4EB56E7CD4b454BA8ff71E4518426c8A0EB0e3',
|
|
78
|
+
},
|
|
79
|
+
arbitrum: {
|
|
80
|
+
PoolAddressesProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
|
|
81
|
+
Pool: '0x794a61358D6845594F94dc1DB02A252b5b4814aD',
|
|
82
|
+
PoolConfigurator: '0x8145eddDf43f50276641b55bd3AD95944510021',
|
|
83
|
+
ACLManager: '0xa72636CbcAa8F5FF95B2cc47Ed3D1dED7EF16cc',
|
|
84
|
+
AaveOracle: '0xb56c2F0B653B2e0b10C9b928C8580Ac5Df02C7C7',
|
|
85
|
+
PoolDataProvider: '0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654',
|
|
86
|
+
},
|
|
87
|
+
base: {
|
|
88
|
+
PoolAddressesProvider: '0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D',
|
|
89
|
+
Pool: '0xA238Dd80C259a72e81d7e4664a9801593F98d1c5',
|
|
90
|
+
PoolConfigurator: '0x5731a04B1E775f0fdd454Bf70f3335886e9A96be',
|
|
91
|
+
ACLManager: '0x43955b0899Ab7232E3a454cf84AedD22Ad46FD33',
|
|
92
|
+
AaveOracle: '0x2Cc0Fc26eD4563A5ce5e8bdcfe1A2878676Ae156',
|
|
93
|
+
PoolDataProvider: '0x2d8A3C5677189723C4cB8873CfC9C8976FDF38Ac',
|
|
94
|
+
},
|
|
95
|
+
optimism: {
|
|
96
|
+
PoolAddressesProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
|
|
97
|
+
Pool: '0x794a61358D6845594F94dc1DB02A252b5b4814aD',
|
|
98
|
+
PoolConfigurator: '0x8145eddDf43f50276641b55bd3AD95944510021',
|
|
99
|
+
ACLManager: '0xa72636CbcAa8F5FF95B2cc47Ed3D1dED7EF16cc',
|
|
100
|
+
AaveOracle: '0xD81eb3728a631871a7eBBaD631b5f424909f0c77',
|
|
101
|
+
PoolDataProvider: '0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654',
|
|
102
|
+
},
|
|
103
|
+
polygon: {
|
|
104
|
+
PoolAddressesProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
|
|
105
|
+
Pool: '0x794a61358D6845594F94dc1DB02A252b5b4814aD',
|
|
106
|
+
PoolConfigurator: '0x8145eddDf43f50276641b55bd3AD95944510021',
|
|
107
|
+
ACLManager: '0xa72636CbcAa8F5FF95B2cc47Ed3D1dED7EF16cc',
|
|
108
|
+
AaveOracle: '0xb023e699F5a33916Ea823A16485e259257cA8Bd1',
|
|
109
|
+
PoolDataProvider: '0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
params: [
|
|
114
|
+
{
|
|
115
|
+
name: 'flashloanPremiumTotal',
|
|
116
|
+
description: 'Total flashloan fee in bps',
|
|
117
|
+
contract: 'Pool',
|
|
118
|
+
functionName: 'FLASHLOAN_PREMIUM_TOTAL',
|
|
119
|
+
abi: poolAbi,
|
|
120
|
+
decode: 'bps',
|
|
121
|
+
category: 'config',
|
|
122
|
+
severity: 'warning',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'flashloanPremiumToProtocol',
|
|
126
|
+
description: 'Flashloan fee portion going to protocol treasury',
|
|
127
|
+
contract: 'Pool',
|
|
128
|
+
functionName: 'FLASHLOAN_PREMIUM_TO_PROTOCOL',
|
|
129
|
+
abi: poolAbi,
|
|
130
|
+
decode: 'bps',
|
|
131
|
+
category: 'config',
|
|
132
|
+
severity: 'warning',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'bridgeProtocolFee',
|
|
136
|
+
description: 'Bridge protocol fee',
|
|
137
|
+
contract: 'Pool',
|
|
138
|
+
functionName: 'BRIDGE_PROTOCOL_FEE',
|
|
139
|
+
abi: poolAbi,
|
|
140
|
+
decode: 'uint',
|
|
141
|
+
category: 'config',
|
|
142
|
+
severity: 'warning',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'maxReserves',
|
|
146
|
+
description: 'Maximum number of supported reserves',
|
|
147
|
+
contract: 'Pool',
|
|
148
|
+
functionName: 'MAX_NUMBER_RESERVES',
|
|
149
|
+
abi: poolAbi,
|
|
150
|
+
decode: 'uint',
|
|
151
|
+
category: 'config',
|
|
152
|
+
severity: 'info',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'priceOracle',
|
|
156
|
+
description: 'Active price oracle address',
|
|
157
|
+
contract: 'PoolAddressesProvider',
|
|
158
|
+
functionName: 'getPriceOracle',
|
|
159
|
+
abi: addressProviderAbi,
|
|
160
|
+
decode: 'address',
|
|
161
|
+
category: 'config',
|
|
162
|
+
severity: 'critical',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'aclAdmin',
|
|
166
|
+
description: 'ACL admin — can grant/revoke all roles',
|
|
167
|
+
contract: 'PoolAddressesProvider',
|
|
168
|
+
functionName: 'getACLAdmin',
|
|
169
|
+
abi: addressProviderAbi,
|
|
170
|
+
decode: 'address',
|
|
171
|
+
category: 'access',
|
|
172
|
+
severity: 'critical',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'addressProviderOwner',
|
|
176
|
+
description: 'Owner of PoolAddressesProvider — can replace all core contracts',
|
|
177
|
+
contract: 'PoolAddressesProvider',
|
|
178
|
+
functionName: 'owner',
|
|
179
|
+
abi: addressProviderAbi,
|
|
180
|
+
decode: 'address',
|
|
181
|
+
category: 'access',
|
|
182
|
+
severity: 'critical',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'fallbackOracle',
|
|
186
|
+
description: 'Fallback oracle used when primary source fails',
|
|
187
|
+
contract: 'AaveOracle',
|
|
188
|
+
functionName: 'getFallbackOracle',
|
|
189
|
+
abi: oracleAbi,
|
|
190
|
+
decode: 'address',
|
|
191
|
+
category: 'config',
|
|
192
|
+
severity: 'warning',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'baseCurrency',
|
|
196
|
+
description: 'Base currency for price quotes',
|
|
197
|
+
contract: 'AaveOracle',
|
|
198
|
+
functionName: 'BASE_CURRENCY',
|
|
199
|
+
abi: oracleAbi,
|
|
200
|
+
decode: 'address',
|
|
201
|
+
category: 'config',
|
|
202
|
+
severity: 'warning',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'baseCurrencyUnit',
|
|
206
|
+
description: 'Base currency unit (decimals)',
|
|
207
|
+
contract: 'AaveOracle',
|
|
208
|
+
functionName: 'BASE_CURRENCY_UNIT',
|
|
209
|
+
abi: oracleAbi,
|
|
210
|
+
decode: 'uint',
|
|
211
|
+
category: 'config',
|
|
212
|
+
severity: 'info',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
|
|
216
|
+
access: [
|
|
217
|
+
{
|
|
218
|
+
role: 'AddressesProvider Owner',
|
|
219
|
+
description: 'Can replace Pool, Configurator, Oracle, ACLManager — god key',
|
|
220
|
+
contract: 'PoolAddressesProvider',
|
|
221
|
+
functionName: 'owner',
|
|
222
|
+
abi: ownerAbi,
|
|
223
|
+
severity: 'critical',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
role: 'ACL Admin',
|
|
227
|
+
description: 'Can grant/revoke PoolAdmin, EmergencyAdmin, RiskAdmin roles',
|
|
228
|
+
contract: 'PoolAddressesProvider',
|
|
229
|
+
functionName: 'getACLAdmin',
|
|
230
|
+
abi: addressProviderAbi,
|
|
231
|
+
severity: 'critical',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
role: 'Oracle Owner',
|
|
235
|
+
description: 'Can change price feed sources — oracle manipulation vector',
|
|
236
|
+
contract: 'AaveOracle',
|
|
237
|
+
functionName: 'owner',
|
|
238
|
+
abi: ownerAbi,
|
|
239
|
+
severity: 'critical',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { parseAbi } from 'viem';
|
|
2
|
+
import type { ProtocolDef } from './schema.js';
|
|
3
|
+
|
|
4
|
+
const cometAbi = parseAbi([
|
|
5
|
+
'function governor() view returns (address)',
|
|
6
|
+
'function pauseGuardian() view returns (address)',
|
|
7
|
+
'function baseToken() view returns (address)',
|
|
8
|
+
'function baseTokenPriceFeed() view returns (address)',
|
|
9
|
+
'function extensionDelegate() view returns (address)',
|
|
10
|
+
'function supplyKink() view returns (uint256)',
|
|
11
|
+
'function supplyPerSecondInterestRateSlopeLow() view returns (uint256)',
|
|
12
|
+
'function supplyPerSecondInterestRateSlopeHigh() view returns (uint256)',
|
|
13
|
+
'function supplyPerSecondInterestRateBase() view returns (uint256)',
|
|
14
|
+
'function borrowKink() view returns (uint256)',
|
|
15
|
+
'function borrowPerSecondInterestRateSlopeLow() view returns (uint256)',
|
|
16
|
+
'function borrowPerSecondInterestRateSlopeHigh() view returns (uint256)',
|
|
17
|
+
'function borrowPerSecondInterestRateBase() view returns (uint256)',
|
|
18
|
+
'function storeFrontPriceFactor() view returns (uint256)',
|
|
19
|
+
'function baseTrackingSupplySpeed() view returns (uint256)',
|
|
20
|
+
'function baseTrackingBorrowSpeed() view returns (uint256)',
|
|
21
|
+
'function baseMinForRewards() view returns (uint256)',
|
|
22
|
+
'function baseBorrowMin() view returns (uint256)',
|
|
23
|
+
'function targetReserves() view returns (uint256)',
|
|
24
|
+
'function totalSupply() view returns (uint256)',
|
|
25
|
+
'function totalBorrow() view returns (uint256)',
|
|
26
|
+
'function isSupplyPaused() view returns (bool)',
|
|
27
|
+
'function isTransferPaused() view returns (bool)',
|
|
28
|
+
'function isWithdrawPaused() view returns (bool)',
|
|
29
|
+
'function isAbsorbPaused() view returns (bool)',
|
|
30
|
+
'function isBuyPaused() view returns (bool)',
|
|
31
|
+
'function numAssets() view returns (uint8)',
|
|
32
|
+
'function getAssetInfo(uint8 i) view returns ((uint8 offset, address asset, address priceFeed, uint64 scale, uint64 borrowCollateralFactor, uint64 liquidateCollateralFactor, uint64 liquidationFactor, uint128 supplyCap))',
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
const configuratorAbi = parseAbi([
|
|
36
|
+
'function governor() view returns (address)',
|
|
37
|
+
'function factory() view returns (address)',
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
const ownerAbi = parseAbi([
|
|
41
|
+
'function owner() view returns (address)',
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
export const compoundV3: ProtocolDef = {
|
|
45
|
+
id: 'compound-v3',
|
|
46
|
+
name: 'Compound V3 (Comet)',
|
|
47
|
+
version: '3.0',
|
|
48
|
+
website: 'https://compound.finance',
|
|
49
|
+
description: 'Algorithmic money market protocol',
|
|
50
|
+
|
|
51
|
+
contracts: {
|
|
52
|
+
CometUSDC: { name: 'Comet USDC', role: 'Main USDC lending market', type: 'proxy' },
|
|
53
|
+
CometWETH: { name: 'Comet WETH', role: 'Main WETH lending market', type: 'proxy' },
|
|
54
|
+
Configurator: { name: 'Configurator', role: 'Protocol configuration manager', type: 'proxy' },
|
|
55
|
+
Timelock: { name: 'Timelock', role: 'Governance timelock', type: 'raw' },
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
deployments: {
|
|
59
|
+
ethereum: {
|
|
60
|
+
CometUSDC: '0xc3d688B66703497DAA19211EEdff47f25384cdc3',
|
|
61
|
+
CometWETH: '0xA17581A9E3356d9A858b789D68B4d866e593aE94',
|
|
62
|
+
Configurator: '0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3',
|
|
63
|
+
Timelock: '0x6d903f6003cca6255D85CcA4D3B5E5146dC33925',
|
|
64
|
+
},
|
|
65
|
+
arbitrum: {
|
|
66
|
+
CometUSDC: '0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA',
|
|
67
|
+
CometWETH: '0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf',
|
|
68
|
+
Configurator: '0xb21b06D71c75973babdE35b49fFDAc3F82Ad3775',
|
|
69
|
+
Timelock: '0x3fB4d38ea7EC20D91c150F5e41C5a4652c6AE4AA',
|
|
70
|
+
},
|
|
71
|
+
base: {
|
|
72
|
+
CometUSDC: '0xb125E6687d4313864e53df431d5425969c15Eb2F',
|
|
73
|
+
CometWETH: '0x46e6b214b524310239732D51387075E0e70970bf',
|
|
74
|
+
Configurator: '0x45939657d1CA34A8FA39A924B71D28Fe8431e581',
|
|
75
|
+
Timelock: '0xCC3E7c85Bb0EE4f09380e041fee95a0caeDD4a02',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
params: [
|
|
80
|
+
{
|
|
81
|
+
name: 'governor',
|
|
82
|
+
description: 'Protocol governor — can change all parameters',
|
|
83
|
+
contract: 'CometUSDC',
|
|
84
|
+
functionName: 'governor',
|
|
85
|
+
abi: cometAbi,
|
|
86
|
+
decode: 'address',
|
|
87
|
+
category: 'access',
|
|
88
|
+
severity: 'critical',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'pauseGuardian',
|
|
92
|
+
description: 'Can pause supply/withdraw/transfer/absorb/buy',
|
|
93
|
+
contract: 'CometUSDC',
|
|
94
|
+
functionName: 'pauseGuardian',
|
|
95
|
+
abi: cometAbi,
|
|
96
|
+
decode: 'address',
|
|
97
|
+
category: 'access',
|
|
98
|
+
severity: 'critical',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'baseToken',
|
|
102
|
+
description: 'Base token for this Comet market',
|
|
103
|
+
contract: 'CometUSDC',
|
|
104
|
+
functionName: 'baseToken',
|
|
105
|
+
abi: cometAbi,
|
|
106
|
+
decode: 'address',
|
|
107
|
+
category: 'config',
|
|
108
|
+
severity: 'critical',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'baseTokenPriceFeed',
|
|
112
|
+
description: 'Price feed for base token',
|
|
113
|
+
contract: 'CometUSDC',
|
|
114
|
+
functionName: 'baseTokenPriceFeed',
|
|
115
|
+
abi: cometAbi,
|
|
116
|
+
decode: 'address',
|
|
117
|
+
category: 'config',
|
|
118
|
+
severity: 'critical',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'supplyKink',
|
|
122
|
+
description: 'Utilization rate kink point for supply rate',
|
|
123
|
+
contract: 'CometUSDC',
|
|
124
|
+
functionName: 'supplyKink',
|
|
125
|
+
abi: cometAbi,
|
|
126
|
+
decode: 'wad',
|
|
127
|
+
category: 'rate',
|
|
128
|
+
severity: 'warning',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'borrowKink',
|
|
132
|
+
description: 'Utilization rate kink point for borrow rate',
|
|
133
|
+
contract: 'CometUSDC',
|
|
134
|
+
functionName: 'borrowKink',
|
|
135
|
+
abi: cometAbi,
|
|
136
|
+
decode: 'wad',
|
|
137
|
+
category: 'rate',
|
|
138
|
+
severity: 'warning',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'targetReserves',
|
|
142
|
+
description: 'Target reserve amount',
|
|
143
|
+
contract: 'CometUSDC',
|
|
144
|
+
functionName: 'targetReserves',
|
|
145
|
+
abi: cometAbi,
|
|
146
|
+
decode: 'uint',
|
|
147
|
+
category: 'config',
|
|
148
|
+
severity: 'warning',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'isSupplyPaused',
|
|
152
|
+
description: 'Whether supply operations are paused',
|
|
153
|
+
contract: 'CometUSDC',
|
|
154
|
+
functionName: 'isSupplyPaused',
|
|
155
|
+
abi: cometAbi,
|
|
156
|
+
decode: 'bool',
|
|
157
|
+
category: 'state',
|
|
158
|
+
severity: 'critical',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'isWithdrawPaused',
|
|
162
|
+
description: 'Whether withdraw operations are paused',
|
|
163
|
+
contract: 'CometUSDC',
|
|
164
|
+
functionName: 'isWithdrawPaused',
|
|
165
|
+
abi: cometAbi,
|
|
166
|
+
decode: 'bool',
|
|
167
|
+
category: 'state',
|
|
168
|
+
severity: 'critical',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'isTransferPaused',
|
|
172
|
+
description: 'Whether transfer operations are paused',
|
|
173
|
+
contract: 'CometUSDC',
|
|
174
|
+
functionName: 'isTransferPaused',
|
|
175
|
+
abi: cometAbi,
|
|
176
|
+
decode: 'bool',
|
|
177
|
+
category: 'state',
|
|
178
|
+
severity: 'warning',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'totalSupply',
|
|
182
|
+
description: 'Total supplied amount',
|
|
183
|
+
contract: 'CometUSDC',
|
|
184
|
+
functionName: 'totalSupply',
|
|
185
|
+
abi: cometAbi,
|
|
186
|
+
decode: 'uint',
|
|
187
|
+
category: 'state',
|
|
188
|
+
severity: 'info',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'totalBorrow',
|
|
192
|
+
description: 'Total borrowed amount',
|
|
193
|
+
contract: 'CometUSDC',
|
|
194
|
+
functionName: 'totalBorrow',
|
|
195
|
+
abi: cometAbi,
|
|
196
|
+
decode: 'uint',
|
|
197
|
+
category: 'state',
|
|
198
|
+
severity: 'info',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'numAssets',
|
|
202
|
+
description: 'Number of collateral assets',
|
|
203
|
+
contract: 'CometUSDC',
|
|
204
|
+
functionName: 'numAssets',
|
|
205
|
+
abi: cometAbi,
|
|
206
|
+
decode: 'uint',
|
|
207
|
+
category: 'config',
|
|
208
|
+
severity: 'info',
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
|
|
212
|
+
access: [
|
|
213
|
+
{
|
|
214
|
+
role: 'Governor',
|
|
215
|
+
description: 'Full control — can change all parameters, pause, upgrade',
|
|
216
|
+
contract: 'CometUSDC',
|
|
217
|
+
functionName: 'governor',
|
|
218
|
+
abi: cometAbi,
|
|
219
|
+
severity: 'critical',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
role: 'Pause Guardian',
|
|
223
|
+
description: 'Can pause supply/withdraw/transfer/absorb/buy operations',
|
|
224
|
+
contract: 'CometUSDC',
|
|
225
|
+
functionName: 'pauseGuardian',
|
|
226
|
+
abi: cometAbi,
|
|
227
|
+
severity: 'critical',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
role: 'Configurator Governor',
|
|
231
|
+
description: 'Can update Comet market configurations',
|
|
232
|
+
contract: 'Configurator',
|
|
233
|
+
functionName: 'governor',
|
|
234
|
+
abi: configuratorAbi,
|
|
235
|
+
severity: 'critical',
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { parseAbi } from 'viem';
|
|
2
|
+
import type { ProtocolDef } from './schema.js';
|
|
3
|
+
|
|
4
|
+
const strategyManagerAbi = parseAbi([
|
|
5
|
+
'function owner() view returns (address)',
|
|
6
|
+
'function paused() view returns (uint256)',
|
|
7
|
+
'function strategyWhitelister() view returns (address)',
|
|
8
|
+
]);
|
|
9
|
+
|
|
10
|
+
const delegationManagerAbi = parseAbi([
|
|
11
|
+
'function owner() view returns (address)',
|
|
12
|
+
'function paused() view returns (uint256)',
|
|
13
|
+
'function minWithdrawalDelayBlocks() view returns (uint256)',
|
|
14
|
+
'function domainSeparator() view returns (bytes32)',
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const eigenPodManagerAbi = parseAbi([
|
|
18
|
+
'function owner() view returns (address)',
|
|
19
|
+
'function paused() view returns (uint256)',
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const slasherAbi = parseAbi([
|
|
23
|
+
'function owner() view returns (address)',
|
|
24
|
+
'function paused() view returns (uint256)',
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
const avsDirectoryAbi = parseAbi([
|
|
28
|
+
'function owner() view returns (address)',
|
|
29
|
+
'function paused() view returns (uint256)',
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
const rewardsCoordinatorAbi = parseAbi([
|
|
33
|
+
'function owner() view returns (address)',
|
|
34
|
+
'function paused() view returns (uint256)',
|
|
35
|
+
'function activationDelay() view returns (uint32)',
|
|
36
|
+
'function currRewardsCalculationEndTimestamp() view returns (uint32)',
|
|
37
|
+
'function rewardsUpdater() view returns (address)',
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
export const eigenLayer: ProtocolDef = {
|
|
41
|
+
id: 'eigenlayer',
|
|
42
|
+
name: 'EigenLayer',
|
|
43
|
+
version: '1.0',
|
|
44
|
+
website: 'https://eigenlayer.xyz',
|
|
45
|
+
description: 'Restaking protocol for Ethereum shared security',
|
|
46
|
+
|
|
47
|
+
contracts: {
|
|
48
|
+
StrategyManager: { name: 'StrategyManager', role: 'Manages staking strategies and deposits', type: 'proxy' },
|
|
49
|
+
DelegationManager: { name: 'DelegationManager', role: 'Manages operator delegation and withdrawals', type: 'proxy' },
|
|
50
|
+
EigenPodManager: { name: 'EigenPodManager', role: 'Manages native ETH restaking pods', type: 'proxy' },
|
|
51
|
+
Slasher: { name: 'Slasher', role: 'Handles slashing conditions', type: 'proxy' },
|
|
52
|
+
AVSDirectory: { name: 'AVSDirectory', role: 'Registry of Actively Validated Services', type: 'proxy' },
|
|
53
|
+
RewardsCoordinator: { name: 'RewardsCoordinator', role: 'Distributes rewards to operators/stakers', type: 'proxy' },
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
deployments: {
|
|
57
|
+
ethereum: {
|
|
58
|
+
StrategyManager: '0x858646372CC42E1A627fcE94aa7A7033e7CF075A',
|
|
59
|
+
DelegationManager: '0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A',
|
|
60
|
+
EigenPodManager: '0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338',
|
|
61
|
+
Slasher: '0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd',
|
|
62
|
+
AVSDirectory: '0x135DDa560e946695d6f155dACaFC6f1F25C1F5AF',
|
|
63
|
+
RewardsCoordinator: '0x7750d328b314EfFa365A0402CcfD489B80B0adda',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
params: [
|
|
68
|
+
{
|
|
69
|
+
name: 'strategyManagerPaused',
|
|
70
|
+
description: 'Pause state bitmap (0=unpaused, non-zero=paused operations)',
|
|
71
|
+
contract: 'StrategyManager',
|
|
72
|
+
functionName: 'paused',
|
|
73
|
+
abi: strategyManagerAbi,
|
|
74
|
+
decode: 'uint',
|
|
75
|
+
category: 'state',
|
|
76
|
+
severity: 'critical',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'strategyWhitelister',
|
|
80
|
+
description: 'Address authorized to whitelist new strategies',
|
|
81
|
+
contract: 'StrategyManager',
|
|
82
|
+
functionName: 'strategyWhitelister',
|
|
83
|
+
abi: strategyManagerAbi,
|
|
84
|
+
decode: 'address',
|
|
85
|
+
category: 'access',
|
|
86
|
+
severity: 'critical',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'delegationPaused',
|
|
90
|
+
description: 'Delegation manager pause state',
|
|
91
|
+
contract: 'DelegationManager',
|
|
92
|
+
functionName: 'paused',
|
|
93
|
+
abi: delegationManagerAbi,
|
|
94
|
+
decode: 'uint',
|
|
95
|
+
category: 'state',
|
|
96
|
+
severity: 'critical',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'minWithdrawalDelayBlocks',
|
|
100
|
+
description: 'Minimum blocks to wait for withdrawal completion',
|
|
101
|
+
contract: 'DelegationManager',
|
|
102
|
+
functionName: 'minWithdrawalDelayBlocks',
|
|
103
|
+
abi: delegationManagerAbi,
|
|
104
|
+
decode: 'uint',
|
|
105
|
+
category: 'config',
|
|
106
|
+
severity: 'warning',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'eigenPodPaused',
|
|
110
|
+
description: 'EigenPod manager pause state',
|
|
111
|
+
contract: 'EigenPodManager',
|
|
112
|
+
functionName: 'paused',
|
|
113
|
+
abi: eigenPodManagerAbi,
|
|
114
|
+
decode: 'uint',
|
|
115
|
+
category: 'state',
|
|
116
|
+
severity: 'critical',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'rewardsUpdater',
|
|
120
|
+
description: 'Address authorized to submit reward merkle roots',
|
|
121
|
+
contract: 'RewardsCoordinator',
|
|
122
|
+
functionName: 'rewardsUpdater',
|
|
123
|
+
abi: rewardsCoordinatorAbi,
|
|
124
|
+
decode: 'address',
|
|
125
|
+
category: 'access',
|
|
126
|
+
severity: 'critical',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'rewardsActivationDelay',
|
|
130
|
+
description: 'Delay before new rewards become claimable',
|
|
131
|
+
contract: 'RewardsCoordinator',
|
|
132
|
+
functionName: 'activationDelay',
|
|
133
|
+
abi: rewardsCoordinatorAbi,
|
|
134
|
+
decode: 'uint',
|
|
135
|
+
category: 'config',
|
|
136
|
+
severity: 'warning',
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
|
|
140
|
+
access: [
|
|
141
|
+
{
|
|
142
|
+
role: 'StrategyManager Owner',
|
|
143
|
+
description: 'Can pause, unpause, add/remove strategies',
|
|
144
|
+
contract: 'StrategyManager',
|
|
145
|
+
functionName: 'owner',
|
|
146
|
+
abi: strategyManagerAbi,
|
|
147
|
+
severity: 'critical',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
role: 'DelegationManager Owner',
|
|
151
|
+
description: 'Can pause delegation, modify withdrawal delays',
|
|
152
|
+
contract: 'DelegationManager',
|
|
153
|
+
functionName: 'owner',
|
|
154
|
+
abi: delegationManagerAbi,
|
|
155
|
+
severity: 'critical',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
role: 'EigenPodManager Owner',
|
|
159
|
+
description: 'Controls native ETH restaking pod creation',
|
|
160
|
+
contract: 'EigenPodManager',
|
|
161
|
+
functionName: 'owner',
|
|
162
|
+
abi: eigenPodManagerAbi,
|
|
163
|
+
severity: 'critical',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
role: 'Slasher Owner',
|
|
167
|
+
description: 'Controls slashing parameters',
|
|
168
|
+
contract: 'Slasher',
|
|
169
|
+
functionName: 'owner',
|
|
170
|
+
abi: slasherAbi,
|
|
171
|
+
severity: 'critical',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
role: 'AVSDirectory Owner',
|
|
175
|
+
description: 'Controls AVS registration',
|
|
176
|
+
contract: 'AVSDirectory',
|
|
177
|
+
functionName: 'owner',
|
|
178
|
+
abi: avsDirectoryAbi,
|
|
179
|
+
severity: 'critical',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
role: 'RewardsCoordinator Owner',
|
|
183
|
+
description: 'Controls reward distribution parameters',
|
|
184
|
+
contract: 'RewardsCoordinator',
|
|
185
|
+
functionName: 'owner',
|
|
186
|
+
abi: rewardsCoordinatorAbi,
|
|
187
|
+
severity: 'critical',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
};
|