Skip to content

Commit 4e3d522

Browse files
committed
Add script to submit encrypted transactions
1 parent 9b6d14b commit 4e3d522

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

script/submitTransaction.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.20;
3+
4+
import "forge-std/Script.sol";
5+
import "../src/Sequencer.sol";
6+
7+
contract SubmitTransaction is Script {
8+
function run() external {
9+
uint256 privateKey = vm.envUint("TX_SENDER_KEY");
10+
Sequencer sequencer = Sequencer(vm.envAddress("SEQUENCER_ADDRESS"));
11+
uint64 eon = uint64(vm.envUint("EON"));
12+
bytes32 identityPrefix = vm.envBytes32("IDENTITY_PREFIX");
13+
bytes memory encryptedTransaction = vm.envBytes(
14+
"ENCRYPTED_TRANSACTION"
15+
);
16+
uint64 gasLimit = uint64(vm.envUint("GAS_LIMIT"));
17+
18+
vm.startBroadcast(privateKey);
19+
sequencer.submitEncryptedTransaction{value: 0.0001 ether}(
20+
eon,
21+
identityPrefix,
22+
encryptedTransaction,
23+
gasLimit
24+
);
25+
vm.stopBroadcast();
26+
}
27+
}

0 commit comments

Comments
 (0)