Skip to content

Commit

Permalink
Merge pull request #8 from pooltogether/feat/deploy-twab-delegator
Browse files Browse the repository at this point in the history
Release v1.3.0
  • Loading branch information
PierrickGT authored Mar 18, 2022
2 parents 3244349 + 36ab7e6 commit 551eaf9
Show file tree
Hide file tree
Showing 22 changed files with 6,625 additions and 1,024 deletions.
71 changes: 11 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The deployment scripts are separated into versions.
- v1.0.1
- v1.1.0
- v1.2.1
- v1.3.0

# Getting Started

Expand All @@ -32,84 +33,30 @@ Note: You must configure RPC endpoints for archival nodes in the .envrc.

## Fork and Deploy

## v1.0.1

```
yarn test:v1.0.1.mainnet
```

```
yarn test:v1.0.1.polygon
```

## v1.1.0

```
yarn test:v1.1.0.mainnet
yarn test:v1.x.x.mainnet
```

```
yarn test:v1.1.0.avalanche
yarn test:v1.x.x.avalanche
```

```
yarn test:v1.1.0.polygon
```

## v1.2.1

```
yarn test:v1.2.1.mainnet
```

```
yarn test:v1.2.1.avalanche
```

```
yarn test:v1.2.1.polygon
yarn test:v1.x.x.polygon
```

# Deployment

If you wish to deploy the contracts, use the deployment commands:

## v1.0.1

```
yarn deploy:v1.0.1.mainnet
```

```
yarn deploy:v1.0.1.polygon
```

## v1.1.0

```
yarn deploy:v1.1.0.mainnet
```

```
yarn deploy:v1.1.0.avalanche
```

```
yarn deploy:v1.1.0.polygon
yarn deploy:v1.x.x.mainnet
```

## v1.2.1

```
yarn deploy:v1.2.1.mainnet
yarn deploy:v1.x.x.avalanche
```

```
yarn deploy:v1.2.1.avalanche
```

```
yarn deploy:v1.2.1.polygon
yarn deploy:v1.x.x.polygon
```

# Changelog
Expand Down Expand Up @@ -159,3 +106,7 @@ This version upgrades the existing configuration, so some changes need to be com

Deploy TWAB Rewards contract across Avalanche, Ethereum and Polygon.

## v1.3.0

Deploy TWAB Delegator contract across Avalanche, Ethereum and Polygon.

2 changes: 1 addition & 1 deletion contracts.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions deploy/v1.2.1/avalanche.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export default async function deployToAvalanche(hardhat: HardhatRuntimeEnvironme
return;
}

const { ethers } = hardhat;
const { getContract, getSigners } = ethers;
const { getNamedAccounts, ethers } = hardhat;
const { getContract } = ethers;

const [deployer] = await getSigners();
const { deployer } = await getNamedAccounts();

const prizePool = await getContract('YieldSourcePrizePool');
const ticket = await getContract('Ticket');
Expand All @@ -25,7 +25,7 @@ export default async function deployToAvalanche(hardhat: HardhatRuntimeEnvironme

if (await prizePool.getTicket() === ticket.address) {
await deployAndLog('TwabRewards', {
from: deployer.address,
from: deployer,
args: [ticket.address],
skipIfAlreadyDeployed: true,
});
Expand Down
8 changes: 4 additions & 4 deletions deploy/v1.2.1/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default async function deployToEthereumMainnet(hardhat: HardhatRuntimeEnv
dim(`Version: 1.2.1`)
} else { return }

const { ethers } = hardhat;
const { getContract, getSigners } = ethers;
const { getNamedAccounts, ethers } = hardhat;
const { getContract } = ethers;

const [deployer] = await getSigners();
const { deployer } = await getNamedAccounts();

const prizePool = await getContract('YieldSourcePrizePool');
const ticket = await getContract('Ticket');
Expand All @@ -22,7 +22,7 @@ export default async function deployToEthereumMainnet(hardhat: HardhatRuntimeEnv

if (await prizePool.getTicket() === ticket.address) {
await deployAndLog('TwabRewards', {
from: deployer.address,
from: deployer,
args: [ticket.address],
skipIfAlreadyDeployed: true,
});
Expand Down
8 changes: 4 additions & 4 deletions deploy/v1.2.1/polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default async function deployToPolygon(hardhat: HardhatRuntimeEnvironment
dim(`Version: 1.2.1`)
} else { return }

const { ethers } = hardhat;
const { getContract, getSigners } = ethers;
const { getNamedAccounts, ethers } = hardhat;
const { getContract } = ethers;

const [deployer] = await getSigners();
const { deployer } = await getNamedAccounts();

const prizePool = await getContract('YieldSourcePrizePool');
const ticket = await getContract('Ticket');
Expand All @@ -22,7 +22,7 @@ export default async function deployToPolygon(hardhat: HardhatRuntimeEnvironment

if (await prizePool.getTicket() === ticket.address) {
await deployAndLog('TwabRewards', {
from: deployer.address,
from: deployer,
args: [ticket.address],
skipIfAlreadyDeployed: true,
});
Expand Down
35 changes: 35 additions & 0 deletions deploy/v1.3.0/avalanche.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { dim, red } from 'chalk';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

import { deployAndLog } from '../../src/deployAndLog';

export default async function deployToAvalanche(hardhat: HardhatRuntimeEnvironment) {
if (process.env.DEPLOY === 'v1.3.0.avalanche') {
dim(`Deploying: TWAB Delegator Avalanche Mainnet`);
dim(`Version: 1.3.0`);
} else {
return;
}

const { getNamedAccounts, ethers } = hardhat;
const { getContract } = ethers;

const { deployer } = await getNamedAccounts();

const prizePool = await getContract('YieldSourcePrizePool');
const ticket = await getContract('Ticket');

// ===================================================
// Deploy Contracts
// ===================================================

if (await prizePool.getTicket() === ticket.address) {
await deployAndLog('TWABDelegator', {
from: deployer,
args: ['PoolTogether Staked avUSDCe Ticket', 'stkPTavUSDCe', ticket.address],
skipIfAlreadyDeployed: true,
});
} else {
red('Pool ticket address does not match ticket contract address');
}
}
32 changes: 32 additions & 0 deletions deploy/v1.3.0/mainnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { dim, red } from 'chalk';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { deployAndLog } from '../../src/deployAndLog';

export default async function deployToEthereumMainnet(hardhat: HardhatRuntimeEnvironment){
if (process.env.DEPLOY === 'v1.3.0.mainnet') {
dim(`Deploying: TWAB Delegator Ethereum Mainnet`)
dim(`Version: 1.3.0`)
} else { return }

const { getNamedAccounts, ethers } = hardhat;
const { getContract } = ethers;

const { deployer } = await getNamedAccounts();

const prizePool = await getContract('YieldSourcePrizePool');
const ticket = await getContract('Ticket');

// ===================================================
// Deploy Contracts
// ===================================================

if (await prizePool.getTicket() === ticket.address) {
await deployAndLog('TWABDelegator', {
from: deployer,
args: ['PoolTogether Staked aUSDC Ticket', 'stkPTaUSDC', ticket.address],
skipIfAlreadyDeployed: true,
});
} else {
red('Pool ticket address does not match ticket contract address');
}
}
32 changes: 32 additions & 0 deletions deploy/v1.3.0/polygon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { dim, red } from 'chalk';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { deployAndLog } from '../../src/deployAndLog';

export default async function deployToPolygon(hardhat: HardhatRuntimeEnvironment) {
if (process.env.DEPLOY === 'v1.3.0.polygon') {
dim(`Deploying: TWAB Delegator Polygon Mainnet`)
dim(`Version: 1.3.0`)
} else { return }

const { getNamedAccounts, ethers } = hardhat;
const { getContract } = ethers;

const { deployer } = await getNamedAccounts();

const prizePool = await getContract('YieldSourcePrizePool');
const ticket = await getContract('Ticket');

// ===================================================
// Deploy Contracts
// ===================================================

if (await prizePool.getTicket() === ticket.address) {
await deployAndLog('TWABDelegator', {
from: deployer,
args: ['PoolTogether Staked aUSDC Ticket', 'stkPTaUSDC', ticket.address],
skipIfAlreadyDeployed: true,
});
} else {
red('Pool ticket address does not match ticket contract address');
}
}
Loading

0 comments on commit 551eaf9

Please sign in to comment.