Skip to content

Commit

Permalink
link transfer status (#13177)
Browse files Browse the repository at this point in the history
  • Loading branch information
shileiwill committed May 20, 2024
1 parent 5169bee commit 0d58a8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-squids-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

link transfer status check #bugfix
5 changes: 5 additions & 0 deletions contracts/.changeset/smooth-years-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chainlink/contracts": patch
---

link transfer status check #bugfix
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract AutomationRegistryLogicC2_3 is AutomationRegistryBase2_3 {
}

/**
* @notice withdraws LINK received as payment for work performed
* @notice this is for NOPs to withdraw LINK received as payment for work performed
*/
function withdrawPayment(address from, address to) external {
if (to == ZERO_ADDRESS) revert InvalidRecipient();
Expand All @@ -78,7 +78,10 @@ contract AutomationRegistryLogicC2_3 is AutomationRegistryBase2_3 {
uint96 balance = _updateTransmitterBalanceFromPool(from, s_hotVars.totalPremium, uint96(s_transmittersList.length));
s_transmitters[from].balance = 0;
s_reserveAmounts[IERC20(address(i_link))] = s_reserveAmounts[IERC20(address(i_link))] - balance;
i_link.transfer(to, balance);
bool transferStatus = i_link.transfer(to, balance);
if (!transferStatus) {
revert TransferFailed();
}
emit PaymentWithdrawn(from, balance, to, msg.sender);
}

Expand Down

0 comments on commit 0d58a8d

Please sign in to comment.