Skip to content

Commit

Permalink
Avalanche deployment (#186)
Browse files Browse the repository at this point in the history
* deploying on Avalanche

* deploying the swapper contract

* verifying borrow helpers contract

* fixing forge test
  • Loading branch information
sogipec authored Dec 13, 2022
1 parent fb6c092 commit f80fe1d
Show file tree
Hide file tree
Showing 25 changed files with 7,606 additions and 12 deletions.
4 changes: 2 additions & 2 deletions deploy/0_proxyAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {

console.log(`Now deploying ProxyAdmin on the chain ${network.config.chainId}`);
console.log('Guardian address is ', guardian);
await deploy('ProxyAdmin', {
await deploy('ProxyAdminGuardian', {
contract: 'ProxyAdmin',
from: deployer.address,
log: !argv.ci,
});
const proxyAdminAddress = (await ethers.getContract('ProxyAdmin')).address;
const proxyAdminAddress = (await ethers.getContract('ProxyAdminGuardian')).address;

proxyAdmin = new ethers.Contract(proxyAdminAddress, ProxyAdmin__factory.createInterface(), deployer) as ProxyAdmin;

Expand Down
2 changes: 1 addition & 1 deletion deploy/5_vaultManagerImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ const func: DeployFunction = async ({ deployments, ethers }) => {
};

func.tags = ['vaultManagerImplementation'];
func.dependencies = ['oracle'];
// func.dependencies = ['oracle'];
export default func;
3 changes: 2 additions & 1 deletion deploy/6_vaultManagerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
vaultManagerParams.params,
vaultManagerParams.symbol,
]);

// await deployProxy(name, implementation, proxyAdminAddress, callData);
await deploy(name, {
contract: 'TransparentUpgradeableProxy',
Expand All @@ -88,5 +89,5 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
};

func.tags = ['vaultManagerProxy'];
func.dependencies = ['vaultManagerImplementation'];
// func.dependencies = ['vaultManagerImplementation'];
export default func;
7 changes: 4 additions & 3 deletions deploy/7_swapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
const core = (await deployments.get('CoreBorrow')).address;

console.log('Now deploying the swapper contract');
const angleRouter = registry(network.config.chainId as ChainId)?.AngleRouterV2;
// const angleRouter = registry(network.config.chainId as ChainId)?.AngleRouterV2;
const angleRouter = '0xf530b844fb797D2C6863D56a94777C3e411CEc86';
console.log('Checking contract addresses');
console.log(`${core} ${json.uniswapV3Router} ${json.oneInchRouter} ${angleRouter}`);

await deploy(`Swapper`, {
await deploy(`SwapperV2`, {
contract: 'Swapper',
from: deployer.address,
args: [core, json.uniswapV3Router, json.oneInchRouter, angleRouter],
log: !argv.ci,
});
console.log('Success');
const swapperAddress = (await deployments.get('Swapper')).address;
const swapperAddress = (await deployments.get('SwapperV2')).address;
console.log(`${swapperAddress}`);
};

Expand Down
10 changes: 7 additions & 3 deletions deploy/ui-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,24 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
// Otherwise, we're using the proxy admin address from the desired network
proxyAdmin = CONTRACTS_ADDRESSES[network.config.chainId as ChainId].ProxyAdmin!;
}
// Using the proxyAdminGuardian for Avalanche
proxyAdmin = '0xe14bFA5575d9906BA35beb15C9DBe5C77bFdd5b5';
console.log('deployer ', deployer.address);

console.log('Now deploying the AngleHelpers contract');
console.log('Starting with the implementation');
const angleHelpersImplementation = await deploy('AngleHelpers_Arbitrum_Implementation', {
const angleHelpersImplementation = await deploy('AngleHelpers_Avalanche_Implementation', {
contract: 'AngleBorrowHelpers',
from: deployer.address,
});

console.log(`Successfully deployed the Arbitrum implementation for AngleBorrowHelpers at ${angleHelpersImplementation.address}\n`);
console.log(
`Successfully deployed the Avalanche implementation for AngleBorrowHelpers at ${angleHelpersImplementation.address}\n`,
);

console.log('Now deploying the Proxy');
console.log(`Proxy admin: ${proxyAdmin}`);
const angleHelpers = await deploy('AngleBorrowHelpersArbitrum', {
const angleHelpers = await deploy('AngleBorrowHelpersAvalanche', {
contract: 'TransparentUpgradeableProxy',
from: deployer.address,
args: [angleHelpersImplementation.address, proxyAdmin, '0x'],
Expand Down
262 changes: 262 additions & 0 deletions deployments/arbitrum/SwapperV2.json

Large diffs are not rendered by default.

541 changes: 541 additions & 0 deletions deployments/arbitrum/solcInputs/891a411f4f277461fb1354bee4d4be13.json

Large diffs are not rendered by default.

235 changes: 235 additions & 0 deletions deployments/avalanche/AngleBorrowHelpersAvalanche.json

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions deployments/avalanche/AngleHelpers_Avalanche_Implementation.json

Large diffs are not rendered by default.

248 changes: 248 additions & 0 deletions deployments/avalanche/Oracle_AVAX_EUR.json

Large diffs are not rendered by default.

248 changes: 248 additions & 0 deletions deployments/avalanche/Oracle_USDC_EUR.json

Large diffs are not rendered by default.

246 changes: 246 additions & 0 deletions deployments/avalanche/ProxyAdminGuardian.json

Large diffs are not rendered by default.

262 changes: 262 additions & 0 deletions deployments/avalanche/SwapperV2.json

Large diffs are not rendered by default.

Loading

0 comments on commit f80fe1d

Please sign in to comment.