@@ -25,14 +25,16 @@ import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgrad
2525// Utils
2626import "../../extension/Multicall.sol " ;
2727import "../../lib/FeeType.sol " ;
28+ import "../../extension/upgradeable/ReentrancyGuard.sol " ;
2829
2930contract Split is
3031 IThirdwebContract ,
3132 Initializable ,
3233 Multicall ,
3334 ERC2771ContextUpgradeable ,
3435 AccessControlEnumerableUpgradeable ,
35- PaymentSplitterUpgradeable
36+ PaymentSplitterUpgradeable ,
37+ ReentrancyGuard
3638{
3739 bytes32 private constant MODULE_TYPE = bytes32 ("Split " );
3840 uint128 private constant VERSION = 1 ;
@@ -76,7 +78,7 @@ contract Split is
7678 * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the
7779 * total shares and their previous withdrawals.
7880 */
79- function release (address payable account ) public virtual override {
81+ function release (address payable account ) public virtual override nonReentrant {
8082 uint256 payment = _release (account);
8183 require (payment != 0 , "PaymentSplitter: account is not due payment " );
8284 }
@@ -86,7 +88,7 @@ contract Split is
8688 * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20
8789 * contract.
8890 */
89- function release (IERC20Upgradeable token , address account ) public virtual override {
91+ function release (IERC20Upgradeable token , address account ) public virtual override nonReentrant {
9092 uint256 payment = _release (token, account);
9193 require (payment != 0 , "PaymentSplitter: account is not due payment " );
9294 }
@@ -134,7 +136,7 @@ contract Split is
134136 /**
135137 * @dev Release the owed amount of token to all of the payees.
136138 */
137- function distribute () public virtual {
139+ function distribute () public virtual nonReentrant {
138140 uint256 count = payeeCount ();
139141 for (uint256 i = 0 ; i < count; i++ ) {
140142 _release (payable (payee (i)));
@@ -144,7 +146,7 @@ contract Split is
144146 /**
145147 * @dev Release owed amount of the `token` to all of the payees.
146148 */
147- function distribute (IERC20Upgradeable token ) public virtual {
149+ function distribute (IERC20Upgradeable token ) public virtual nonReentrant {
148150 uint256 count = payeeCount ();
149151 for (uint256 i = 0 ; i < count; i++ ) {
150152 _release (token, payee (i));
0 commit comments