-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb50fd7
commit 094af71
Showing
4 changed files
with
65 additions
and
2 deletions.
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,44 @@ | ||
import { DeployedContracts, execute, InstanceName, setDeploymentMetadata, upgradeProxy } from '../../utils/Deploy'; | ||
import { toWei } from '../../utils/Types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
|
||
const func: DeployFunction = async ({ getNamedAccounts }: HardhatRuntimeEnvironment) => { | ||
const { deployer, bancorArbitrageAddress, carbonPOLAddress } = await getNamedAccounts(); | ||
|
||
// get the deployed contracts | ||
const externalProtectionVault = await DeployedContracts.ExternalProtectionVault.deployed(); | ||
const masterVault = await DeployedContracts.MasterVault.deployed(); | ||
const networkSettings = await DeployedContracts.NetworkSettings.deployed(); | ||
const bntGovernance = await DeployedContracts.BNTGovernance.deployed(); | ||
const vbntGovernance = await DeployedContracts.VBNTGovernance.deployed(); | ||
const bnBNT = await DeployedContracts.bnBNT.deployed(); | ||
|
||
// upgrade the BancorNetwork contract | ||
await upgradeProxy({ | ||
name: InstanceName.BancorNetwork, | ||
args: [ | ||
bntGovernance.address, | ||
vbntGovernance.address, | ||
networkSettings.address, | ||
masterVault.address, | ||
externalProtectionVault.address, | ||
bnBNT.address, | ||
bancorArbitrageAddress, | ||
carbonPOLAddress | ||
], | ||
from: deployer | ||
}); | ||
|
||
// set the min network fee burn to 1M | ||
await execute({ | ||
name: InstanceName.BancorNetwork, | ||
methodName: 'setMinNetworkFeeBurn', | ||
args: [toWei(1_000_000)], | ||
from: deployer | ||
}); | ||
|
||
return true; | ||
}; | ||
|
||
export default setDeploymentMetadata(__filename, func); |
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,18 @@ | ||
import { BancorNetwork } from '../../components/Contracts'; | ||
import { describeDeployment } from '../../test/helpers/Deploy'; | ||
import { DeployedContracts } from '../../utils/Deploy'; | ||
import { toWei } from '../../utils/Types'; | ||
import { expect } from 'chai'; | ||
|
||
describeDeployment(__filename, () => { | ||
let network: BancorNetwork; | ||
|
||
beforeEach(async () => { | ||
network = await DeployedContracts.BancorNetwork.deployed(); | ||
}); | ||
|
||
it('should upgrade the network contract properly', async () => { | ||
expect(await network.version()).to.equal(10); | ||
expect(await network.minNetworkFeeBurn()).to.equal(toWei(1_000_000)); | ||
}); | ||
}); |
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