diff --git a/src/Treasury.sol b/src/Treasury.sol index 1ae4f05..3094213 100644 --- a/src/Treasury.sol +++ b/src/Treasury.sol @@ -152,7 +152,8 @@ contract Treasury is Initializable, UUPSUpgradeable, OwnableUpgradeable { (bool success,) = request.to.call{value: request.amount}(""); if (!success) revert TransferFailed(); } else { - IERC20(request.token).transfer(request.to, request.amount); + bool success = IERC20(request.token).transfer(request.to, request.amount); + if (!success) revert TransferFailed(); } emit WithdrawalExecuted(requestId); diff --git a/src/escrow/SafeBaseEscrowV1.sol b/src/escrow/SafeBaseEscrowV1.sol index 29be600..9efac3d 100644 --- a/src/escrow/SafeBaseEscrowV1.sol +++ b/src/escrow/SafeBaseEscrowV1.sol @@ -155,8 +155,9 @@ contract SafeBaseEscrowV1 is emit EscrowCreated(escrowId, msg.sender, _seller, _token, _amount, _deadline); - if (registry != address(0)) { - IRegistry(registry).indexEscrow(escrowId, msg.sender, _seller, _amount, block.timestamp); + address registry_ = registry; + if (registry_ != address(0)) { + IRegistry(registry_).indexEscrow(escrowId, msg.sender, _seller, _amount, block.timestamp); } return escrowId; @@ -369,8 +370,9 @@ contract SafeBaseEscrowV1 is function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} function _updateRegistryState(uint256 _escrowId) internal { - if (registry != address(0)) { - IRegistry(registry).updateEscrowState(_escrowId, uint8(escrows[_escrowId].state)); + address registry_ = registry; + if (registry_ != address(0)) { + IRegistry(registry_).updateEscrowState(_escrowId, uint8(escrows[_escrowId].state)); } }