@@ -25,35 +25,39 @@ contract DeployScript is Script {
2525
2626 // 2. Upgrade the old router proxy to point to the new RouterV1 implementation
2727 address RouterProxyAddr = vm.envAddress ("PROXY_ADDRESS " );
28- // RouterV1 routerV1Proxy = RouterV1(RouterProxyAddr);
28+ RouterV1 routerV1Proxy = RouterV1 (RouterProxyAddr);
29+
30+ console.log ("Router Version: " , routerV1Proxy.VERSION ());
31+
32+ // 3. Attach to existing UUPS proxy (already initialized) and upgrade
2933 IUpgradeable (RouterProxyAddr).upgradeTo (address (routerV1Impl));
3034 console.log ("Upgraded Router proxy to RouterV1 implementation " );
3135
3236 // 3. Interact with the proxy as RouterV1
33- RouterV1 routerV1 = RouterV1 (RouterProxyAddr);
34- console.log ("Router Version: " , routerV1.VERSION ());
37+ // RouterV1 routerV1 = RouterV1(RouterProxyAddr);
3538
3639 // 4. Deploy the new storage proxy, pointing to the old storage contract
37- address storageContract = 0xF18e0C51ca77AcBe089789E6A761cA3700dc92df ;
40+ // address storageContract = 0xF18e0C51ca77AcBe089789E6A761cA3700dc92df;
41+ address storageContract = vm.envAddress ("STORAGE_ADDRESS " );
3842 ERC1967Proxy storageProxy =
3943 new ERC1967Proxy (storageContract, abi.encodeWithSelector (BlueprintV7 (storageContract).initialize.selector ));
4044 console.log ("Deployed storage proxy: " , address (storageProxy));
4145
4246 // 5. Deploy the Agent contract
43- Agent agent = new Agent (address (storageProxy), address (routerV1), routerV1 .VERSION ());
47+ Agent agent = new Agent (address (storageProxy), RouterProxyAddr, routerV1Proxy .VERSION ());
4448 console.log ("Deployed Agent: " , address (agent));
4549 console.log ("Agent Version: " , agent.VERSION ());
4650
4751 // deploy worker contract
48- Worker worker = new Worker (address (storageProxy), address (routerV1), routerV1 .VERSION ());
52+ Worker worker = new Worker (address (storageProxy), RouterProxyAddr, routerV1Proxy .VERSION ());
4953 console.log ("Deployed Worker: " , address (worker));
5054 console.log ("Worker Version: " , worker.VERSION ());
5155
5256 // 6. Set forward contracts in router
53- routerV1 .setForwardContracts (address (agent), address (storageProxy));
57+ routerV1Proxy .setForwardContracts (address (agent), address (storageProxy));
5458 console.log ("Set forward contracts in RouterV1 " );
5559 // set worker
56- routerV1 .setWorker (address (worker));
60+ routerV1Proxy .setWorker (address (worker));
5761 console.log ("Set Worker contract in RouterV1 " );
5862
5963 // 7. Set Agent contract in BlueprintV7 (via proxy)
0 commit comments