Skip to content

Commit fb11d94

Browse files
authored
feat: v3.2.0 upgrade (#596)
* feat: v3.2.0 upgrade * fix: update origin * feat: upgrade to 3.2.0 * fix: update to support v3.2.0 * fix: patch tokenlist * fix: update to use main * fix: update addresses after execution * fix: add weth gateway v3.2 * fix: add scroll * fix: add mainnet ones * fix: add gnosis * fix: add bnb weth gateway * fix: add avalanche * fix: add polygon * fix: update generated addresses
1 parent 6e9e12a commit fb11d94

File tree

88 files changed

+2545
-3995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+2545
-3995
lines changed

lib/aave-v3-origin

Submodule aave-v3-origin updated 693 files

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"tsup": "^8.0.2",
6565
"tsx": "^4.7.1",
6666
"typescript": "^5.4.2",
67-
"viem": "^2.8.5"
67+
"viem": "^2.21.19"
6868
},
6969
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
7070
}

safe.csv

Lines changed: 408 additions & 658 deletions
Large diffs are not rendered by default.

scripts/checks/stataFactory.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';
21
import {getContract} from 'viem';
3-
import {IStaticATokenFactory_ABI} from '../../src/ts/AaveAddressBook';
2+
import {CHAIN_ID_CLIENT_MAP} from '../clients';
43

54
export async function check(addresses: Record<string, any>) {
65
if (addresses.STATIC_A_TOKEN_FACTORY) {

scripts/clients.ts

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
import {HttpTransportConfig, createClient, http} from 'viem';
2+
import {
3+
mainnet,
4+
arbitrum,
5+
polygon,
6+
optimism,
7+
metis,
8+
base,
9+
baseSepolia,
10+
sepolia,
11+
goerli,
12+
bsc,
13+
avalanche,
14+
gnosis,
15+
polygonZkEvm,
16+
scroll,
17+
celo,
18+
zkSync,
19+
avalancheFuji,
20+
polygonMumbai,
21+
arbitrumGoerli,
22+
optimismGoerli,
23+
optimismSepolia,
24+
scrollSepolia,
25+
arbitrumSepolia,
26+
// deprecated
27+
harmonyOne,
28+
fantomTestnet,
29+
fantom,
30+
} from 'viem/chains';
31+
import {Client} from 'viem';
32+
import {ChainId} from '@bgd-labs/js-utils';
33+
34+
const commonConfig: HttpTransportConfig = {timeout: 30_000, batch: true};
35+
const batchConfig = {batch: {multicall: true}};
36+
37+
export const mainnetClient = createClient({
38+
chain: mainnet,
39+
transport: http(process.env.RPC_MAINNET, commonConfig),
40+
...batchConfig,
41+
});
42+
43+
export const arbitrumClient = createClient({
44+
chain: arbitrum,
45+
transport: http(process.env.RPC_ARBITRUM, commonConfig),
46+
...batchConfig,
47+
});
48+
49+
export const polygonClient = createClient({
50+
chain: polygon,
51+
transport: http(process.env.RPC_POLYGON, commonConfig),
52+
...batchConfig,
53+
});
54+
55+
export const optimismClient = createClient({
56+
chain: optimism,
57+
transport: http(process.env.RPC_OPTIMISM, commonConfig),
58+
...batchConfig,
59+
});
60+
61+
export const metisClient = createClient({
62+
chain: metis,
63+
transport: http(process.env.RPC_METIS, commonConfig),
64+
...batchConfig,
65+
});
66+
67+
export const baseClient = createClient({
68+
chain: base,
69+
transport: http(process.env.RPC_BASE, commonConfig),
70+
...batchConfig,
71+
});
72+
73+
export const bnbClient = createClient({
74+
chain: bsc,
75+
transport: http(process.env.RPC_BNB, commonConfig),
76+
...batchConfig,
77+
});
78+
79+
export const avalancheClient = createClient({
80+
chain: avalanche,
81+
transport: http(process.env.RPC_AVALANCHE, commonConfig),
82+
...batchConfig,
83+
});
84+
85+
export const gnosisClient = createClient({
86+
chain: gnosis,
87+
transport: http(process.env.RPC_GNOSIS, commonConfig),
88+
...batchConfig,
89+
});
90+
91+
export const scrollClient = createClient({
92+
chain: scroll,
93+
transport: http(process.env.RPC_SCROLL, commonConfig),
94+
...batchConfig,
95+
});
96+
97+
export const zkEVMClient = createClient({
98+
chain: polygonZkEvm,
99+
transport: http(process.env.RPC_ZKEVM, commonConfig),
100+
...batchConfig,
101+
});
102+
103+
export const celoClient = createClient({
104+
chain: celo,
105+
transport: http(process.env.RPC_CELO, commonConfig),
106+
...batchConfig,
107+
});
108+
109+
export const zkSyncClient = createClient({
110+
chain: zkSync,
111+
transport: http(process.env.RPC_ZKSYNC, commonConfig),
112+
...batchConfig,
113+
});
114+
115+
// testnets
116+
export const fujiClient = createClient({
117+
chain: avalancheFuji,
118+
transport: http(process.env.RPC_FUJI, commonConfig),
119+
...batchConfig,
120+
});
121+
122+
export const mumbaiClient = createClient({
123+
chain: polygonMumbai,
124+
transport: http(process.env.RPC_MUMBAI, commonConfig),
125+
...batchConfig,
126+
});
127+
128+
export const sepoliaClient = createClient({
129+
chain: sepolia,
130+
transport: http(process.env.RPC_SEPOLIA, commonConfig),
131+
...batchConfig,
132+
});
133+
134+
export const goerliClient = createClient({
135+
chain: goerli,
136+
transport: http(process.env.RPC_GOERLI, commonConfig),
137+
...batchConfig,
138+
});
139+
140+
export const arbitrumGoerliClient = createClient({
141+
chain: arbitrumGoerli,
142+
transport: http(process.env.RPC_ARBITRUM_GOERLI, commonConfig),
143+
...batchConfig,
144+
});
145+
146+
export const arbitrumSepoliaClient = createClient({
147+
chain: arbitrumSepolia,
148+
transport: http(process.env.RPC_ARBITRUM_SEPOLIA, commonConfig),
149+
...batchConfig,
150+
});
151+
152+
export const optimismGoerliClient = createClient({
153+
chain: optimismGoerli,
154+
transport: http(process.env.RPC_OPTIMISM_GOERLI, commonConfig),
155+
...batchConfig,
156+
});
157+
158+
export const optimismSepoliaClient = createClient({
159+
chain: optimismSepolia,
160+
transport: http(process.env.RPC_OPTIMISM_SEPOLIA, commonConfig),
161+
...batchConfig,
162+
});
163+
164+
export const scrollSepoliaClient = createClient({
165+
chain: scrollSepolia,
166+
transport: http(process.env.RPC_SCROLL_SEPOLIA, commonConfig),
167+
...batchConfig,
168+
});
169+
170+
export const baseSepoliaClient = createClient({
171+
chain: baseSepolia,
172+
transport: http(process.env.RPC_BASE_SEPOLIA, commonConfig),
173+
...batchConfig,
174+
});
175+
176+
// deprecated
177+
178+
export const fantomTestnetClient = createClient({
179+
chain: fantomTestnet,
180+
transport: http(process.env.RPC_FANTOM_TESTNET, commonConfig),
181+
...batchConfig,
182+
});
183+
184+
export const fantomClient = createClient({
185+
chain: fantomTestnet,
186+
transport: http(process.env.RPC_FANTOM, commonConfig),
187+
...batchConfig,
188+
});
189+
190+
export const harmonyClient = createClient({
191+
chain: harmonyOne,
192+
transport: http(process.env.RPC_HARMONY, commonConfig),
193+
...batchConfig,
194+
});
195+
196+
export const CHAIN_ID_CLIENT_MAP: Record<number, Client> = {
197+
[ChainId.mainnet]: mainnetClient,
198+
[ChainId.arbitrum_one]: arbitrumClient,
199+
[ChainId.arbitrum_goerli]: arbitrumGoerliClient,
200+
[ChainId.arbitrum_sepolia]: arbitrumSepoliaClient,
201+
[ChainId.polygon]: polygonClient,
202+
[ChainId.optimism]: optimismClient,
203+
[ChainId.optimism_goerli]: optimismGoerliClient,
204+
[ChainId.optimism_sepolia]: optimismSepoliaClient,
205+
[ChainId.metis]: metisClient,
206+
[ChainId.base]: baseClient,
207+
[ChainId.base_sepolia]: baseSepoliaClient,
208+
[ChainId.sepolia]: sepoliaClient,
209+
[ChainId.goerli]: goerliClient,
210+
[ChainId.bnb]: bnbClient,
211+
[ChainId.avalanche]: avalancheClient,
212+
[ChainId.gnosis]: gnosisClient,
213+
[ChainId.scroll]: scrollClient,
214+
[ChainId.scroll_sepolia]: scrollSepoliaClient,
215+
[ChainId.zkEVM]: zkEVMClient,
216+
[ChainId.celo]: celoClient,
217+
[ChainId.zkSync]: zkSyncClient,
218+
[ChainId.fuji]: fujiClient,
219+
[ChainId.mumbai]: mumbaiClient,
220+
// deprecated
221+
[ChainId.harmony]: harmonyClient,
222+
[ChainId.fantom]: fantomClient,
223+
[ChainId.fantom_testnet]: fantomTestnetClient,
224+
} as const;

scripts/configs/abis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export const ABI_INTERFACES = [
1616
'IGovernancePowerStrategy',
1717
'IDataWarehouse',
1818
'IExecutorWithTimelock',
19-
'lib/aave-v3-origin/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol:IERC20',
19+
'lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol:IERC20',
2020
'IERC20Detailed',
2121
'IAToken',
2222
'IDefaultInterestRateStrategy',
23-
'lib/aave-v3-origin/src/core/contracts/interfaces/IAaveOracle.sol:IAaveOracle',
23+
'lib/aave-v3-origin/src/contracts/interfaces/IAaveOracle.sol:IAaveOracle',
2424
'IExecutor',
2525
'ICrossChainController',
2626
'IWithGuardian',

scripts/configs/pools/arbitrum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const arbitrumProtoV3: PoolConfig = {
2121
UI_INCENTIVE_DATA_PROVIDER: '0xDA67AF3403555Ce0AE3ffC22fDb7354458277358',
2222
UI_POOL_DATA_PROVIDER: '0x5d4d4007a4c6336550ddaa2a7c0d5e7972eebd16',
2323
WALLET_BALANCE_PROVIDER: '0xBc790382B3686abffE4be14A030A96aC6154023a',
24-
WETH_GATEWAY: '0xecD4bd3121F9FD604ffaC631bF6d41ec12f1fafb',
24+
WETH_GATEWAY: '0x5760E34c4003752329bC77790B1De44C2799F8C3',
2525
WITHDRAW_SWAP_ADAPTER: '0x5598BbFA2f4fE8151f45bBA0a3edE1b54B51a0a9',
2626
},
2727
};

scripts/configs/pools/avalanche.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ export const fujiProtoV3: PoolConfig = {
2222
additionalAddresses: {
2323
CONFIG_ENGINE: '0x4058FE01Aa090E0841F4E08f79D2607C4861142E',
2424
POOL_ADDRESSES_PROVIDER_REGISTRY: '0x9E7DF170E44093d6738057157CA048794B02555d',
25-
STATIC_A_TOKEN_FACTORY: '0xc344A904BFd1E11AD58a18847940637C35f28ce4',
25+
STATA_FACTORY: '0xc344A904BFd1E11AD58a18847940637C35f28ce4',
2626
UI_INCENTIVE_DATA_PROVIDER: '0x9Ba30437Ba63AA2902319DE1B3f0E25a18826842',
2727
// UI_POOL_DATA_PROVIDER: '0x67F521ca716dD9413fd2D2AfdEbEE9285289d2cB',
2828
WALLET_BALANCE_PROVIDER: '0x43fAE24bd7eA952B4000Ea3A2e0D8B50CA64EBbA',
29-
WETH_GATEWAY: '0x3d2ee1AB8C3a597cDf80273C684dE0036481bE3a'
29+
WETH_GATEWAY: '0x3d2ee1AB8C3a597cDf80273C684dE0036481bE3a',
3030
},
3131
};
3232

@@ -70,7 +70,7 @@ export const avalancheProtoV3: PoolConfig = {
7070
UI_INCENTIVE_DATA_PROVIDER: '0x265d414f80b0fca9505710e6F16dB4b67555D365',
7171
UI_POOL_DATA_PROVIDER: '0x5598bbfa2f4fe8151f45bba0a3ede1b54b51a0a9',
7272
WALLET_BALANCE_PROVIDER: '0xBc790382B3686abffE4be14A030A96aC6154023a',
73-
WETH_GATEWAY: '0x2DeC8BCE3471eD65B1bB558Fa28439D45bF446d0',
73+
WETH_GATEWAY: '0xCf3045a03F83ADfBCbA1f19Cb2cF4E19075F8668',
7474
WITHDRAW_SWAP_ADAPTER: '0x78F8Bd884C3D738B74B420540659c82f392820e0',
7575
},
7676
};

scripts/configs/pools/base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const baseProtoV3: PoolConfig = {
2121
UI_INCENTIVE_DATA_PROVIDER: '0xEdD3b4737C1a0011626631a977b91Cf3E944982d',
2222
UI_POOL_DATA_PROVIDER: '0x5d4D4007A4c6336550DdAa2a7c0d5e7972eebd16',
2323
WALLET_BALANCE_PROVIDER: '0x5779b29B0a34577d927E8D511B595ef9abbFAE82',
24-
WETH_GATEWAY: '0x8be473dCfA93132658821E67CbEB684ec8Ea2E74',
24+
WETH_GATEWAY: '0x729b3EA8C005AbC58c9150fb57Ec161296F06766',
2525
},
2626
};
2727

@@ -30,14 +30,14 @@ export const baseSepoliaProtoV3: PoolConfig = {
3030
chainId: ChainId.base_sepolia,
3131
POOL_ADDRESSES_PROVIDER: '0x150E9a8b83b731B9218a5633F1E804BC82508A46',
3232
additionalAddresses: {
33-
STATIC_A_TOKEN_FACTORY: '0xAE252DA024783d1813C890d82642bbED120c3093',
33+
STATA_FACTORY: '0xAE252DA024783d1813C890d82642bbED120c3093',
3434
CONFIG_ENGINE: '0x3d2ee1AB8C3a597cDf80273C684dE0036481bE3a',
3535
L2_ENCODER: '0x0ffE481FBF0AE2282A5E1f701fab266aF487A97D',
3636
POOL_ADDRESSES_PROVIDER_REGISTRY: '0x5A6c2685b9dd22705203C99d7Fc30AE53C4c7513',
3737
UI_INCENTIVE_DATA_PROVIDER: '0xb0633e01310a09C1Ee71a96c057DcF9c13fd6F62',
3838
// UI_POOL_DATA_PROVIDER: '0x2D2F3e3884e112e555A9Ae213B9781Ca8aFE3b88',
3939
WALLET_BALANCE_PROVIDER: '0xdc5D225Df17df184d11015B91C4A10cd7834e2aC',
40-
WETH_GATEWAY: '0xd5DDE725b0A2dE43fBDb4E488A7fdA389210d461'
40+
WETH_GATEWAY: '0xd5DDE725b0A2dE43fBDb4E488A7fdA389210d461',
4141
},
4242
initial: {
4343
COLLECTOR: '0x67F521ca716dD9413fd2D2AfdEbEE9285289d2cB',

scripts/configs/pools/bnb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const bnbProtoV3: PoolConfig = {
1717
UI_INCENTIVE_DATA_PROVIDER: '0x1236010CECea55998384e795B59815D871f5f94d',
1818
UI_POOL_DATA_PROVIDER: '0x78f8bd884c3d738b74b420540659c82f392820e0',
1919
WALLET_BALANCE_PROVIDER: '0x36616cf17557639614c1cdDb356b1B83fc0B2132',
20-
WETH_GATEWAY: '0xd91d1331db4F436DaF47Ec9Dd86deCb8EEF946B4',
20+
WETH_GATEWAY: '0xe63eAf6DAb1045689BD3a332bC596FfcF54A5C88',
2121
WITHDRAW_SWAP_ADAPTER: '0x5E2d083417D12d4B0824E14Ecd48D26831F4Da7D',
2222
STATIC_A_TOKEN_FACTORY: '0x326aB0868bD279382Be2DF5E228Cb8AF38649AB4',
2323
},

0 commit comments

Comments
 (0)