-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from bancorprotocol/remove-pause
Remove pause
- Loading branch information
Showing
17 changed files
with
439 additions
and
583 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
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,22 @@ | ||
import { DeployedContracts, InstanceName, setDeploymentMetadata, upgradeProxy } from '../../../utils/Deploy'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
|
||
/** | ||
* @dev remove pause functionality | ||
*/ | ||
const func: DeployFunction = async ({ getNamedAccounts }: HardhatRuntimeEnvironment) => { | ||
const { deployer } = await getNamedAccounts(); | ||
const voucher = await DeployedContracts.Voucher.deployed(); | ||
|
||
const carbonController = await DeployedContracts.CarbonController.deployed(); | ||
await upgradeProxy({ | ||
name: InstanceName.CarbonController, | ||
from: deployer, | ||
args: [voucher.address, carbonController.address] | ||
}); | ||
|
||
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
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,30 @@ | ||
import { CarbonController, ProxyAdmin } from '../../../components/Contracts'; | ||
import { DeployedContracts, describeDeployment } from '../../../utils/Deploy'; | ||
import { expect } from 'chai'; | ||
import { ethers } from 'hardhat'; | ||
|
||
describeDeployment(__filename, () => { | ||
let proxyAdmin: ProxyAdmin; | ||
let carbonController: CarbonController; | ||
|
||
beforeEach(async () => { | ||
proxyAdmin = await DeployedContracts.ProxyAdmin.deployed(); | ||
carbonController = await DeployedContracts.CarbonController.deployed(); | ||
}); | ||
|
||
it('should deploy and configure the carbon controller contract', async () => { | ||
expect(await proxyAdmin.getProxyAdmin(carbonController.address)).to.equal(proxyAdmin.address); | ||
expect(await carbonController.version()).to.equal(6); | ||
}); | ||
|
||
it('carbon controller implementation should be initialized', async () => { | ||
const implementationAddress = await proxyAdmin.getProxyImplementation(carbonController.address); | ||
const carbonControllerImpl: CarbonController = await ethers.getContractAt( | ||
'CarbonController', | ||
implementationAddress | ||
); | ||
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted) | ||
const tx = await carbonControllerImpl.initialize({ gasLimit: 6000000 }); | ||
await expect(tx.wait()).to.be.reverted; | ||
}); | ||
}); |
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
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
Oops, something went wrong.