Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
Add script to submit encrypted transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
jannikluhn committed Apr 2, 2024
1 parent 9b6d14b commit 4e3d522
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions script/submitTransaction.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "forge-std/Script.sol";
import "../src/Sequencer.sol";

contract SubmitTransaction is Script {
function run() external {
uint256 privateKey = vm.envUint("TX_SENDER_KEY");
Sequencer sequencer = Sequencer(vm.envAddress("SEQUENCER_ADDRESS"));
uint64 eon = uint64(vm.envUint("EON"));
bytes32 identityPrefix = vm.envBytes32("IDENTITY_PREFIX");
bytes memory encryptedTransaction = vm.envBytes(
"ENCRYPTED_TRANSACTION"
);
uint64 gasLimit = uint64(vm.envUint("GAS_LIMIT"));

vm.startBroadcast(privateKey);
sequencer.submitEncryptedTransaction{value: 0.0001 ether}(
eon,
identityPrefix,
encryptedTransaction,
gasLimit
);
vm.stopBroadcast();
}
}

0 comments on commit 4e3d522

Please sign in to comment.