Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .changeset/selfish-deers-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
"thirdweb": minor
---

Adds LoyaltyCard extensions and support for ERC721 deployment.

```ts
import { deployERC721Contract } from "thirdweb/deploys";

const loyaltyCardContractAddress = await deployERC721Contract({
chain: "your-chain-id", // replace with your chain ID
client: yourThirdwebClient, // replace with your Thirdweb client instance
account: yourAccount, // replace with your account details
type: "LoyaltyCard",
params: {
name: "MyLoyaltyCard",
symbol: "LOYAL",
description: "A loyalty card NFT contract",
image: "path/to/image.png", // replace with your image path
defaultAdmin: "0xYourAdminAddress", // replace with your admin address
royaltyRecipient: "0xYourRoyaltyRecipient", // replace with your royalty recipient address
royaltyBps: 500n, // 5% royalty
trustedForwarders: ["0xTrustedForwarderAddress"], // replace with your trusted forwarder addresses
saleRecipient: "0xYourSaleRecipient", // replace with your sale recipient address
platformFeeBps: 200n, // 2% platform fee
platformFeeRecipient: "0xYourPlatformFeeRecipient", // replace with your platform fee recipient address
},
});

```
14 changes: 8 additions & 6 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@ jobs:
repo: context.repo.repo,
pull_number: context.issue.number
});

const body = pr.data.body || '';
const branchName = pr.data.head.ref;
const issueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES})-\\d+`, 'i');

if (!issueRegex.test(body)) {
const branchIssueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES.toLowerCase()})-\\d+`, 'i');

if (!issueRegex.test(body) && !branchIssueRegex.test(branchName)) {
core.setFailed(
`No valid issue reference found. PR body must contain an issue ID with one of these prefixes: ${process.env.VALID_ISSUE_PREFIXES}`
`No valid issue reference found. PR body or branch name must contain an issue ID with one of these prefixes: ${process.env.VALID_ISSUE_PREFIXES}`
);
return;
}
const matches = body.match(issueRegex);

const matches = body.match(issueRegex) || branchName.match(branchIssueRegex);
console.log(`Found issue reference: ${matches[0]}`);
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ coverage:
target: 80%
flags:
- packages
ignore:
- "**/__generated__/**"


github_checks:
Expand Down
14 changes: 14 additions & 0 deletions packages/thirdweb/scripts/generate/abis/erc721/LoyaltyCard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
"constructor()",
"function cancel(uint256 tokenId)",
"function initialize(address _defaultAdmin, string _name, string _symbol, string _contractURI, address[] _trustedForwarders, address _saleRecipient, address _royaltyRecipient, uint128 _royaltyBps, uint128 _platformFeeBps, address _platformFeeRecipient)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only need this function here, everything else is duplicates

"function mintTo(address _to, string _uri) returns (uint256 tokenIdMinted)",
"function mintWithSignature((address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, uint256 quantity, uint256 pricePerToken, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, string uri) _req, bytes _signature) payable returns (address signer)",
"function nextTokenIdToMint() view returns (uint256)",
"function revoke(uint256 tokenId)",
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
"function tokenURI(uint256 _tokenId) view returns (string)",
"function totalMinted() view returns (uint256)",
"event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri)",
"event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, (address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, uint256 quantity, uint256 pricePerToken, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, string uri) mintRequest)"
]
15 changes: 15 additions & 0 deletions packages/thirdweb/scripts/generate/abis/erc721/Multiwrap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
"constructor(address _nativeTokenWrapper)",
"event TokensWrapped(address indexed wrapper, address indexed recipientOfWrappedToken, uint256 indexed tokenIdOfWrappedToken, (address assetContract, uint8 tokenType, uint256 tokenId, uint256 amount)[] wrappedContents)",
"event TokensUnwrapped(address indexed unwrapper, address indexed recipientOfWrappedContents, uint256 indexed tokenIdOfWrappedToken)",
"function contractType() pure returns (bytes32)",
"function contractVersion() pure returns (uint8)",
"function getWrappedContents(uint256 _tokenId) view returns ((address assetContract, uint8 tokenType, uint256 tokenId, uint256 amount)[] contents)",
"function initialize(address _defaultAdmin, string _name, string _symbol, string _contractURI, address[] _trustedForwarders, address _royaltyRecipient, uint256 _royaltyBps)",
"function nextTokenIdToMint() view returns (uint256)",
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
"function tokenURI(uint256 _tokenId) view returns (string)",
"function unwrap(uint256 _tokenId, address _recipient)",
"function wrap((address assetContract, uint8 tokenType, uint256 tokenId, uint256 amount)[] _tokensToWrap, string _uriForWrappedToken, address _recipient) payable returns (uint256 tokenId)",
"receive() external payable"
]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading