Skip to content

Commit

Permalink
Use Address.sendValue for PaymentSplitter (#2456)
Browse files Browse the repository at this point in the history
* use Address.sendValue instead of .transfer

* changelog entry

Co-authored-by: Hadrien Croubois <hadrien@openzeppelin.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
  • Loading branch information
3 people authored Jan 7, 2021
1 parent 1e8cb4b commit b6e5187
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* `ERC20Permit`: added an implementation of the ERC20 permit extension for gasless token approvals. ([#2237](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2237))
* Presets: added token presets with preminted fixed supply `ERC20PresetFixedSupply` and `ERC777PresetFixedSupply`. ([#2399](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2399))
* `Address`: added `functionDelegateCall`, similar to the existing `functionCall`. ([#2333](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2333))
* `PaymentSplitter`: replace usage of `.transfer()` with `Address.sendValue` for improved compatibility with smart wallets. ([#2455](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2455))
* `UpgradeableProxy`: bubble revert reasons from initialization calls. ([#2454](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2454))

## 3.3.0 (2020-11-26)
Expand Down
3 changes: 2 additions & 1 deletion contracts/payment/PaymentSplitter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity >=0.6.0 <0.8.0;

import "../GSN/Context.sol";
import "../math/SafeMath.sol";
import "../utils/Address.sol";

/**
* @title PaymentSplitter
Expand Down Expand Up @@ -112,7 +113,7 @@ contract PaymentSplitter is Context {
_released[account] = _released[account].add(payment);
_totalReleased = _totalReleased.add(payment);

account.transfer(payment);
Address.sendValue(account, payment);
emit PaymentReleased(account, payment);
}

Expand Down

0 comments on commit b6e5187

Please sign in to comment.