forked from bancorprotocol/carbon-contracts
-
Notifications
You must be signed in to change notification settings - Fork 1
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 bancorprotocol#141 from bancorprotocol/carbon-vort…
…ex-2.0 Carbon vortex 2.0 deployment scripts
- Loading branch information
Showing
11 changed files
with
144 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { deploy, InstanceName, setDeploymentMetadata } from '../../../utils/Deploy'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
|
||
const func: DeployFunction = async ({ getNamedAccounts }: HardhatRuntimeEnvironment) => { | ||
const { deployer } = await getNamedAccounts(); | ||
|
||
await deploy({ | ||
name: InstanceName.ProxyAdmin, | ||
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,37 @@ | ||
import { NATIVE_TOKEN_ADDRESS } from '../../../utils/TokenData'; | ||
import { DeployedContracts, deployProxy, grantRole, InstanceName, setDeploymentMetadata } from '../../../utils/Deploy'; | ||
import { Roles } from '../../../utils/Roles'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
|
||
/** | ||
* deploy a new instance of carbon vortex v2.0 with the following configuration: | ||
* | ||
* 1. target token is ETH | ||
* 2. final target token is BNT | ||
* 3. transferAddress is BNT (will burn BNT tokens on ETH -> BNT trades) | ||
* 4. CarbonController and Vortex 1.0 are set as withdraw addresses (on execute, tokens will be withdrawn from both) | ||
*/ | ||
const func: DeployFunction = async ({ getNamedAccounts }: HardhatRuntimeEnvironment) => { | ||
const { deployer, bnt, vault, oldVortex } = await getNamedAccounts(); | ||
const carbonController = await DeployedContracts.CarbonController.deployed(); | ||
|
||
await deployProxy({ | ||
name: InstanceName.CarbonVortex, | ||
from: deployer, | ||
args: [carbonController.address, vault, oldVortex, bnt, NATIVE_TOKEN_ADDRESS, bnt] | ||
}); | ||
|
||
const carbonVortex = await DeployedContracts.CarbonVortex.deployed(); | ||
|
||
await grantRole({ | ||
name: InstanceName.CarbonController, | ||
id: Roles.CarbonController.ROLE_FEES_MANAGER, | ||
member: carbonVortex.address, | ||
from: deployer | ||
}); | ||
|
||
return true; | ||
}; | ||
|
||
export default setDeploymentMetadata(__filename, func); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.