Skip to content

Commit de1993c

Browse files
committed
update
1 parent f81c1af commit de1993c

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/platform-fees.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import { SolidityInput } from "contract-ui/components/solidity-inputs";
1010
import { useTrack } from "hooks/analytics/useTrack";
1111
import { useTxNotifications } from "hooks/useTxNotifications";
1212
import { useForm } from "react-hook-form";
13-
import { toast } from "sonner";
14-
import { type ThirdwebContract, ZERO_ADDRESS } from "thirdweb";
13+
import type { ThirdwebContract } from "thirdweb";
1514
import {
1615
getPlatformFeeInfo,
1716
setPlatformFeeInfo,
@@ -36,11 +35,11 @@ const CommonPlatformFeeSchema = z.object({
3635
/**
3736
* platform fee basis points
3837
*/
39-
platform_fee_basis_points: BasisPointsSchema.default(0),
38+
platform_fee_basis_points: BasisPointsSchema,
4039
/**
4140
* platform fee recipient address
4241
*/
43-
platform_fee_recipient: AddressOrEnsSchema.default(ZERO_ADDRESS),
42+
platform_fee_recipient: AddressOrEnsSchema,
4443
});
4544

4645
export const SettingsPlatformFees = ({
@@ -84,14 +83,6 @@ export const SettingsPlatformFees = ({
8483
action: "set-platform-fees",
8584
label: "attempt",
8685
});
87-
// In the v4 hook we defaulted recipient to address_zero and bps to `0`
88-
// but let's actually throw an error here for better transparency
89-
if (!data.platform_fee_basis_points) {
90-
return toast.error("Please enter valid basis points.");
91-
}
92-
if (!data.platform_fee_recipient) {
93-
return toast.error("Please enter a valid platform fee recipient.");
94-
}
9586
const transaction = setPlatformFeeInfo({
9687
contract,
9788
platformFeeRecipient: data.platform_fee_recipient,

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/royalties.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import { SolidityInput } from "contract-ui/components/solidity-inputs";
1010
import { useTrack } from "hooks/analytics/useTrack";
1111
import { useTxNotifications } from "hooks/useTxNotifications";
1212
import { useForm } from "react-hook-form";
13-
import { toast } from "sonner";
14-
import { type ThirdwebContract, ZERO_ADDRESS } from "thirdweb";
13+
import type { ThirdwebContract } from "thirdweb";
1514
import {
1615
getDefaultRoyaltyInfo,
1716
setDefaultRoyaltyInfo,
@@ -46,15 +45,15 @@ const CommonRoyaltySchema = z.object({
4645
* @internal
4746
* @remarks used by OpenSea "seller_fee_basis_points"
4847
*/
49-
seller_fee_basis_points: BasisPointsSchema.default(0),
48+
seller_fee_basis_points: BasisPointsSchema,
5049

5150
/**
5251
* The address of the royalty recipient. All royalties will be sent
5352
* to this address.
5453
* @internal
5554
* @remarks used by OpenSea "fee_recipient"
5655
*/
57-
fee_recipient: AddressOrEnsSchema.default(ZERO_ADDRESS),
56+
fee_recipient: AddressOrEnsSchema,
5857
});
5958

6059
export const SettingsRoyalties = ({
@@ -97,14 +96,6 @@ export const SettingsRoyalties = ({
9796
action: "set-royalty",
9897
label: "attempt",
9998
});
100-
// In the v4 hook we defaulted recipient to address_zero and bps to `0`
101-
// but let's actually throw an error here for better transparency
102-
if (!d.seller_fee_basis_points) {
103-
return toast.error("Please enter valid basis points.");
104-
}
105-
if (!d.fee_recipient) {
106-
return toast.error("Please enter a valid royalty fee recipient.");
107-
}
10899
const transaction = setDefaultRoyaltyInfo({
109100
contract,
110101
royaltyRecipient: d.fee_recipient,

0 commit comments

Comments
 (0)