11// SPDX-License-Identifier: Apache-2.0
22pragma solidity ^ 0.8.11 ;
33
4- // Thirdweb top-level
5- import "./interfaces/ITWFee.sol " ;
6-
74// Base
85import "./openzeppelin-presets/finance/PaymentSplitterUpgradeable.sol " ;
96import "./interfaces/IThirdwebContract.sol " ;
@@ -32,15 +29,10 @@ contract Split is
3229 /// @dev Max bps in the thirdweb system
3330 uint128 private constant MAX_BPS = 10_000 ;
3431
35- /// @dev The thirdweb contract with fee related information.
36- ITWFee public immutable thirdwebFee;
37-
3832 /// @dev Contract level metadata.
3933 string public contractURI;
4034
41- constructor (address _thirdwebFee ) initializer {
42- thirdwebFee = ITWFee (_thirdwebFee);
43- }
35+ constructor () initializer {}
4436
4537 /// @dev Performs the job of the constructor.
4638 /// @dev shares_ are scaled by 10,000 to prevent precision loss when including fees
@@ -102,15 +94,7 @@ contract Split is
10294 _released[account] += payment;
10395 _totalReleased += payment;
10496
105- // fees
106- uint256 fee = 0 ;
107- (address feeRecipient , uint256 feeBps ) = thirdwebFee.getFeeInfo (address (this ), FeeType.SPLIT);
108- if (feeRecipient != address (0 ) && feeBps > 0 ) {
109- fee = (payment * feeBps) / MAX_BPS;
110- AddressUpgradeable.sendValue (payable (feeRecipient), fee);
111- }
112-
113- AddressUpgradeable.sendValue (account, payment - fee);
97+ AddressUpgradeable.sendValue (account, payment);
11498 emit PaymentReleased (account, payment);
11599
116100 return payment;
@@ -130,15 +114,7 @@ contract Split is
130114 _erc20Released[token][account] += payment;
131115 _erc20TotalReleased[token] += payment;
132116
133- // fees
134- uint256 fee = 0 ;
135- (address feeRecipient , uint256 feeBps ) = thirdwebFee.getFeeInfo (address (this ), FeeType.SPLIT);
136- if (feeRecipient != address (0 ) && feeBps > 0 ) {
137- fee = (payment * feeBps) / MAX_BPS;
138- SafeERC20Upgradeable.safeTransfer (token, feeRecipient, fee);
139- }
140-
141- SafeERC20Upgradeable.safeTransfer (token, account, payment - fee);
117+ SafeERC20Upgradeable.safeTransfer (token, account, payment);
142118 emit ERC20PaymentReleased (token, account, payment);
143119
144120 return payment;
0 commit comments