-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kien Ngo
committed
Nov 29, 2023
1 parent
b833250
commit ab9a8cb
Showing
5 changed files
with
113 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@thirdweb-dev/sdk": patch | ||
--- | ||
|
||
Fix deploy issue "invalid recipient" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { constants } from "ethers"; | ||
|
||
/** | ||
* In the past we default `platform_fee_recipient` and `primary_sale_recipient` to AddressZero. | ||
* However due to a recent change in our smart contract extensions (PrimarySale & PlatformFee), AddressZero is no longer an accepted value for those fields. | ||
* So now we're set the default value to the signer address. | ||
* @reference https://github.com/thirdweb-dev/contracts/pull/530 | ||
* @param signerAddress The address of the contract deployer | ||
* @param fee_recipient The address that will receive the platform fees and/or sale fees | ||
* @returns `signerAddress` if the `fee_recipient` is AddressZero, otherwise returns `fee_recipient` | ||
* @internal | ||
*/ | ||
export function overrideFeeRecipient( | ||
signerAddress: string, | ||
fee_recipient: string, | ||
): string { | ||
if (fee_recipient === constants.AddressZero) return signerAddress; | ||
return fee_recipient; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters