Skip to content

Commit

Permalink
fix localnet
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Aug 9, 2024
1 parent 46d2dd1 commit a439eb1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion v2/scripts/localnet/EvmCall.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ contract EvmCallScript is Script {
// Encode the message
bytes memory message = abi.encode("hello");

RevertOptions memory revertOptions =
RevertOptions({ revertAddress: address(0x321), callOnRevert: true, abortAddress: address(0x321) });

// Call the function on GatewayEVM
try gatewayEVM.call(universalContractAddress, message) {
try gatewayEVM.call(universalContractAddress, message, revertOptions) {
console.log("TestUniversalContract called from EVM.");
} catch (bytes memory err) {
console.log("Error calling TestUniversalContract:");
Expand Down
6 changes: 5 additions & 1 deletion v2/scripts/localnet/EvmDepositAndCall.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ contract EvmDepositAndCallScript is Script {
// Encode the payload
bytes memory payload = abi.encode("hello");

RevertOptions memory revertOptions =
RevertOptions({ revertAddress: address(0x321), callOnRevert: true, abortAddress: address(0x321) });

// Call the depositAndCall function on GatewayEVM
try gatewayEVM.depositAndCall(
universalContractAddress,
amount,
erc20Address,
payload
payload,
revertOptions
) {
console.log("TestUniversalContract called from EVM.");
} catch (bytes memory err) {
Expand Down
5 changes: 4 additions & 1 deletion v2/scripts/localnet/ZevmCall.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ contract ZevmCallScript is Script {
flag
);

RevertOptions memory revertOptions =
RevertOptions({ revertAddress: address(0x321), callOnRevert: true, abortAddress: address(0x321) });

// Call the function on GatewayZEVM
try gatewayZEVM.call(abi.encodePacked(address(receiverEVM)), chainId, message) {
try gatewayZEVM.call(abi.encodePacked(address(receiverEVM)), chainId, message, revertOptions) {
console.log("ReceiverEVM called from ZEVM.");
} catch (bytes memory err) {
console.log("Error calling ReceiverEVM:");
Expand Down
6 changes: 5 additions & 1 deletion v2/scripts/localnet/ZevmWithdrawAndCall.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ contract ZevmWithdrawAndCallScript is Script {
flag
);

RevertOptions memory revertOptions =
RevertOptions({ revertAddress: address(0x321), callOnRevert: true, abortAddress: address(0x321) });

try gatewayZEVM.withdrawAndCall(
abi.encodePacked(receiverEVMAddress),
amount,
address(zrc20),
message
message,
revertOptions
) {
console.log("ReceiverEVM called from ZEVM.");
} catch (bytes memory err) {
Expand Down

0 comments on commit a439eb1

Please sign in to comment.