@@ -16,26 +16,30 @@ import "./Errors.sol";
16
16
import {State} from "./State.sol " ;
17
17
18
18
import "src/interfaces/IRedeemFill.sol " ;
19
+ import "src/interfaces/ITokenRouterEvents.sol " ;
19
20
20
- abstract contract RedeemFill is IRedeemFill , Admin , State {
21
+ abstract contract RedeemFill is IRedeemFill , ITokenRouterEvents , Admin , State {
21
22
using Messages for * ;
22
23
using Utils for * ;
23
24
24
25
/// @inheritdoc IRedeemFill
25
- function redeemFill (OrderResponse calldata response ) external returns (RedeemedFill memory ) {
26
- uint16 emitterChain = response.encodedWormholeMessage. unsafeEmitterChainFromVaa ();
27
- bytes32 emitterAddress = response.encodedWormholeMessage.unsafeEmitterAddressFromVaa ();
26
+ function redeemFill (OrderResponse calldata response ) external returns (RedeemedFill memory fill ) {
27
+ (, uint16 emitterChain , bytes32 emitterAddress , uint64 sequence ) =
28
+ response.encodedWormholeMessage.unsafeVaaKeyFromVaa ();
28
29
29
30
// If the emitter is the matching engine, and this TokenRouter is on the same chain
30
31
// as the matching engine, then this is a fast fill.
32
+
31
33
if (
32
34
(emitterChain == _matchingEngineChain && _chainId == _matchingEngineChain)
33
35
&& emitterAddress == _matchingEngineAddress
34
36
) {
35
- return _handleFastFill (response.encodedWormholeMessage);
37
+ fill = _handleFastFill (response.encodedWormholeMessage);
36
38
} else {
37
- return _handleFill (emitterChain, response);
39
+ fill = _handleFill (emitterChain, response);
38
40
}
41
+
42
+ emit FillRedeemed (emitterChain, emitterAddress, sequence);
39
43
}
40
44
41
45
// ------------------------------- Private ---------------------------------
0 commit comments