Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit f2d09ac

Browse files
authored
v3 (#114)
* Add claim condition support for drop v2 * Update version * Pass through address to claim instead of destination address * Update version * am/custom (#115) Add * Update * Update edition drop * Update version
1 parent eedcaf7 commit f2d09ac

28 files changed

+1482
-3434
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ abi:
2626
abi-gen --language Python -o thirdweb/abi --abis abi/IERC20.json && mv thirdweb/abi/ierc20/__init__.py thirdweb/abi/ierc20.py && rm -rf thirdweb/abi/ierc20
2727
abi-gen --language Python -o thirdweb/abi --abis abi/IERC721.json && mv thirdweb/abi/ierc721/__init__.py thirdweb/abi/ierc721.py && rm -rf thirdweb/abi/ierc721
2828
abi-gen --language Python -o thirdweb/abi --abis abi/IERC1155.json && mv thirdweb/abi/ierc1155/__init__.py thirdweb/abi/ierc1155.py && rm -rf thirdweb/abi/ierc1155
29-
abi-gen --language Python -o thirdweb/abi --abis abi/DropERC721_V3.json && mv thirdweb/abi/droperc721_v3/__init__.py thirdweb/abi/drop_erc721.py && rm -rf thirdweb/abi/droperc721_v3
30-
abi-gen --language Python -o thirdweb/abi --abis abi/DropERC1155_V2.json && mv thirdweb/abi/droperc1155_v2/__init__.py thirdweb/abi/drop_erc1155.py && rm -rf thirdweb/abi/droperc1155_v2
29+
abi-gen --language Python -o thirdweb/abi --abis abi/DropERC721.json && mv thirdweb/abi/drop_erc721/__init__.py thirdweb/abi/drop_erc721.py && rm -rf thirdweb/abi/drop_erc721
30+
abi-gen --language Python -o thirdweb/abi --abis abi/DropERC1155.json && mv thirdweb/abi/drop_erc1155/__init__.py thirdweb/abi/drop_erc1155.py && rm -rf thirdweb/abi/drop_erc1155
3131
abi-gen --language Python -o thirdweb/abi --abis abi/Multiwrap.json && mv thirdweb/abi/multiwrap/__init__.py thirdweb/abi/multiwrap.py && rm -rf thirdweb/abi/multiwrap
3232

3333
abi-gen --language Python -o thirdweb/abi --abis abi/SignatureMintERC20.json && mv thirdweb/abi/signature_mint_erc20/__init__.py thirdweb/abi/signature_mint_erc20.py && rm -rf thirdweb/abi/signature_mint_erc20

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ packages = [
66
{include = "thirdweb"},
77
]
88
readme = "README.md"
9-
version = "2.2.0"
9+
version = "3.0.0"
1010

1111
[tool.poetry.dependencies]
1212
python = ">=3.7.1"

tests/skip_nft_drop.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import pytest
2+
from thirdweb.constants.currency import ZERO_ADDRESS
3+
from thirdweb.constants.role import Role
4+
from thirdweb.contracts.nft_drop import NFTDrop
5+
6+
from thirdweb.core.sdk import ThirdwebSDK
7+
from thirdweb.types.nft import NFTMetadataInput
8+
from thirdweb.types.settings.metadata import NFTDropContractMetadata
9+
10+
11+
@pytest.mark.usefixtures("sdk", "primary_account")
12+
@pytest.fixture(scope="function")
13+
def nft_drop(sdk: ThirdwebSDK, primary_account) -> NFTDrop:
14+
sdk.update_signer(primary_account)
15+
nft_drop = sdk.get_nft_drop(
16+
sdk.deployer.deploy_nft_drop(
17+
NFTDropContractMetadata(
18+
name="SDK NFT Drop",
19+
primary_sale_recipient=sdk.get_signer().address, # type: ignore
20+
seller_fee_basis_points=500,
21+
fee_recipient=ZERO_ADDRESS,
22+
platform_fee_basis_points=10,
23+
platform_fee_recipient=ZERO_ADDRESS,
24+
)
25+
)
26+
)
27+
nft_drop.roles.grant(Role.MINTER, sdk.get_signer().address) # type: ignore
28+
return nft_drop
29+
30+
31+
def test_create_batch(nft_drop: NFTDrop):
32+
metadatas = []
33+
for i in range(10):
34+
metadatas.append(NFTMetadataInput(name=f"NFT {i}"))
35+
36+
nft_drop.create_batch(metadatas)
37+
nfts = nft_drop.get_all()
38+
39+
assert len(nfts) == 10
40+
41+
for i, nft in enumerate(nfts):
42+
assert nft.metadata.name == f"NFT {i}"
43+
44+
assert nft_drop.get_total_count() == 10
45+
assert len(nft_drop.get_all_claimed()) == 0
46+
assert len(nft_drop.get_all_unclaimed()) == 10
47+

tests/test_nft_drop.py

Lines changed: 0 additions & 141 deletions
This file was deleted.

thirdweb/abi/__init__.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
from .t_w_factory import TWFactory
2-
from .t_w_registry import TWRegistry
3-
from .token_erc721 import TokenERC721
4-
from .token_erc1155 import TokenERC1155
5-
from .token_erc20 import TokenERC20
6-
from .marketplace import Marketplace
7-
from .multiwrap import Multiwrap
8-
from .ierc20 import IERC20
9-
from .ierc165 import IERC165
10-
from .ierc721 import IERC721
11-
from .ierc1155 import IERC1155
12-
from .drop_erc721 import DropERC721_V3
13-
from .drop_erc1155 import DropERC1155_V2
14-
from .contract_metadata_registry import ContractMetadataRegistry
15-
from .thirdweb_contract import ThirdwebContract
16-
from .i_platform_fee import IPlatformFee
17-
from .i_primary_sale import IPrimarySale
18-
from .i_permissions_enumerable import IPermissionsEnumerable
19-
from .i_royalty import IRoyalty
20-
from .i_token_erc20 import ITokenERC20
21-
from .i_token_erc721 import ITokenERC721
22-
from .i_token_erc1155 import ITokenERC1155
1+
from .t_w_factory import TWFactory # pylint: disable=unused-import
2+
from .t_w_registry import TWRegistry # pylint: disable=unused-import
3+
from .token_erc721 import TokenERC721 # pylint: disable=unused-import
4+
from .token_erc1155 import TokenERC1155 # pylint: disable=unused-import
5+
from .token_erc20 import TokenERC20 # pylint: disable=unused-import
6+
from .marketplace import Marketplace # pylint: disable=unused-import
7+
from .multiwrap import Multiwrap # pylint: disable=unused-import
8+
from .ierc20 import IERC20 # pylint: disable=unused-import
9+
from .ierc165 import IERC165 # pylint: disable=unused-import
10+
from .ierc721 import IERC721 # pylint: disable=unused-import
11+
from .ierc1155 import IERC1155 # pylint: disable=unused-import
12+
from .drop_erc721 import DropERC721 # pylint: disable=unused-import
13+
from .drop_erc1155 import DropERC1155 # pylint: disable=unused-import
14+
from .i_platform_fee import IPlatformFee # pylint: disable=unused-import
15+
from .i_primary_sale import IPrimarySale # pylint: disable=unused-import
16+
from .i_permissions_enumerable import IPermissionsEnumerable # pylint: disable=unused-import
17+
from .i_royalty import IRoyalty # pylint: disable=unused-import
18+
from .i_token_erc20 import ITokenERC20 # pylint: disable=unused-import
19+
from .i_token_erc721 import ITokenERC721 # pylint: disable=unused-import
20+
from .i_token_erc1155 import ITokenERC1155 # pylint: disable=unused-import

0 commit comments

Comments
 (0)