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

Update Linear build info #2041

Merged
merged 1 commit into from
Nov 23, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
"internalType": "contract IBalancerQueries",
"name": "queries",
"type": "address"
},
{
"internalType": "string",
"name": "factoryVersion",
"type": "string"
},
{
"internalType": "string",
"name": "poolVersion",
"type": "string"
}
],
"stateMutability": "nonpayable",
Expand Down Expand Up @@ -189,6 +199,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getPoolVersion",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getProtocolFeePercentagesProvider",
Expand Down Expand Up @@ -246,5 +269,18 @@
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import { AaveLinearPoolDeployment } from './input';

export default async (task: Task, { force, from }: TaskRunOptions = {}): Promise<void> => {
const input = task.input() as AaveLinearPoolDeployment;
const args = [input.Vault, input.ProtocolFeePercentagesProvider, input.BalancerQueries];
const args = [
input.Vault,
input.ProtocolFeePercentagesProvider,
input.BalancerQueries,
input.FactoryVersion,
input.PoolVersion,
];

await task.deployAndVerify('AaveLinearPoolFactory', args, from, force);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ export type AaveLinearPoolDeployment = {
Vault: string;
BalancerQueries: string;
ProtocolFeePercentagesProvider: string;
FactoryVersion: string;
PoolVersion: string;
};

const Vault = new Task('20210418-vault', TaskMode.READ_ONLY);
const BalancerQueries = new Task('20220721-balancer-queries', TaskMode.READ_ONLY);
const ProtocolFeePercentagesProvider = new Task('20220725-protocol-fee-percentages-provider', TaskMode.READ_ONLY);

const BaseVersion = { version: 2, deployment: '20221115-aave-rebalanced-linear-pool' };

export default {
Vault,
BalancerQueries,
ProtocolFeePercentagesProvider,
FactoryVersion: JSON.stringify({ name: 'AaveLinearPoolFactory', ...BaseVersion }),
PoolVersion: JSON.stringify({ name: 'AaveLinearPool', ...BaseVersion }),
};
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describeForkTest('AaveLinearPoolFactory', 'mainnet', 15225000, function () {
});
}

describe('create, join, and rebalance', () => {
describe('create and check getters', () => {
it('deploy a linear pool', async () => {
const tx = await factory.create('', '', USDT, waUSDT, INITIAL_UPPER_TARGET, SWAP_FEE_PERCENTAGE, owner.address);
const event = expectEvent.inReceipt(await tx.wait(), 'PoolCreated');
Expand All @@ -133,6 +133,28 @@ describeForkTest('AaveLinearPoolFactory', 'mainnet', 15225000, function () {
await usdt.connect(holder).approve(rebalancer.address, MAX_UINT256); // To send extra main on rebalance
});

it('check factory version', async () => {
const expectedFactoryVersion = {
name: 'AaveLinearPoolFactory',
version: 2,
deployment: '20221115-aave-rebalanced-linear-pool',
};

expect(await factory.version()).to.equal(JSON.stringify(expectedFactoryVersion));
});

it('check pool version', async () => {
const expectedPoolVersion = {
name: 'AaveLinearPool',
version: 2,
deployment: '20221115-aave-rebalanced-linear-pool',
};

expect(await pool.version()).to.equal(JSON.stringify(expectedPoolVersion));
});
});

describe('join, and rebalance', () => {
it('join the pool', async () => {
// We're going to join with enough main token to bring the Pool above its upper target, which will let us later
// rebalance.
Expand Down