forked from balancer/balancer-v2-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployments: Add stable pool factory deployment (balancer#650)
* deployments: add stable pool factory task * deployments: update stable pool deployment * deployments: update stable pool factory testnets * deployments: update stable pool factory mainnet * deployments: add polygon stable pool factory
- Loading branch information
1 parent
e29c13a
commit ad14421
Showing
11 changed files
with
244 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", | ||
"balancerHelpers": "0x5aDDCCa35b7A0D07C74063c48700C8590E87864E" | ||
} |
123 changes: 123 additions & 0 deletions
123
pkg/deployments/tasks/20210624-stable-pool/abi/StablePoolFactory.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Task from '../../src/task'; | ||
|
||
import { StablePoolDeployment } from './input'; | ||
|
||
export default async (task: Task, force = false): Promise<void> => { | ||
const output = task.output({ ensure: false }); | ||
|
||
if (force || !output.factory) { | ||
const input = task.input() as StablePoolDeployment; | ||
const factory = await task.deploy('StablePoolFactory', [input.vault]); | ||
task.save({ factory }); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Task from '../../src/task'; | ||
|
||
export type StablePoolDeployment = { | ||
vault: string; | ||
}; | ||
|
||
const vault = new Task('20210418-vault'); | ||
|
||
export default { | ||
vault: vault, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"factory": "0x751dfDAcE1AD995fF13c927f6f761C6604532c79", | ||
"timestamp": 1624565674900 | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/deployments/tasks/20210624-stable-pool/output/mainnet.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"factory": "0xc66Ba2B6595D3613CCab350C886aCE23866EDe24", | ||
"timestamp": 1624622142780 | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/deployments/tasks/20210624-stable-pool/output/polygon.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"factory": "0xc66Ba2B6595D3613CCab350C886aCE23866EDe24", | ||
"timestamp": 1624636796833 | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/deployments/tasks/20210624-stable-pool/output/rinkeby.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"factory": "0xc66Ba2B6595D3613CCab350C886aCE23866EDe24", | ||
"timestamp": 1624573659396 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 20210624 - Stable Pool | ||
|
||
|
73 changes: 73 additions & 0 deletions
73
pkg/deployments/tasks/20210624-stable-pool/test/deploy.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { expect } from 'chai'; | ||
|
||
import Task from '../../../src/task'; | ||
import { Output } from '../../../src/types'; | ||
|
||
describe('StablePool', function () { | ||
const task = new Task('20210624-stable-pool', 'mainnet', 'test'); | ||
|
||
afterEach('delete deployment', async () => { | ||
await task.delete(); | ||
}); | ||
|
||
context('with no previous deploy', () => { | ||
const itDeploysFactory = (force: boolean) => { | ||
it('deploys a stable pool factory', async () => { | ||
await task.run(force); | ||
|
||
const output = task.output(); | ||
expect(output.factory).not.to.be.null; | ||
expect(output.timestamp).not.to.be.null; | ||
|
||
const input = task.input(); | ||
const factory = await task.instanceAt('StablePoolFactory', output.factory); | ||
expect(await factory.getVault()).to.be.equal(input.vault); | ||
}); | ||
}; | ||
|
||
context('when forced', () => { | ||
const force = true; | ||
|
||
itDeploysFactory(force); | ||
}); | ||
|
||
context('when not forced', () => { | ||
const force = false; | ||
|
||
itDeploysFactory(force); | ||
}); | ||
}); | ||
|
||
context('with a previous deploy', () => { | ||
let previousDeploy: Output; | ||
|
||
beforeEach('deploy', async () => { | ||
await task.run(); | ||
previousDeploy = task.output(); | ||
}); | ||
|
||
context('when forced', () => { | ||
const force = true; | ||
|
||
it('re-deploys the stable pool factory', async () => { | ||
await task.run(force); | ||
|
||
const output = task.output(); | ||
expect(output.factory).not.to.be.equal(previousDeploy.factory); | ||
expect(output.timestamp).to.be.gt(previousDeploy.timestamp); | ||
}); | ||
}); | ||
|
||
context('when not forced', () => { | ||
const force = false; | ||
|
||
it('does not re-deploys the stable pool factory', async () => { | ||
await task.run(force); | ||
|
||
const output = task.output(); | ||
expect(output.factory).to.be.equal(previousDeploy.factory); | ||
expect(output.timestamp).to.be.equal(previousDeploy.timestamp); | ||
}); | ||
}); | ||
}); | ||
}); |