Skip to content

Commit 9bffd76

Browse files
committed
remove thirdwebfee
1 parent 585ed8e commit 9bffd76

File tree

7 files changed

+19
-43
lines changed

7 files changed

+19
-43
lines changed

contracts/drop/DropERC1155.sol

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ contract DropERC1155 is
7272
/// @dev Max bps in the thirdweb system
7373
uint256 private constant MAX_BPS = 10_000;
7474

75-
/// @dev The thirdweb contract with fee related information.
76-
ITWFee private immutable thirdwebFee;
77-
7875
/// @dev Owner of the contract (purpose: OpenSea compatibility)
7976
address private _owner;
8077

@@ -137,9 +134,7 @@ contract DropERC1155 is
137134
Constructor + initializer logic
138135
//////////////////////////////////////////////////////////////*/
139136

140-
constructor(address _thirdwebFee) initializer {
141-
thirdwebFee = ITWFee(_thirdwebFee);
142-
}
137+
constructor() initializer {}
143138

144139
/// @dev Initiliazes the contract, like a constructor.
145140
function initialize(
@@ -403,17 +398,14 @@ contract DropERC1155 is
403398

404399
uint256 totalPrice = _quantityToClaim * _pricePerToken;
405400
uint256 platformFees = (totalPrice * platformFeeBps) / MAX_BPS;
406-
(address twFeeRecipient, uint256 twFeeBps) = thirdwebFee.getFeeInfo(address(this), FeeType.PRIMARY_SALE);
407-
uint256 twFee = (totalPrice * twFeeBps) / MAX_BPS;
408401

409402
if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
410403
require(msg.value == totalPrice, "must send total price.");
411404
}
412405

413406
address recipient = saleRecipient[_tokenId] == address(0) ? primarySaleRecipient : saleRecipient[_tokenId];
414407
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), platformFeeRecipient, platformFees);
415-
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), twFeeRecipient, twFee);
416-
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), recipient, totalPrice - platformFees - twFee);
408+
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), recipient, totalPrice - platformFees);
417409
}
418410

419411
/// @dev Transfers the NFTs being claimed.

contracts/drop/DropERC20.sol

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ contract DropERC20 is
5656
/// @dev Only transfers to or from TRANSFER_ROLE holders are valid, when transfers are restricted.
5757
bytes32 private constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
5858

59-
/// @dev The thirdweb contract with fee related information.
60-
ITWFee private immutable thirdwebFee;
61-
6259
/// @dev Contract level metadata.
6360
string public contractURI;
6461

@@ -94,9 +91,7 @@ contract DropERC20 is
9491
Constructor + initializer logic
9592
//////////////////////////////////////////////////////////////*/
9693

97-
constructor(address _thirdwebFee) initializer {
98-
thirdwebFee = ITWFee(_thirdwebFee);
99-
}
94+
constructor() initializer {}
10095

10196
/// @dev Initiliazes the contract, like a constructor.
10297
function initialize(
@@ -319,20 +314,17 @@ contract DropERC20 is
319314
// `_pricePerToken` is interpreted as price per 1 ether unit of the ERC20 tokens.
320315
uint256 totalPrice = (_quantityToClaim * _pricePerToken) / 1 ether;
321316
uint256 platformFees = (totalPrice * platformFeeBps) / MAX_BPS;
322-
(address twFeeRecipient, uint256 twFeeBps) = thirdwebFee.getFeeInfo(address(this), FeeType.PRIMARY_SALE);
323-
uint256 twFee = (totalPrice * twFeeBps) / MAX_BPS;
324317

325318
if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
326319
require(msg.value == totalPrice, "must send total price.");
327320
}
328321

329322
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), platformFeeRecipient, platformFees);
330-
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), twFeeRecipient, twFee);
331323
CurrencyTransferLib.transferCurrency(
332324
_currency,
333325
_msgSender(),
334326
primarySaleRecipient,
335-
totalPrice - platformFees - twFee
327+
totalPrice - platformFees
336328
);
337329
}
338330

contracts/drop/DropERC721.sol

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ contract DropERC721 is
6464
/// @dev Max bps in the thirdweb system.
6565
uint256 private constant MAX_BPS = 10_000;
6666

67-
/// @dev The thirdweb contract with fee related information.
68-
ITWFee private immutable thirdwebFee;
69-
7067
/// @dev Owner of the contract (purpose: OpenSea compatibility)
7168
address private _owner;
7269

@@ -132,9 +129,7 @@ contract DropERC721 is
132129
Constructor + initializer logic
133130
//////////////////////////////////////////////////////////////*/
134131

135-
constructor(address _thirdwebFee) initializer {
136-
thirdwebFee = ITWFee(_thirdwebFee);
137-
}
132+
constructor() initializer {}
138133

139134
/// @dev Initiliazes the contract, like a constructor.
140135
function initialize(
@@ -459,20 +454,17 @@ contract DropERC721 is
459454

460455
uint256 totalPrice = _quantityToClaim * _pricePerToken;
461456
uint256 platformFees = (totalPrice * platformFeeBps) / MAX_BPS;
462-
(address twFeeRecipient, uint256 twFeeBps) = thirdwebFee.getFeeInfo(address(this), FeeType.PRIMARY_SALE);
463-
uint256 twFee = (totalPrice * twFeeBps) / MAX_BPS;
464457

465458
if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
466459
require(msg.value == totalPrice, "must send total price.");
467460
}
468461

469462
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), platformFeeRecipient, platformFees);
470-
CurrencyTransferLib.transferCurrency(_currency, _msgSender(), twFeeRecipient, twFee);
471463
CurrencyTransferLib.transferCurrency(
472464
_currency,
473465
_msgSender(),
474466
primarySaleRecipient,
475-
totalPrice - platformFees - twFee
467+
totalPrice - platformFees
476468
);
477469
}
478470

scripts/addImplementation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function main() {
99

1010
console.log("\nCaller address: ", caller.address);
1111

12-
const twFactoryAddress: string = ethers.constants.AddressZero; // replace
12+
const twFactoryAddress: string = "0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0"; // replace
1313
const twFactory: TWFactory = await ethers.getContractAt("TWFactory", twFactoryAddress);
1414

1515
const hasFactoryRole = await twFactory.hasRole(

scripts/deploy/dropERC1155.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { TWFactory, DropERC1155 } from "typechain";
77
async function main() {
88
const [caller]: SignerWithAddress[] = await ethers.getSigners();
99

10-
const twFeeAddress: string = ethers.constants.AddressZero; // replace
11-
const twFactoryAddress: string = ethers.constants.AddressZero; // replace
10+
// const twFeeAddress: string = "0x8c4b615040ebd2618e8fc3b20cefe9abafdeb0ea"; // replace
11+
const twFactoryAddress: string = "0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0"; // replace
1212

1313
const twFactory: TWFactory = await ethers.getContractAt("TWFactory", twFactoryAddress);
1414

@@ -19,7 +19,7 @@ async function main() {
1919
if (!hasFactoryRole) {
2020
throw new Error("Caller does not have FACTORY_ROLE on factory");
2121
}
22-
const dropERC1155: DropERC1155 = await ethers.getContractFactory("DropERC1155").then(f => f.deploy(twFeeAddress));
22+
const dropERC1155: DropERC1155 = await ethers.getContractFactory("DropERC1155").then(f => f.deploy());
2323

2424
console.log(
2525
"Deploying DropERC1155 \ntransaction: ",
@@ -39,7 +39,7 @@ async function main() {
3939
console.log("\n");
4040

4141
console.log("Verifying contract.");
42-
await verify(dropERC1155.address, [twFeeAddress]);
42+
await verify(dropERC1155.address, []);
4343
}
4444

4545
async function verify(address: string, args: any[]) {

scripts/deploy/dropERC20.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { DropERC20, TWFactory } from "typechain";
77
async function main() {
88
const [caller]: SignerWithAddress[] = await ethers.getSigners();
99

10-
const twFeeAddress: string = ethers.constants.AddressZero; // replace
11-
const twFactoryAddress: string = ethers.constants.AddressZero; // replace
10+
// const twFeeAddress: string = "0x8c4b615040ebd2618e8fc3b20cefe9abafdeb0ea"; // replace
11+
const twFactoryAddress: string = "0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0"; // replace
1212

1313
const twFactory: TWFactory = await ethers.getContractAt("TWFactory", twFactoryAddress);
1414

@@ -19,7 +19,7 @@ async function main() {
1919
if (!hasFactoryRole) {
2020
throw new Error("Caller does not have FACTORY_ROLE on factory");
2121
}
22-
const dropERC20: DropERC20 = await ethers.getContractFactory("DropERC20").then(f => f.deploy(twFeeAddress));
22+
const dropERC20: DropERC20 = await ethers.getContractFactory("DropERC20").then(f => f.deploy());
2323

2424
console.log(
2525
"Deploying DropERC20 \ntransaction: ",
@@ -37,7 +37,7 @@ async function main() {
3737
console.log("\n");
3838

3939
console.log("Verifying contract.");
40-
await verify(dropERC20.address, [twFeeAddress]);
40+
await verify(dropERC20.address, []);
4141
}
4242

4343
async function verify(address: string, args: any[]) {

scripts/deploy/dropERC721.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { TWFactory, DropERC721 } from "typechain";
77
async function main() {
88
const [caller]: SignerWithAddress[] = await ethers.getSigners();
99

10-
const twFeeAddress: string = ethers.constants.AddressZero; // replace
11-
const twFactoryAddress: string = ethers.constants.AddressZero; // replace
10+
// const twFeeAddress: string = "0x8c4b615040ebd2618e8fc3b20cefe9abafdeb0ea"; // replace
11+
const twFactoryAddress: string = "0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0"; // replace
1212

1313
const twFactory: TWFactory = await ethers.getContractAt("TWFactory", twFactoryAddress);
1414

@@ -19,7 +19,7 @@ async function main() {
1919
if (!hasFactoryRole) {
2020
throw new Error("Caller does not have FACTORY_ROLE on factory");
2121
}
22-
const dropERC721: DropERC721 = await ethers.getContractFactory("DropERC721").then(f => f.deploy(twFeeAddress));
22+
const dropERC721: DropERC721 = await ethers.getContractFactory("DropERC721").then(f => f.deploy());
2323

2424
console.log(
2525
"Deploying DropERC721 \ntransaction: ",
@@ -39,7 +39,7 @@ async function main() {
3939
console.log("\n");
4040

4141
console.log("Verifying contract.");
42-
await verify(dropERC721.address, [twFeeAddress]);
42+
await verify(dropERC721.address, []);
4343
}
4444

4545
async function verify(address: string, args: any[]) {

0 commit comments

Comments
 (0)