Skip to content

Commit 2fdb69d

Browse files
optimize: improve mintAdditionalSupplyTo efficiency (#5148)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on optimizing the `mintAdditionalSupplyTo` function in the `erc1155` extension by modifying how the token URI is handled during the minting process. ### Detailed summary - Removed the retrieval of the existing token URI from the contract. - Set the `uri` field to an empty string, indicating the contract will maintain the existing token URI. - Kept the `to`, `tokenId`, and `amount` fields unchanged. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 06c0cf3 commit 2fdb69d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.changeset/olive-wombats-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Optimize mintAdditionalSupplyTo

packages/thirdweb/src/extensions/erc1155/write/mintAdditionalSupplyTo.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,10 @@ export function mintAdditionalSupplyTo(
3838
return MintTo.mintTo({
3939
contract: options.contract,
4040
asyncParams: async () => {
41-
// we'll be re-using the exising token URI
42-
const tokenUri = await URI.uri({
43-
contract: options.contract,
44-
tokenId: options.tokenId,
45-
});
46-
4741
return {
4842
to: options.to,
4943
tokenId: options.tokenId,
50-
uri: tokenUri,
44+
uri: "", // contract will maintain the existing token URI
5145
amount: options.supply,
5246
};
5347
},

0 commit comments

Comments
 (0)