Skip to content

Commit d9360d3

Browse files
committed
deploy scrit upgrade
1 parent cc41421 commit d9360d3

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

src/RouterV1.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contract RouterV1 is Initializable, OwnableUpgradeable, UUPSUpgradeable, Payment
2020
function initialize() public reinitializer(1) {
2121
__UUPSUpgradeable_init();
2222
__Ownable_init(msg.sender);
23-
VERSION = "7.0.0";
23+
VERSION = "1.0.0";
2424
}
2525

2626
function setForwardContracts(address _agent, address _blueprint) external onlyOwner {

0 commit comments

Comments
 (0)