Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Required gas, events, reentrancy, go linter #66

Merged
merged 14 commits into from
Apr 5, 2024
Prev Previous commit
Next Next commit
comment updates
Matthew Lam committed Apr 5, 2024
commit 7b5879d583c6753d47a56a7b2d9a22f35a780ba9
5 changes: 4 additions & 1 deletion contracts/src/TeleporterTokenDestination.sol
Original file line number Diff line number Diff line change
@@ -34,7 +34,10 @@ abstract contract TeleporterTokenDestination is
/// @notice The ERC20 token this contract uses to pay for Teleporter fees.
address public immutable feeTokenAddress;

/// @notice Required gas limit for sending tokens back to the source blockchain.
/**
* @notice Fixed gas cost for performing a multihop transfer on the `sourceBlockchainID`
* , before forwarding to the final destination bridge instance.
*/
uint256 public constant MULTIHOP_REQUIRED_GAS = 220_000;

/**
4 changes: 3 additions & 1 deletion contracts/src/interfaces/ITeleporterTokenBridge.sol
Original file line number Diff line number Diff line change
@@ -19,7 +19,9 @@ import {ITeleporterReceiver} from "@teleporter/ITeleporterReceiver.sol";
* @param recipient address of the recipient on the destination chain
* @param primaryFee amount of tokens to pay for Teleporter fee on the source chain
* @param secondaryFee amount of tokens to pay for Teleporter fee if a multihop is needed
* @param requiredGasLimit gas limit requirement for sending to a destination token bridge
* @param requiredGasLimit gas limit requirement for sending to a token bridge.
* This is required because the gas requirement varies based on the token bridge instance
* specified by `destinationBlockchainID` and `destinationBridgeAddress`.
*/
struct SendTokensInput {
bytes32 destinationBlockchainID;