Skip to content

Commit ce88d05

Browse files
Rahul MagantiRahulMaganti47
Rahul Maganti
authored andcommitted
Manager: emit event after a transfer is redeemed
1 parent 2650cb7 commit ce88d05

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

evm/src/Manager.sol

+9-3
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ contract Manager is
643643
// by the same amount (we call this "backflow")
644644
_backfillOutboundAmount(nativeTransferAmount);
645645

646-
_mintOrUnlockToRecipient(transferRecipient, nativeTransferAmount);
646+
_mintOrUnlockToRecipient(digest, transferRecipient, nativeTransferAmount);
647647
}
648648

649649
function completeInboundQueuedTransfer(bytes32 digest) external nonReentrant whenNotPaused {
@@ -662,14 +662,20 @@ contract Manager is
662662
delete _getInboundQueueStorage()[digest];
663663

664664
// run it through the mint/unlock logic
665-
_mintOrUnlockToRecipient(queuedTransfer.recipient, queuedTransfer.amount);
665+
_mintOrUnlockToRecipient(digest, queuedTransfer.recipient, queuedTransfer.amount);
666666
}
667667

668-
function _mintOrUnlockToRecipient(address recipient, NormalizedAmount memory amount) internal {
668+
function _mintOrUnlockToRecipient(
669+
bytes32 digest,
670+
address recipient,
671+
NormalizedAmount memory amount
672+
) internal {
669673
// calculate proper amount of tokens to unlock/mint to recipient
670674
// denormalize the amount
671675
uint256 denormalizedAmount = nttDenormalize(amount);
672676

677+
emit TransferRedeemed(digest);
678+
673679
if (mode == Mode.LOCKING) {
674680
// unlock tokens to the specified recipient
675681
IERC20(token).safeTransfer(recipient, denormalizedAmount);

evm/src/interfaces/IManagerEvents.sol

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ interface IManagerEvents {
1515
event EndpointAdded(address endpoint, uint256 endpointsNum, uint8 threshold);
1616
event EndpointRemoved(address endpoint, uint8 threshold);
1717
event MessageAlreadyExecuted(bytes32 indexed sourceManager, bytes32 indexed msgHash);
18+
event TransferRedeemed(bytes32 digest);
1819
}

0 commit comments

Comments
 (0)