Skip to content

Commit

Permalink
feat: deploy on Gnosis Chain (#49)
Browse files Browse the repository at this point in the history
* feat: deploy on Gnosis Chain

* update whitelist
  • Loading branch information
sogipec authored Jan 10, 2024
1 parent e38e516 commit e6bfa90
Show file tree
Hide file tree
Showing 11 changed files with 6,716 additions and 26 deletions.
5 changes: 3 additions & 2 deletions deploy/0_distributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
const { deployer } = await ethers.getNamedSigners();

let core: string;
core = '0xC16B81Af351BA9e64C1a069E3Ab18c244A1E3049';
core = '0xFD0DFC837Fe7ED19B23df589b6F6Da5a775F99E0';
/*
if (!network.live) {
// If we're in mainnet fork, we're using the `CoreBorrow` address from mainnet
Expand All @@ -26,12 +26,13 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {

console.log('Now deploying Distributor');
console.log('Starting with the implementation');

/*
await deploy('Distributor_Implementation_2', {
contract: 'Distributor',
from: deployer.address,
log: !argv.ci,
});
*/

const implementationAddress = (await ethers.getContract('Distributor_Implementation_2')).address;

Expand Down
45 changes: 23 additions & 22 deletions deploy/1_distributionCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
// Otherwise, we're using the proxy admin address from the desired network
core = registry(network.config.chainId as ChainId)?.Merkl?.CoreMerkl!;
}
core = '0xFD0DFC837Fe7ED19B23df589b6F6Da5a775F99E0';

console.log(deployer.address);

Expand All @@ -35,34 +36,34 @@ 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');
const distributor = (await deployments.get('Distributor')).address;
console.log('Now deploying the Proxy');

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

// const manager = (await deployments.get('DistributionCreator')).address;
// console.log(`Successfully deployed contract at the address ${manager}`);
// console.log('Initializing the contract');
// const contract = new ethers.Contract(
// manager,
// DistributionCreator__factory.createInterface(),
// deployer,
// ) as DistributionCreator;
const manager = (await deployments.get('DistributionCreator')).address;
console.log(`Successfully deployed contract at the address ${manager}`);
console.log('Initializing the contract');
const contract = new ethers.Contract(
manager,
DistributionCreator__factory.createInterface(),
deployer,
) as DistributionCreator;

// await (await contract.connect(deployer).initialize(core, distributor, parseAmount.gwei('0.03'))).wait();
// console.log('Contract successfully initialized');
// console.log('');
// console.log(await contract.core());
await (await contract.connect(deployer).initialize(core, distributor, parseAmount.gwei('0.03'))).wait();
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
- `toggleTokenWhitelist` -> for agEUR and stEUR
- `setRewardTokenMinAmounts`
- `setFeeRecipient -> angleLabs
- `setMessage` ->
Expand All @@ -76,5 +77,5 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
};

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

Large diffs are not rendered by default.

Loading

0 comments on commit e6bfa90

Please sign in to comment.