Skip to content

Commit

Permalink
Deployment preparation: AvalancheRootGaugeFactory V2 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeira authored Aug 10, 2023
1 parent 9231a5d commit 7211ed9
Show file tree
Hide file tree
Showing 16 changed files with 638 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ Returns an object with all contracts from a deployment and their addresses.
| L2 VeBoost V2 | [`20230525-l2-veboost-v2`](./tasks/20230525-l2-veboost-v2) |
| Polygon ZkEVM Root Gauge, for veBAL voting | [`20230526-zkevm-root-gauge-factory`](./tasks/20230526-zkevm-root-gauge-factory) |
| Gauge Working Balance Helper | [`20230526-gauge-working-balance-helper`](./tasks/20230526-gauge-working-balance-helper) |
| Avalanche Root Gauge, for veBAL voting | [`20230529-avalanche-root-gauge-factory`](./tasks/20230529-avalanche-root-gauge-factory) |
| Timelock Authorizer, governance contract | [`20230522-timelock-authorizer`](./tasks/20230522-timelock-authorizer) |
| Pool Data Queries for bulk operations | [`20230613-balancer-pool-data-queries`](./tasks/20230613-balancer-pool-data-queries) |
| Composable Stable Pools V5 | [`20230711-composable-stable-pool-v5`](./tasks/20230711-composable-stable-pool-v5) |
| L2 Child Chain Gauge Checkpointer (Relayer) | [`20230712-child-chain-gauge-checkpointer`](./tasks/20230712-child-chain-gauge-checkpointer) |
| Chainlink Rate Provider Factory | [`20230717-chainlink-rate-provider-factory`](./tasks/20230717-chainlink-rate-provider-factory) |
| Stakeless Gauge Checkpointer | [`20230731-stakeless-gauge-checkpointer`](./tasks/20230731-stakeless-gauge-checkpointer) |
| Avalanche Root Gauge V2, for veBAL voting | [`20230811-avalanche-root-gauge-factory-v2`](./tasks/20230811-avalanche-root-gauge-factory-v2) |

## Scripts

Expand Down Expand Up @@ -196,3 +196,4 @@ Go to each deprecated deployment's readme file to learn more about why it is dep
| Linear Pools for Silo Tokens | [`20230315-silo-linear-pool`](./tasks/deprecated/20230315-silo-linear-pool) |
| Composable Stable Pools V4 | [`20230320-composable-stable-pool-v4`](./tasks/deprecated/20230320-composable-stable-pool-v4) |
| L2 Gauge Checkpointer | [`20230527-l2-gauge-checkpointer`](./tasks/deprecated/20230527-l2-gauge-checkpointer) |
| Avalanche Root Gauge, for veBAL voting | [`20230529-avalanche-root-gauge-factory`](./tasks/deprecated/20230529-avalanche-root-gauge-factory) |
2 changes: 1 addition & 1 deletion addresses/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@
"address": "0xc57b4BE50BF6BBe5f6a4fE379DA342B32b37bF2f"
}
],
"status": "ACTIVE"
"status": "DEPRECATED"
},
"20230613-balancer-pool-data-queries": {
"contracts": [
Expand Down
28 changes: 28 additions & 0 deletions src/helpers/contracts/ILayerZeroBALProxy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;

/**
* @dev Partial interface for LayerZero BAL proxy.
*/
interface ILayerZeroBALProxy {
/// @dev Emitted when `_amount` tokens are moved from the sender `_from` to (`_dstChainId`, `_toAddress`)
event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes32 indexed _toAddress, uint256 _amount);

function owner() external view returns (address);

function setUseCustomAdapterParams(bool) external;
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions tasks/20230811-avalanche-root-gauge-factory-v2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Task, TaskRunOptions } from '@src';
import { AvalancheRootGaugeFactoryDeployment } from './input';

export default async (task: Task, { force, from }: TaskRunOptions = {}): Promise<void> => {
const input = task.input() as AvalancheRootGaugeFactoryDeployment;

const args = [input.Vault, input.BalancerMinter, input.BALProxy];

const factory = await task.deployAndVerify('AvalancheRootGaugeFactory', args, from, force);

const implementation = await factory.getGaugeImplementation();
await task.verify('AvalancheRootGauge', implementation, [input.BalancerMinter, input.BALProxy]);
task.save({ AvalancheRootGauge: implementation });
};
21 changes: 21 additions & 0 deletions tasks/20230811-avalanche-root-gauge-factory-v2/input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Task, TaskMode } from '@src';

export type AvalancheRootGaugeFactoryDeployment = {
Vault: string;
BalancerMinter: string;
BALProxy: string;
};

const Vault = new Task('20210418-vault', TaskMode.READ_ONLY);
const BalancerMinter = new Task('20220325-gauge-controller', TaskMode.READ_ONLY);
// Ethereum BAL proxy https://etherscan.io/address/0xE15bCB9E0EA69e6aB9FA080c4c4A5632896298C3
// is wired to BAL token in AVAX: https://snowtrace.io/address/0xE15bCB9E0EA69e6aB9FA080c4c4A5632896298C3
const BALProxy = '0xE15bCB9E0EA69e6aB9FA080c4c4A5632896298C3';

export default {
mainnet: {
Vault,
BalancerMinter,
BALProxy,
},
};
9 changes: 9 additions & 0 deletions tasks/20230811-avalanche-root-gauge-factory-v2/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 2023-08-11 - Avalanche Root Gauge Factory V2

Deployment of the `AvalancheRootGaugeFactory`, for stakeless gauges that bridge funds to their Avalanche counterparts.
This version uses a Layer Zero Omni Fungible Token as the BAL bridge, which is currently used in the Avalanche network.
Replaces [Avalanche root gauge V1](../deprecated/20230529-avalanche-root-gauge-factory/) which used anySwap wrappers to bridge BAL.

## Useful Files

- [`AvalancheRootGaugeFactory` artifact](./artifact/AvalancheRootGaugeFactory.json)
Loading

0 comments on commit 7211ed9

Please sign in to comment.