Skip to content

Commit 0be6c81

Browse files
committed
update DeployAmoyReceiver script
1 parent 23ead1a commit 0be6c81

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

script/DeployAmoyReceiver.s.sol

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.26;
33

4-
import {Script} from "forge-std/Script.sol";
4+
import {Script, console} from "forge-std/Script.sol";
55
import {AmoyReceiver} from "../src/AmoyReceiver.sol";
6+
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
67

78
contract DeployAmoyReceiver is Script {
89
address constant AMOY_ROUTER = 0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2;
910

1011
function run() public {
12+
address mostRecentlyDeployed = DevOpsTools.get_most_recent_deployment(
13+
"AmoyTokenTransfer",
14+
block.chainid
15+
);
16+
console.log("Most recently deployed address: ", mostRecentlyDeployed);
1117
AmoyReceiver amoyReceiver;
1218

1319
vm.startBroadcast();
14-
amoyReceiver = new AmoyReceiver(AMOY_ROUTER);
20+
amoyReceiver = new AmoyReceiver(AMOY_ROUTER, mostRecentlyDeployed);
1521
vm.stopBroadcast();
1622
}
1723
}

0 commit comments

Comments
 (0)