generated from ScopeLift/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
WormholeSender.sol
27 lines (21 loc) · 986 Bytes
/
WormholeSender.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {WormholeBase} from "src/WormholeBase.sol";
abstract contract WormholeSender is WormholeBase {
/// @notice The chain id that is receiving the messages.
uint16 public immutable TARGET_CHAIN;
/// @notice The chain id where refunds will be sent.
uint16 public immutable REFUND_CHAIN;
/// @notice The gas limit for cross chain transactions.
uint256 constant GAS_LIMIT = 500_000;
/// @param _refundChain The chain id of the chain sending the messages.
/// @param _targetChain The chain id of the chain receiving the messages.
constructor(uint16 _refundChain, uint16 _targetChain) {
REFUND_CHAIN = _refundChain;
TARGET_CHAIN = _targetChain;
}
/// @param targetChain The chain id of the chain receiving the messages.
function quoteDeliveryCost(uint16 targetChain) public virtual returns (uint256 cost) {
(cost,) = WORMHOLE_RELAYER.quoteEVMDeliveryPrice(targetChain, 0, GAS_LIMIT);
}
}