Skip to content

Commit c4a3737

Browse files
Rahul MagantiRahulMaganti47
Rahul Maganti
authored andcommittedFeb 26, 2024·
add useful event info
1 parent bdc8a23 commit c4a3737

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed
 

‎evm/src/NttManager.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ contract NttManager is
557557
recipientChain, priceQuotes, instructions, enabledTransceivers, encodedNttManagerPayload
558558
);
559559

560-
emit TransferSent(recipient, _nttUntrim(amount), recipientChain, seq);
560+
emit TransferSent(recipient, _nttUntrim(amount), msg.value, recipientChain, seq);
561561

562562
// return the sequence number
563563
return sequence;

‎evm/src/WormholeTransceiver.sol

+11
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
4141
bool shouldSkipRelayerSend;
4242
}
4343

44+
enum RelayingType {
45+
Standard,
46+
Special,
47+
Manual
48+
}
49+
4450
/// =============== STORAGE ===============================================
4551

4652
bytes32 private constant WORMHOLE_CONSUMED_VAAS_SLOT =
@@ -216,14 +222,19 @@ contract WormholeTransceiver is Transceiver, IWormholeTransceiver, IWormholeRece
216222
0,
217223
GAS_LIMIT
218224
);
225+
226+
emit RelayingInfo(uint8(RelayingType.Standard), deliveryPayment);
219227
} else if (!weIns.shouldSkipRelayerSend && isSpecialRelayingEnabled(recipientChain)) {
220228
uint64 sequence =
221229
wormhole.publishMessage(0, encodedTransceiverPayload, consistencyLevel);
222230
specialRelayer.requestDelivery{value: deliveryPayment}(
223231
getNttManagerToken(), recipientChain, 0, sequence
224232
);
233+
234+
emit RelayingInfo(uint8(RelayingType.Special), deliveryPayment);
225235
} else {
226236
wormhole.publishMessage(0, encodedTransceiverPayload, consistencyLevel);
237+
emit RelayingInfo(uint8(RelayingType.Manual), deliveryPayment);
227238
}
228239

229240
emit SendTransceiverMessage(recipientChain, transceiverMessage);

‎evm/src/interfaces/INttManagerEvents.sol

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import "../libraries/TrimmedAmount.sol";
66
interface INttManagerEvents {
77
/// @notice Emitted when a message is sent from the nttManager.
88
/// @dev Topic0
9-
/// 0x71ec1d4b53baa86365b6523ea136c9fe0f72c36c721e7e28e9efac2c23b39d98.
9+
/// 0x9716fe52fe4e02cf924ae28f19f5748ef59877c6496041b986fbad3dae6a8ecf
1010
/// @param recipient The recipient of the message.
1111
/// @param amount The amount transferred.
12+
/// @param fee The amount of ether sent along with the tx to cover the delivery fee.
1213
/// @param recipientChain The chain ID of the recipient.
1314
/// @param msgSequence The unique sequence ID of the message.
1415
event TransferSent(
15-
bytes32 recipient, uint256 amount, uint16 recipientChain, uint64 msgSequence
16+
bytes32 recipient, uint256 amount, uint256 fee, uint16 recipientChain, uint64 msgSequence
1617
);
1718

1819
/// @notice Emitted when the peer contract is updated.
@@ -66,5 +67,5 @@ interface INttManagerEvents {
6667
/// @dev Topic0
6768
/// 0x504e6efe18ab9eed10dc6501a417f5b12a2f7f2b1593aed9b89f9bce3cf29a91.
6869
/// @param digest The digest of the message.
69-
event TransferRedeemed(bytes32 digest);
70+
event TransferRedeemed(bytes32 indexed digest);
7071
}

‎evm/src/interfaces/IWormholeTransceiver.sol

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface IWormholeTransceiver {
1212
event SendTransceiverMessage(
1313
uint16 recipientChain, TransceiverStructs.TransceiverMessage message
1414
);
15+
event RelayingInfo(uint8 relayingType, uint256 deliveryPayment);
1516
event SetWormholePeer(uint16 chainId, bytes32 peerContract);
1617
event SetIsWormholeRelayingEnabled(uint16 chainId, bool isRelayingEnabled);
1718
event SetIsSpecialRelayingEnabled(uint16 chainId, bool isRelayingEnabled);

0 commit comments

Comments
 (0)
Please sign in to comment.