-
Notifications
You must be signed in to change notification settings - Fork 42
Replaced explicit warp contract in TeleporterMessenger to use an inte… #891
base: bat/avalanche-contract-folder-refactor
Are you sure you want to change the base?
Replaced explicit warp contract in TeleporterMessenger to use an inte… #891
Conversation
| require( | ||
| teleporterMessage.destinationBlockchainID == blockchainID_, | ||
| "TeleporterMessenger: invalid destination chain ID" | ||
| ); |
Check notice
Code scanning / Semgrep PRO
Semgrep Finding: solidity.performance.use-custom-error-not-require.use-custom-error-not-require Note
| require( | ||
| teleporterMessage.destinationBlockchainID == blockchainID_, | ||
| "TeleporterMessenger: invalid destination chain ID" | ||
| ); |
Check notice
Code scanning / Semgrep PRO
Semgrep Finding: solidity.performance.use-short-revert-string.use-short-revert-string Note
| ); | ||
|
|
||
| // Require that the message has not been received previously. | ||
| require(!_messageReceived(messageID), "TeleporterMessenger: message already received"); |
Check notice
Code scanning / Semgrep PRO
Semgrep Finding: solidity.performance.use-custom-error-not-require.use-custom-error-not-require Note
| ); | ||
|
|
||
| // Require that the message has not been received previously. | ||
| require(!_messageReceived(messageID), "TeleporterMessenger: message already received"); |
Check notice
Code scanning / Semgrep PRO
Semgrep Finding: solidity.performance.use-short-revert-string.use-short-revert-string Note
| require( | ||
| _checkIsAllowedRelayer(msg.sender, teleporterMessage.allowedRelayerAddresses), | ||
| "TeleporterMessenger: unauthorized relayer" | ||
| ); |
Check notice
Code scanning / Semgrep PRO
Semgrep Finding: solidity.performance.use-custom-error-not-require.use-custom-error-not-require Note
| require( | ||
| _checkIsAllowedRelayer(msg.sender, teleporterMessage.allowedRelayerAddresses), | ||
| "TeleporterMessenger: unauthorized relayer" | ||
| ); |
Check notice
Code scanning / Semgrep PRO
Semgrep Finding: solidity.performance.use-short-revert-string.use-short-revert-string Note
| // Process the receipts that were included in the teleporter message by paying the | ||
| // fee for the messages are reward to the given relayers. | ||
| uint256 length = teleporterMessage.receipts.length; | ||
| for (uint256 i; i < length; ++i) { |
Check notice
Code scanning / Semgrep PRO
Semgrep Finding: solidity.performance.unnecessary-checked-arithmetic-in-loop.unnecessary-checked-arithmetic-in-loop Note
f81a637 to
5e9ffa6
Compare
cf90012 to
d66d980
Compare
882f519 to
e5d7280
Compare
9b47031 to
3f66bc2
Compare
| uint256 amount; | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add brief documentation to these structs to keep it consistent with the repo's style and potentially explain the motivation for the ICMMessage type given the lack of access lists on Ethereum
| @@ -0,0 +1,27 @@ | |||
| // (c) 2025, Ava Labs, Inc. All rights reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this code live in the avalanche/... directory? As fas as I understand, contracts implementing IWarpExt should live on external chains that don't have access lists?
This PR replaces the explicit Warp contract in the TeleporterMessenger contracts with an interface. An implimentation of this interface is provided that works identically for internal interop. It is built on top of #888