Skip to content

Commit 747a6cb

Browse files
committed
add GetSignedMessage script for retrieving and logging signed messages from AmoyReceiver contract
1 parent 73c1e94 commit 747a6cb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

script/GetSignedMessage.s.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity 0.8.26;
3+
4+
import {Script, console} from "forge-std/Script.sol";
5+
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
6+
import {AmoyReceiver} from "../src/AmoyReceiver.sol";
7+
8+
contract GetSignedMessage is Script {
9+
AmoyReceiver amoyReceiver;
10+
11+
function getSignedMessage(address mostRecentlyDeployed) public {
12+
amoyReceiver = AmoyReceiver(mostRecentlyDeployed);
13+
bytes memory signedMessage = amoyReceiver.getSignedMessage();
14+
console.log("Signed message: ");
15+
console.logBytes(signedMessage);
16+
}
17+
18+
function run() public {
19+
address mostRecentlyDeployed = DevOpsTools.get_most_recent_deployment(
20+
"AmoyReceiver",
21+
block.chainid
22+
);
23+
console.log("Most recently deployed address: ", mostRecentlyDeployed);
24+
25+
getSignedMessage(mostRecentlyDeployed);
26+
}
27+
}

0 commit comments

Comments
 (0)