From b0ad5aac28a8dea22627eab79431934e713d6b97 Mon Sep 17 00:00:00 2001 From: efecarranza Date: Thu, 22 Feb 2024 15:04:22 -0500 Subject: [PATCH] chore: validate result of transfer --- .../AaveV3Ethereum_OrbitProgram_20240220.sol | 3 +++ .../AaveV3Ethereum_OrbitProgram_20240220.t.sol | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.sol b/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.sol index 518cb991c..cddddbf46 100644 --- a/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.sol +++ b/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.sol @@ -20,6 +20,8 @@ interface IWETH { * - Discussion: https://governance.aave.com/t/arfc-orbit-program-renewal/16550 */ contract AaveV3Ethereum_OrbitProgram_20240220 is IProposalGenericExecutor { + error EthTransferFailed(address account); + function execute() external { AaveV3Ethereum.COLLECTOR.transfer( AaveV3EthereumAssets.WETH_UNDERLYING, @@ -33,6 +35,7 @@ contract AaveV3Ethereum_OrbitProgram_20240220 is IProposalGenericExecutor { uint256 usageLength = usage.length; for (uint256 i = 0; i < usageLength; i++) { (bool ok, ) = usage[i].account.call{value: usage[i].usage}(''); + if (!ok) revert EthTransferFailed(usage[i].account); } uint256 actualStreamAmount = (OrbitProgramData.STREAM_AMOUNT / diff --git a/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.t.sol b/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.t.sol index 3024e8991..3f3e6198a 100644 --- a/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.t.sol +++ b/src/20240220_AaveV3Ethereum_OrbitProgram/AaveV3Ethereum_OrbitProgram_20240220.t.sol @@ -1,5 +1,4 @@ // SPDX-License-Identifier: MIT - pragma solidity ^0.8.0; import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';