From 0d58a8d5db24f42720226e73328e501637ba59c5 Mon Sep 17 00:00:00 2001 From: Lei Date: Mon, 20 May 2024 12:11:09 -0700 Subject: [PATCH] link transfer status (#13177) --- .changeset/gorgeous-squids-laugh.md | 5 +++++ contracts/.changeset/smooth-years-reply.md | 5 +++++ .../automation/dev/v2_3/AutomationRegistryLogicC2_3.sol | 7 +++++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .changeset/gorgeous-squids-laugh.md create mode 100644 contracts/.changeset/smooth-years-reply.md diff --git a/.changeset/gorgeous-squids-laugh.md b/.changeset/gorgeous-squids-laugh.md new file mode 100644 index 00000000000..3cabb9d7850 --- /dev/null +++ b/.changeset/gorgeous-squids-laugh.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +link transfer status check #bugfix diff --git a/contracts/.changeset/smooth-years-reply.md b/contracts/.changeset/smooth-years-reply.md new file mode 100644 index 00000000000..330310cb8d6 --- /dev/null +++ b/contracts/.changeset/smooth-years-reply.md @@ -0,0 +1,5 @@ +--- +"@chainlink/contracts": patch +--- + +link transfer status check #bugfix diff --git a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicC2_3.sol b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicC2_3.sol index 838e05353c8..248cfcde948 100644 --- a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicC2_3.sol +++ b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicC2_3.sol @@ -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(); @@ -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); }