@@ -25,14 +25,16 @@ import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgrad
25
25
// Utils
26
26
import "../../extension/Multicall.sol " ;
27
27
import "../../lib/FeeType.sol " ;
28
+ import "../../extension/upgradeable/ReentrancyGuard.sol " ;
28
29
29
30
contract Split is
30
31
IThirdwebContract ,
31
32
Initializable ,
32
33
Multicall ,
33
34
ERC2771ContextUpgradeable ,
34
35
AccessControlEnumerableUpgradeable ,
35
- PaymentSplitterUpgradeable
36
+ PaymentSplitterUpgradeable ,
37
+ ReentrancyGuard
36
38
{
37
39
bytes32 private constant MODULE_TYPE = bytes32 ("Split " );
38
40
uint128 private constant VERSION = 1 ;
@@ -76,7 +78,7 @@ contract Split is
76
78
* @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the
77
79
* total shares and their previous withdrawals.
78
80
*/
79
- function release (address payable account ) public virtual override {
81
+ function release (address payable account ) public virtual override nonReentrant {
80
82
uint256 payment = _release (account);
81
83
require (payment != 0 , "PaymentSplitter: account is not due payment " );
82
84
}
@@ -86,7 +88,7 @@ contract Split is
86
88
* percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20
87
89
* contract.
88
90
*/
89
- function release (IERC20Upgradeable token , address account ) public virtual override {
91
+ function release (IERC20Upgradeable token , address account ) public virtual override nonReentrant {
90
92
uint256 payment = _release (token, account);
91
93
require (payment != 0 , "PaymentSplitter: account is not due payment " );
92
94
}
@@ -134,7 +136,7 @@ contract Split is
134
136
/**
135
137
* @dev Release the owed amount of token to all of the payees.
136
138
*/
137
- function distribute () public virtual {
139
+ function distribute () public virtual nonReentrant {
138
140
uint256 count = payeeCount ();
139
141
for (uint256 i = 0 ; i < count; i++ ) {
140
142
_release (payable (payee (i)));
@@ -144,7 +146,7 @@ contract Split is
144
146
/**
145
147
* @dev Release owed amount of the `token` to all of the payees.
146
148
*/
147
- function distribute (IERC20Upgradeable token ) public virtual {
149
+ function distribute (IERC20Upgradeable token ) public virtual nonReentrant {
148
150
uint256 count = payeeCount ();
149
151
for (uint256 i = 0 ; i < count; i++ ) {
150
152
_release (token, payee (i));
0 commit comments