-
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.
add fee exemption whitelist - deployment scripts
- Loading branch information
1 parent
d023342
commit 4b92c2a
Showing
4 changed files
with
73 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { DeployedContracts, execute, InstanceName, setDeploymentMetadata, upgradeProxy } from '../../utils/Deploy'; | ||
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, | ||
carbonPOLAddress | ||
], | ||
from: deployer | ||
}); | ||
|
||
// add bancor arbitrage contract address to fee exemption whitelist | ||
await execute({ | ||
name: InstanceName.BancorNetwork, | ||
methodName: 'addToWhitelist', | ||
args: [bancorArbitrageAddress], | ||
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,26 @@ | ||
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'; | ||
import { getNamedAccounts } from 'hardhat'; | ||
|
||
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(11); | ||
expect(await network.minNetworkFeeBurn()).to.equal(toWei(1_000_000)); | ||
}); | ||
|
||
it('should have added bancor arbitrage contract address to fee exemption whitelist', async () => { | ||
const { bancorArbitrageAddress } = await getNamedAccounts(); | ||
|
||
const whitelist = await network.feeExemptionWhitelist(); | ||
expect(whitelist).to.include(bancorArbitrageAddress); | ||
}); | ||
}); |
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