Skip to content

Commit

Permalink
optimize: improve mintAdditionalSupplyTo efficiency (#5148)
Browse files Browse the repository at this point in the history
## 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 -->
  • Loading branch information
joaquim-verges committed Oct 24, 2024
1 parent 06c0cf3 commit 2fdb69d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/olive-wombats-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Optimize mintAdditionalSupplyTo
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,10 @@ export function mintAdditionalSupplyTo(
return MintTo.mintTo({
contract: options.contract,
asyncParams: async () => {
// we'll be re-using the exising token URI
const tokenUri = await URI.uri({
contract: options.contract,
tokenId: options.tokenId,
});

return {
to: options.to,
tokenId: options.tokenId,
uri: tokenUri,
uri: "", // contract will maintain the existing token URI
amount: options.supply,
};
},
Expand Down

0 comments on commit 2fdb69d

Please sign in to comment.