Skip to content

Commit bb4fafb

Browse files
feat: zkevm setup and deployment (#218)
* first batch of test done * update final hash of vaultManager implementation * feat: add a script for the balance on a chain at a given time on any token * feat: zkEVM deployment for agEUR and first Merkl contracts --------- Co-authored-by: gs8nrv <[email protected]>
1 parent 2d98820 commit bb4fafb

25 files changed

+8221
-20
lines changed

deploy/0_proxyAdmin.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
2020
} else {
2121
// Otherwise, we're using the proxy admin address from the desired network
2222
guardian = CONTRACTS_ADDRESSES[network.config.chainId as ChainId]?.Guardian!;
23-
guardian = '0xf0A31faec2B4fC6396c65B1aF1F6A71E653f11F0';
24-
governor = '0x0F70EeD1Bb51d5eDB1a2E46142638df959bAFD69';
23+
guardian = '0x10DeF8a92c51C8082087356186a1485301078DCd';
24+
governor = '0x2a42Aeec7519883713272ec10FE44461a2Dfe354';
2525
}
26-
/*
2726
console.log(`Now deploying ProxyAdmin on the chain ${network.config.chainId}`);
27+
governor = guardian;
2828
console.log('Governor address is ', governor);
29-
await deploy('ProxyAdmin', {
29+
30+
await deploy('ProxyAdminGuardian', {
3031
contract: 'ProxyAdmin',
3132
from: deployer.address,
3233
log: !argv.ci,
3334
});
34-
*/
35-
const proxyAdminAddress = (await ethers.getContract('ProxyAdmin')).address;
35+
36+
const proxyAdminAddress = (await ethers.getContract('ProxyAdminGuardian')).address;
3637

3738
proxyAdmin = new ethers.Contract(proxyAdminAddress, ProxyAdmin__factory.createInterface(), deployer) as ProxyAdmin;
3839

deploy/1_coreBorrow.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
1212
const json = await import('./networks/' + network.name + '.json');
1313
const governor = json.governor;
1414
const guardian = json.guardian;
15+
const angleLabs = json.angleLabs;
1516
let proxyAdmin: string;
1617

1718
if (!network.live) {
@@ -40,6 +41,8 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
4041

4142
const coreBorrowInterface = CoreBorrow__factory.createInterface();
4243

44+
// governor = angleLabs;
45+
4346
const dataCoreBorrow = new ethers.Contract(
4447
coreBorrowImplementation,
4548
coreBorrowInterface,
@@ -49,7 +52,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
4952
console.log('The contract will be initialized with the following governor and guardian addresses');
5053
console.log(governor, guardian);
5154

52-
await deploy('CoreBorrow', {
55+
await deploy('CoreMerkl', {
5356
contract: 'TransparentUpgradeableProxy',
5457
from: deployer.address,
5558
args: [coreBorrowImplementation, proxyAdmin, dataCoreBorrow],

deploy/2_agTokenImplementation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
1818
} else {
1919
implementationName = 'AgTokenSideChainMultiBridge';
2020
proxyAdmin = registry(network.config.chainId as ChainId)?.ProxyAdmin!;
21-
proxyAdmin = '0x9a5b060Bd7b8f86c4C0D720a17367729670AfB19';
21+
proxyAdmin = '0x1D941EF0D3Bba4ad67DBfBCeE5262F4CEE53A32b';
2222
}
2323

2424
console.log(`Now deploying the implementation for AgToken on ${network.name}`);

deploy/3_treasury.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
2424
} else {
2525
proxyAdmin = registry(network.config.chainId as ChainId)?.ProxyAdmin!;
2626
coreBorrow = registry(network.config.chainId as ChainId)?.CoreBorrow!;
27-
proxyAdmin = '0x9a5b060Bd7b8f86c4C0D720a17367729670AfB19';
28-
coreBorrow = '0x3E399AE5B4D8bc0021e53b51c8BCdD66DD62c03b';
27+
proxyAdmin = '0x1D941EF0D3Bba4ad67DBfBCeE5262F4CEE53A32b';
28+
coreBorrow = '0x4b1E2c2762667331Bc91648052F646d1b0d35984';
2929
}
3030

3131
let treasuryImplementation: string;

deploy/bridges/LayerZeroBridgeToken.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,24 @@ const func: DeployFunction = async ({ ethers, network, deployments }) => {
1717
const deploymentName = 'LayerZeroBridgeToken_V1_0_Implementation';
1818
const name = 'LayerZeroBridgeToken';
1919
const { deploy } = deployments;
20-
20+
/*
2121
await deploy(deploymentName, {
2222
contract: name,
2323
from: deployer.address,
2424
log: !argv.ci,
2525
});
26+
*/
2627
const implementationAddress = (await ethers.getContract(deploymentName)).address;
2728

2829
console.log(`Successfully deployed ${deploymentName} at ${implementationAddress}`);
2930

30-
/*
3131
const treasury = await ethers.getContract('Treasury_EUR');
3232
const proxyAdmin = await ethers.getContract('ProxyAdmin');
33+
console.log(`LayerZero Bridge ag${stable}`, `LZ-ag${stable}`, endpointAddr, treasury.address, parseEther('0'));
34+
3335
await deployProxy(
3436
`LayerZeroBridge_${stable}`,
35-
layerZeroBridgeImplem,
37+
implementationAddress,
3638
proxyAdmin.address,
3739
LayerZeroBridgeToken__factory.createInterface().encodeFunctionData('initialize', [
3840
`LayerZero Bridge ag${stable}`,
@@ -42,14 +44,12 @@ const func: DeployFunction = async ({ ethers, network, deployments }) => {
4244
parseEther('0'),
4345
]),
4446
);
45-
*/
4647

4748
/* The following things need to be done after this deployment:
48-
- setSources on the LayerZeroBridgeToken
49+
- setTrustedRemote on the LayerZeroBridgeToken -> for all the supported bridge tokens
4950
- addBridgeToken in the canonical agEUR -> limit should be higher than the limit which has already been minted in the contract
5051
- setChainTotalHourlyLimit in the canonical agEUR
51-
- setUseCustomAdapterParams
52-
- And depending on the value of the EXTRA_GAS constant: setMinDstGasLookup to all the chains
52+
- setUseCustomAdapterParams in the lz-agEUR contract
5353
*/
5454
};
5555

deploy/bridges/LayerZeroSetSources.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const func: DeployFunction = async ({ ethers, network }) => {
1616
bsc: '0xe9f183FC656656f1F17af1F2b0dF79b8fF9ad8eD',
1717
celo: '0xf1dDcACA7D17f8030Ab2eb54f2D9811365EFe123',
1818
gnosis: '0xFA5Ed56A203466CbBC2430a43c66b9D8723528E7',
19+
polygonzkevm: '0x2859a4eBcB58c8Dd5cAC1419C4F63A071b642B20',
1920
};
2021

2122
const local = OFTs[network.name];

deploy/constants/layerzeroChainIds.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"fantom": 112,
1111
"celo": 125,
1212
"gnosis": 145,
13+
"polygonzkevm": 158,
1314
"zksync": 165,
1415
"rinkeby": 10001,
1516
"bsc-testnet": 10002,

deploy/constants/layerzeroEndpoints.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"fantom": "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7",
1111
"celo": "0x3A73033C0b1407574C76BdBAc67f126f6b4a9AA9",
1212
"gnosis": "0x9740FF91F1985D8d2B71494aE1A2f723bb3Ed9E4",
13+
"polygonzkevm": "0x9740FF91F1985D8d2B71494aE1A2f723bb3Ed9E4",
1314
"zksync": "0x9b896c0e23220469C7AE69cb4BbAE391eAa4C8da",
1415
"rinkeby": "0x79a63d6d8BBD5c6dfc774dA79bCcD948EAcb53FA",
1516
"bsc-testnet": "0x6Fcb97553D41516Cb228ac03FdC8B9a0a9df04A1",

deploy/networks/polygonzkevm.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"angleLabs": "0x9439B96E39dA5AD7EAA75d7a136383D1D9737055",
3+
"governor": "0x2a42Aeec7519883713272ec10FE44461a2Dfe354",
4+
"guardian": "0x10DeF8a92c51C8082087356186a1485301078DCd"
5+
}

deployments/polygonzkevm/.chainId

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1101

0 commit comments

Comments
 (0)