Skip to content

Commit 2ea43ab

Browse files
committed
balancer added to migrations
1 parent 76b6bad commit 2ea43ab

File tree

2 files changed

+119
-136
lines changed

2 files changed

+119
-136
lines changed

migrations_scripts/1_deploy_registry_and_add_adapters.js

+61-68
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const AaveAssetAdapter = artifacts.require('AaveAssetAdapter');
22
const AaveDebtAdapter = artifacts.require('AaveDebtAdapter');
3+
const BalancerAdapter = artifacts.require('BalancerAdapter');
34
const CompoundAssetAdapter = artifacts.require('CompoundAssetAdapter');
45
const CompoundDebtAdapter = artifacts.require('CompoundDebtAdapter');
56
const CurveAdapter = artifacts.require('CurveAdapter');
@@ -18,6 +19,7 @@ const UniswapV1Adapter = artifacts.require('UniswapV1Adapter');
1819
const ZrxAdapter = artifacts.require('ZrxAdapter');
1920
const ERC20TokenAdapter = artifacts.require('ERC20TokenAdapter');
2021
const AaveTokenAdapter = artifacts.require('AaveTokenAdapter');
22+
const BalancerTokenAdapter = artifacts.require('BalancerTokenAdapter');
2123
const CompoundTokenAdapter = artifacts.require('CompoundTokenAdapter');
2224
const CurveTokenAdapter = artifacts.require('CurveTokenAdapter');
2325
const IdleTokenAdapter = artifacts.require('IdleTokenAdapter');
@@ -50,6 +52,7 @@ const tusdAddress = '0x0000000000085d4780B73119b644AE5ecd22b376';
5052
const usdcAddress = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
5153
const usdtAddress = '0xdAC17F958D2ee523a2206206994597C13D831ec7';
5254
const susdAddress = '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51';
55+
const busdAddress = '0x4Fabb145d64652a948d72533023f6E7A623C7C53';
5356
const lendAddress = '0x80fB784B7eD66730e8b1DBd9820aFD29931aab03';
5457
const batAddress = '0x0D8775F648430679A709E98d2b0Cb6250d2887EF';
5558
const ethAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
@@ -125,6 +128,7 @@ const aaveDebtAdapterTokens = [
125128
usdcAddress,
126129
usdtAddress,
127130
susdAddress,
131+
busdAddress,
128132
lendAddress,
129133
batAddress,
130134
ethAddress,
@@ -210,46 +214,14 @@ const synthetixAssetAdapterTokens = [
210214
const synthetixDebtAdapterTokens = [
211215
susdAddress,
212216
];
213-
const uniswapV1AdapterTokens = [ // top 30 pools
214-
'0xe9cf7887b93150d4f2da7dfc6d502b216438f244',
215-
'0x05cde89ccfa0ada8c88d5a23caaa79ef129e7883',
216-
'0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667',
217-
'0x97dec872013f6b5fb443861090ad931542878126',
218-
'0x2c4bd064b998838076fa341a83d007fc2fa50957',
219-
'0xa2881a90bf33f03e7a3f803765cd2ed5c8928dfb',
220-
'0x3958b4ec427f8fa24eb60f42821760e88d485f7f',
221-
'0x4d2f5cfba55ae412221182d8475bc85799a5644b',
222-
'0x2e642b8d59b45a1d8c5aef716a84ff44ea665914',
223-
'0xf173214c720f58e03e194085b1db28b50acdeead',
224-
'0x93a8515d674c3d3235beea0de7ae3099aa34b1a5',
225-
'0x49c4f9bc14884f6210f28342ced592a633801a8b',
226-
'0xf506828b166de88ca2edb2a98d960abba0d2402a',
227-
'0xb944d13b2f4047fc7bd3f7013bcf01b115fb260d',
228-
'0x077d52b047735976dfda76fef74d4d988ac25196',
229-
'0x80324ec8d64425b37f8603a97097da7d493dbc79',
230-
'0x09cabec1ead1c0ba254b09efb3ee13841712be14',
231-
'0xa539baaa3aca455c986bb1e25301cef936ce1b65',
232-
'0x3fb2f18065926ddb33e7571475c509541d15da0e',
233-
'0x48b04d2a05b6b604d8d5223fd1984f191ded51af',
234-
'0xffcf45b540e6c9f094ae656d2e34ad11cdfdb187',
235-
'0xb6cfbf322db47d39331e306005dc7e5e6549942b',
236-
'0x8de0d002dc83478f479dc31f76cb0a8aa7ccea17',
237-
'0x4e395304655f0796bc3bc63709db72173b9ddf98',
238-
'0xae76c84c9262cdb9abc0c2c8888e62db8e22a0bf',
239-
'0x43892992b0b102459e895b88601bb2c76736942c',
240-
'0xf79cb3bea83bd502737586a6e8b133c378fd1ff2',
241-
'0xd91ff16ef92568fc27f466c3c5613e43313ab1dc',
242-
'0x2bf5a5ba29e60682fc56b2fcf9ce07bef4f6196f',
243-
'0xe8e45431b93215566ba923a7e611b7342ea954df',
244-
];
245217
const zrxAdapterTokens = [
246218
zrxAddress,
247219
];
248220

249221
let protocolNames = [];
250222
let metadata = [];
251-
let adapters = [[], [], [], [], [], [], [], [], [], [], [], [], [], []];
252-
let tokens = [[], [], [], [], [], [], [], [], [], [], [], [], [], []];
223+
let adapters = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
224+
let tokens = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
253225
let tokenAdapters = [];
254226

255227
module.exports = async (deployer, network, accounts) => {
@@ -271,15 +243,28 @@ module.exports = async (deployer, network, accounts) => {
271243
'protocol-icons.s3.amazonaws.com/aave.png',
272244
'0',
273245
]);
246+
await deployer.deploy(BalancerAdapter, { from: accounts[0] })
247+
.then(() => {
248+
adapters[1].push(BalancerAdapter.address);
249+
tokens[1].push([]);
250+
});
251+
protocolNames.push('Balancer');
252+
metadata.push([
253+
'Balancer',
254+
'Non-custodial portfolio manager, liquidity provider, and price sensor',
255+
'pools.balancer.exchange',
256+
'protocol-icons.s3.amazonaws.com/balancer.png',
257+
'0',
258+
]);
274259
await deployer.deploy(CompoundAssetAdapter, { from: accounts[0] })
275260
.then(() => {
276-
adapters[1].push(CompoundAssetAdapter.address);
277-
tokens[1].push(compoundAssetAdapterTokens);
261+
adapters[2].push(CompoundAssetAdapter.address);
262+
tokens[2].push(compoundAssetAdapterTokens);
278263
});
279264
await deployer.deploy(CompoundDebtAdapter, { from: accounts[0] })
280265
.then(() => {
281-
adapters[1].push(CompoundDebtAdapter.address);
282-
tokens[1].push(compoundDebtAdapterTokens);
266+
adapters[2].push(CompoundDebtAdapter.address);
267+
tokens[2].push(compoundDebtAdapterTokens);
283268
});
284269
protocolNames.push('Compound');
285270
metadata.push([
@@ -291,8 +276,8 @@ module.exports = async (deployer, network, accounts) => {
291276
]);
292277
await deployer.deploy(CurveAdapter, { from: accounts[0] })
293278
.then(() => {
294-
adapters[2].push(CurveAdapter.address);
295-
tokens[2].push(curveAdapterTokens);
279+
adapters[3].push(CurveAdapter.address);
280+
tokens[3].push(curveAdapterTokens);
296281
});
297282
protocolNames.push('Curve');
298283
metadata.push([
@@ -304,13 +289,13 @@ module.exports = async (deployer, network, accounts) => {
304289
]);
305290
await deployer.deploy(DyDxAssetAdapter, { from: accounts[0] })
306291
.then(() => {
307-
adapters[3].push(DyDxAssetAdapter.address);
308-
tokens[3].push(dydxAdapterTokens);
292+
adapters[4].push(DyDxAssetAdapter.address);
293+
tokens[4].push(dydxAdapterTokens);
309294
});
310295
await deployer.deploy(DyDxDebtAdapter, { from: accounts[0] })
311296
.then(() => {
312-
adapters[3].push(DyDxDebtAdapter.address);
313-
tokens[3].push(dydxAdapterTokens);
297+
adapters[4].push(DyDxDebtAdapter.address);
298+
tokens[4].push(dydxAdapterTokens);
314299
});
315300
protocolNames.push('dYdX');
316301
metadata.push([
@@ -322,8 +307,8 @@ module.exports = async (deployer, network, accounts) => {
322307
]);
323308
await deployer.deploy(IdleAdapter, { from: accounts[0] })
324309
.then(() => {
325-
adapters[4].push(IdleAdapter.address);
326-
tokens[4].push(idleAdapterTokens);
310+
adapters[5].push(IdleAdapter.address);
311+
tokens[5].push(idleAdapterTokens);
327312
});
328313
protocolNames.push('Idle');
329314
metadata.push([
@@ -335,8 +320,8 @@ module.exports = async (deployer, network, accounts) => {
335320
]);
336321
await deployer.deploy(IearnAdapter, { from: accounts[0] })
337322
.then(() => {
338-
adapters[5].push(IearnAdapter.address);
339-
tokens[5].push(iearn2AdapterTokens);
323+
adapters[6].push(IearnAdapter.address);
324+
tokens[6].push(iearn2AdapterTokens);
340325
});
341326
protocolNames.push('iearn.finance (v2)');
342327
metadata.push([
@@ -348,8 +333,8 @@ module.exports = async (deployer, network, accounts) => {
348333
]);
349334
await deployer.deploy(IearnAdapter, { from: accounts[0] })
350335
.then(() => {
351-
adapters[6].push(IearnAdapter.address);
352-
tokens[6].push(iearn3AdapterTokens);
336+
adapters[7].push(IearnAdapter.address);
337+
tokens[7].push(iearn3AdapterTokens);
353338
});
354339
protocolNames.push('iearn.finance (v3)');
355340
metadata.push([
@@ -361,8 +346,8 @@ module.exports = async (deployer, network, accounts) => {
361346
]);
362347
await deployer.deploy(ChaiAdapter, { from: accounts[0] })
363348
.then(() => {
364-
adapters[7].push(ChaiAdapter.address);
365-
tokens[7].push(chaiAdapterTokens);
349+
adapters[8].push(ChaiAdapter.address);
350+
tokens[8].push(chaiAdapterTokens);
366351
});
367352
protocolNames.push('Chai');
368353
metadata.push([
@@ -374,8 +359,8 @@ module.exports = async (deployer, network, accounts) => {
374359
]);
375360
await deployer.deploy(DSRAdapter, { from: accounts[0] })
376361
.then(() => {
377-
adapters[8].push(DSRAdapter.address);
378-
tokens[8].push(dsrAdapterTokens);
362+
adapters[9].push(DSRAdapter.address);
363+
tokens[9].push(dsrAdapterTokens);
379364
});
380365
protocolNames.push('Dai Savings Rate');
381366
metadata.push([
@@ -387,13 +372,13 @@ module.exports = async (deployer, network, accounts) => {
387372
]);
388373
await deployer.deploy(MCDAssetAdapter, { from: accounts[0] })
389374
.then(() => {
390-
adapters[9].push(MCDAssetAdapter.address);
391-
tokens[9].push(mcdAssetAdapterTokens);
375+
adapters[10].push(MCDAssetAdapter.address);
376+
tokens[10].push(mcdAssetAdapterTokens);
392377
});
393378
await deployer.deploy(MCDDebtAdapter, { from: accounts[0] })
394379
.then(() => {
395-
adapters[9].push(MCDDebtAdapter.address);
396-
tokens[9].push(mcdDebtAdapterTokens);
380+
adapters[10].push(MCDDebtAdapter.address);
381+
tokens[10].push(mcdDebtAdapterTokens);
397382
});
398383
protocolNames.push('Multi-Collateral Dai');
399384
metadata.push([
@@ -405,8 +390,8 @@ module.exports = async (deployer, network, accounts) => {
405390
]);
406391
await deployer.deploy(PoolTogetherAdapter, { from: accounts[0] })
407392
.then(() => {
408-
adapters[10].push(PoolTogetherAdapter.address);
409-
tokens[10].push(poolTogetherAdapterTokens);
393+
adapters[11].push(PoolTogetherAdapter.address);
394+
tokens[11].push(poolTogetherAdapterTokens);
410395
});
411396
protocolNames.push('PoolTogether');
412397
metadata.push([
@@ -418,13 +403,13 @@ module.exports = async (deployer, network, accounts) => {
418403
]);
419404
await deployer.deploy(SynthetixAssetAdapter, { from: accounts[0] })
420405
.then(() => {
421-
adapters[11].push(SynthetixAssetAdapter.address);
422-
tokens[11].push(synthetixAssetAdapterTokens);
406+
adapters[12].push(SynthetixAssetAdapter.address);
407+
tokens[12].push(synthetixAssetAdapterTokens);
423408
});
424409
await deployer.deploy(SynthetixDebtAdapter, { from: accounts[0] })
425410
.then(() => {
426-
adapters[11].push(SynthetixDebtAdapter.address);
427-
tokens[11].push(synthetixDebtAdapterTokens);
411+
adapters[12].push(SynthetixDebtAdapter.address);
412+
tokens[12].push(synthetixDebtAdapterTokens);
428413
});
429414
protocolNames.push('Synthetix');
430415
metadata.push([
@@ -436,8 +421,8 @@ module.exports = async (deployer, network, accounts) => {
436421
]);
437422
await deployer.deploy(UniswapV1Adapter, { from: accounts[0] })
438423
.then(() => {
439-
adapters[12].push(UniswapV1Adapter.address);
440-
tokens[12].push(uniswapV1AdapterTokens);
424+
adapters[13].push(UniswapV1Adapter.address);
425+
tokens[13].push([]);
441426
});
442427
protocolNames.push('Uniswap V1');
443428
metadata.push([
@@ -449,8 +434,8 @@ module.exports = async (deployer, network, accounts) => {
449434
]);
450435
await deployer.deploy(ZrxAdapter, { from: accounts[0] })
451436
.then(() => {
452-
adapters[13].push(ZrxAdapter.address);
453-
tokens[13].push(zrxAdapterTokens);
437+
adapters[14].push(ZrxAdapter.address);
438+
tokens[14].push(zrxAdapterTokens);
454439
});
455440
protocolNames.push('0x Staking');
456441
metadata.push([
@@ -460,6 +445,7 @@ module.exports = async (deployer, network, accounts) => {
460445
'protocol-icons.s3.amazonaws.com/0x-staking.png',
461446
'0',
462447
]);
448+
463449
await deployer.deploy(ERC20TokenAdapter, { from: accounts[0] })
464450
.then(() => {
465451
tokenAdapters.push(
@@ -472,6 +458,12 @@ module.exports = async (deployer, network, accounts) => {
472458
AaveTokenAdapter.address,
473459
);
474460
});
461+
await deployer.deploy(BalancerTokenAdapter, { from: accounts[0] })
462+
.then(() => {
463+
tokenAdapters.push(
464+
BalancerTokenAdapter.address,
465+
);
466+
});
475467
await deployer.deploy(CompoundTokenAdapter, { from: accounts[0] })
476468
.then(() => {
477469
tokenAdapters.push(
@@ -530,6 +522,7 @@ module.exports = async (deployer, network, accounts) => {
530522
[
531523
'ERC20',
532524
'AToken',
525+
'Balancer pool token',
533526
'CToken',
534527
'Curve pool token',
535528
'IdleToken',

0 commit comments

Comments
 (0)