From f97e6989cffe9274a6df7471c1d676440da9fe97 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 1 Jul 2024 12:43:41 +0400 Subject: [PATCH] feat: deployed migrator --- script/scripts/DeployAccountingMigrator.s.sol | 19 +++---------------- script/scripts/MigrateAccounting.s.sol | 10 +++++----- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/script/scripts/DeployAccountingMigrator.s.sol b/script/scripts/DeployAccountingMigrator.s.sol index 7f31be3..4871042 100644 --- a/script/scripts/DeployAccountingMigrator.s.sol +++ b/script/scripts/DeployAccountingMigrator.s.sol @@ -10,16 +10,7 @@ import {EIP1967Proxy} from "../../src/proxy/EIP1967Proxy.sol"; contract AccountingMigrator { constructor() {} - // TODO: Check limits - function migrate( - address _pool, - address _accounting, - address _kycManager, - address _accountingOwner, - address _proxyAdmin - ) - external - { + function migrate(address _pool, address _accounting, address _accountingOwner, address _proxyAdmin) external { ZkBobAccounting accounting = ZkBobAccounting(_accounting); bytes memory dump = ZkBobPool(_pool).extsload(bytes32(uint256(1)), 2); @@ -33,15 +24,11 @@ contract AccountingMigrator { ZkBobPool(_pool).setAccounting(IZkBobAccounting(accounting)); accounting.initialize(txCount, tvl, cumTvl, maxWeeklyTxCount, maxWeeklyAvgTvl); - accounting.setKycProvidersManager(IKycProvidersManager(_kycManager)); accounting.setLimits( - 0, 2_000_000 gwei, 300_000 gwei, 300_000 gwei, 10_000 gwei, 10_000 gwei, 10_000 gwei, 1_000 gwei + 0, 10_000_000 gwei, 300_000 gwei, 300_000 gwei, 10_000 gwei, 10_000 gwei, 10_000 gwei, 1_000 gwei ); accounting.setLimits( - 1, 2_000_000 gwei, 300_000 gwei, 300_000 gwei, 100_000 gwei, 100_000 gwei, 10_000 gwei, 1_000 gwei - ); - accounting.setLimits( - 254, 2_000_000 gwei, 300_000 gwei, 300_000 gwei, 20_000 gwei, 20_000 gwei, 10_000 gwei, 1_000 gwei + 1, 10_000_000 gwei, 300_000 gwei, 300_000 gwei, 100_000 gwei, 100_000 gwei, 10_000 gwei, 1_000 gwei ); accounting.transferOwnership(_accountingOwner); diff --git a/script/scripts/MigrateAccounting.s.sol b/script/scripts/MigrateAccounting.s.sol index b70c072..239a916 100644 --- a/script/scripts/MigrateAccounting.s.sol +++ b/script/scripts/MigrateAccounting.s.sol @@ -10,9 +10,9 @@ import {EIP1967Proxy} from "../../src/proxy/EIP1967Proxy.sol"; import {AccountingMigrator} from "./DeployAccountingMigrator.s.sol"; // WARN: Update this values before running the script -address constant newZkBobPoolImpl = 0xD217AEf4aB37F7CeE7462d25cbD91f46c1E688a9; -address constant zkBobAccounting = 0xFd5a6a67D768d5BF1A8c7724387CA8786Bd4DD91; -address constant accountingMigrator = 0x0114Bf30d9f5A7f503D3DFC65534F2B5AC302c85; +address constant newZkBobPoolImpl = 0x84605eA206A1d5b39f13dC7add690dbD1e038525; +address constant zkBobAccounting = 0xbF3D58f026642951990C0421964179C83E2c9C1B; +address constant accountingMigrator = 0xbfF0020638011357315302727eD55C5193a95F7b; address constant accountingOwner = 0x14fc6a1a996A2EB889cF86e5c8cD17323bC85290; /** @@ -105,7 +105,7 @@ contract MigrateAccounting is Script, UpgradeTest { AccountingMigrator migrator = AccountingMigrator(accountingMigrator); PoolSnapshot memory snapshot = makeSnapshot(pool); - vm.startBroadcast(); + vm.startBroadcast(snapshot.proxyAdmin); EIP1967Proxy(payable(address(pool))).upgradeTo(address(newZkBobPoolImpl)); @@ -113,7 +113,7 @@ contract MigrateAccounting is Script, UpgradeTest { ZkBobAccounting(zkBobAccounting).transferOwnership(accountingMigrator); - migrator.migrate(address(pool), zkBobAccounting, snapshot.kycManager, accountingOwner, snapshot.proxyAdmin); + migrator.migrate(address(pool), zkBobAccounting, accountingOwner, snapshot.proxyAdmin); vm.stopBroadcast();