Skip to content

Commit

Permalink
push scripts (#58)
Browse files Browse the repository at this point in the history
* push scripts

* change script

* feat: immutable deployment

* feat: add check

* feat: scroll and manta deployments

* deploy new addresses

* feat: blast

* feat: deploy aglaMerkl

* fix: lint
  • Loading branch information
sogipec authored Mar 12, 2024
1 parent 6f80a48 commit f7bca72
Show file tree
Hide file tree
Showing 46 changed files with 22,462 additions and 89 deletions.
57 changes: 57 additions & 0 deletions contracts/mock/DistributionCreatorUpdatable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// SPDX-License-Identifier: BUSL-1.1

/*
* █
***** ▓▓▓
* ▓▓▓▓▓▓▓
* ///. ▓▓▓▓▓▓▓▓▓▓▓▓▓
***** //////// ▓▓▓▓▓▓▓
* ///////////// ▓▓▓
▓▓ ////////////////// █ ▓▓
▓▓ ▓▓ /////////////////////// ▓▓ ▓▓
▓▓ ▓▓ //////////////////////////// ▓▓ ▓▓
▓▓ ▓▓ /////////▓▓▓///////▓▓▓///////// ▓▓ ▓▓
▓▓ ,////////////////////////////////////// ▓▓ ▓▓
▓▓ ////////////////////////////////////////// ▓▓
▓▓ //////////////////////▓▓▓▓/////////////////////
,////////////////////////////////////////////////////
.//////////////////////////////////////////////////////////
.//////////////////////////██.,//////////////////////////█
.//////////////////////████..,./////////////////////██
...////////////////███████.....,.////////////////███
,.,////////////████████ ........,///////////████
.,.,//////█████████ ,.......///////████
,..//████████ ........./████
..,██████ .....,███
.██ ,.,█
▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓ ▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓ ▓▓ ▓▓▓▓
▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓ ▓▓▓▓▓
▓▓▓ ▓▓ ▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓
*/

pragma solidity ^0.8.17;

import "../DistributionCreator.sol";

/// @title DistributionCreatorUpdatable
/// @author Angle Labs, Inc.
//solhint-disable
contract DistributionCreatorUpdatable is DistributionCreator {

uint8 public coreUpdated;

uint256[49] private __gapUpdatable;


function updateCore(address _newCore) external {
if(coreUpdated == 0) {
core = ICore(_newCore);
coreUpdated = 1;
}
}

}
16 changes: 11 additions & 5 deletions deploy/0_distributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ import yargs from 'yargs';
import { Distributor, Distributor__factory } from '../typechain';
const argv = yargs.env('').boolean('ci').parseSync();

// Before running this deployment, make sure that on borrow-contracts the ProxyAdminAngleLabs and CoreMerkl
// contracts were deployed with:
// - governor of CoreMerkl: AngleLabs address
// - guardian: the deployer address
// Admin of ProxyAdmin: AngleLabs multisig
const func: DeployFunction = async ({ deployments, ethers, network }) => {
const { deploy } = deployments;
const { deployer } = await ethers.getNamedSigners();

let core: string;
// TODO: change the coreMerkl address to that of the desired chain
core = '0x3E399AE5B4D8bc0021e53b51c8BCdD66DD62c03b';
// Merkl deployer: 0x9f76a95AA7535bb0893cf88A146396e00ed21A12

core = '0xE9169817EdBFe5FCF629eD8b3C2a34E2a50ec84C';
/*
if (!network.live) {
// If we're in mainnet fork, we're using the `CoreBorrow` address from mainnet
Expand All @@ -38,24 +45,23 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {

console.log(`Successfully deployed the implementation for Distributor at ${implementationAddress}`);
console.log('');
/*

console.log('Now deploying the Proxy');

await deploy('TestDistributor', {
await deploy('Distributor', {
contract: 'ERC1967Proxy',
from: deployer.address,
args: [implementationAddress, '0x'],
log: !argv.ci,
});

const distributor = (await deployments.get('TestDistributor')).address;
const distributor = (await deployments.get('Distributor')).address;
console.log(`Successfully deployed contract at the address ${distributor}`);
console.log('Initializing the contract');
const contract = new ethers.Contract(distributor, Distributor__factory.createInterface(), deployer) as Distributor;
await (await contract.connect(deployer).initialize(core)).wait();
console.log('Contract successfully initialized');
console.log('');
*/
};

func.tags = ['distributor'];
Expand Down
6 changes: 2 additions & 4 deletions deploy/1_distributionCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {

let core: string;
// TODO: change the coreMerkl address to that of the desired chain
core = '0x3E399AE5B4D8bc0021e53b51c8BCdD66DD62c03b';
core = '0xE9169817EdBFe5FCF629eD8b3C2a34E2a50ec84C';
/*
if (!network.live) {
// If we're in mainnet fork, we're using the `CoreBorrow` address from mainnet
Expand All @@ -36,7 +36,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {

console.log(`Successfully deployed the implementation for DistributionCreator at ${implementationAddress}`);
console.log('');
/*

const distributor = (await deployments.get('Distributor')).address;
console.log('Now deploying the Proxy');

Expand All @@ -60,12 +60,10 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
console.log('Contract successfully initialized');
console.log('');
console.log(await contract.core());
*/

/* Once good some functions need to be called to have everything setup.
In the `DistributionCreator` contract:
- `toggleTokenWhitelist` -> for agEUR and stEUR
- `setRewardTokenMinAmounts`
- `setFeeRecipient -> angleLabs
- `setMessage` ->
Expand Down
30 changes: 30 additions & 0 deletions deploy/aglaMerkl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { DeployFunction } from 'hardhat-deploy/types';
import yargs from 'yargs';

const argv = yargs.env('').boolean('ci').parseSync();

const func: DeployFunction = async ({ deployments, ethers, network }) => {
const { deploy } = deployments;
const { deployer } = await ethers.getNamedSigners();
let core: string;

const implementationName = 'MockToken';

console.log(`Now deploying ${implementationName}`);
console.log('Starting with the implementation');

await deploy(implementationName, {
contract: implementationName,
from: deployer.address,
args: ["aglaMerkl","aglaMerkl",6],
log: !argv.ci,
});

const implementationAddress = (await ethers.getContract(implementationName)).address;

console.log(`Successfully deployed the contract ${implementationName} at ${implementationAddress}`);
console.log('');
};

func.tags = ['aglaMerkl'];
export default func;
1 change: 1 addition & 0 deletions deployments/blast/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
81457
132 changes: 132 additions & 0 deletions deployments/blast/DistributionCreator.json

Large diffs are not rendered by default.

Loading

0 comments on commit f7bca72

Please sign in to comment.