Selaa lähdekoodia

Use Address.sendValue instead of address.transfer in RefundEscrow (#2480)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Hadrien Croubois 4 vuotta sitten
vanhempi
sitoutus
0931062a3f
2 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 1 0
      CHANGELOG.md
  2. 1 1
      contracts/payment/escrow/RefundEscrow.sol

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@
  * `SafeMath`: fix a memory allocation issue by adding new `SafeMath.tryOp(uint,uint)→(bool,uint)` functions. `SafeMath.op(uint,uint,string)→uint` are now deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))
  * `EnumerableMap`: fix a memory allocation issue by adding new `EnumerableMap.tryGet(uint)→(bool,address)` functions. `EnumerableMap.get(uint)→string` is now deprecated. ([#2462](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2462))
  * `ERC165Checker`: added batch `getSupportedInterfaces`. ([#2469](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2469))
+ * `RefundEscrow`: `beneficiaryWithdraw` will forward all available gas to the beneficiary. ([#2480](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2480))
 
 ### Security Fixes
 

+ 1 - 1
contracts/payment/escrow/RefundEscrow.sol

@@ -80,7 +80,7 @@ contract RefundEscrow is ConditionalEscrow {
      */
     function beneficiaryWithdraw() public virtual {
         require(_state == State.Closed, "RefundEscrow: beneficiary can only withdraw while closed");
-        _beneficiary.transfer(address(this).balance);
+        _beneficiary.sendValue(address(this).balance);
     }
 
     /**