Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push scripts #58

Merged
merged 9 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading