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

Commit deef9ee

Browse files
Broaden event parsing after mint calls (#118)
* Broaden event parsing after mint calls * update mainnet rpc * try to fix build issue * disable novella for now
1 parent dcc221d commit deef9ee

File tree

6 files changed

+31
-32
lines changed

6 files changed

+31
-32
lines changed

hardhat.config.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
21
// Do not modify the existing settings
32
module.exports = {
4-
networks: {
5-
hardhat: {
6-
forking: {
7-
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.SDK_ALCHEMY_KEY}`,
8-
},
9-
chainId: 1,
10-
initialBaseFeePerGas: 0, // Allow 0 gas fees when testing
11-
throwOnTransactionFailures: true, // Brownie expects transactions to throw on revert
12-
throwOnCallFailures: true, // Brownie expects calls to throw on failure
13-
}
14-
}
15-
}
3+
networks: {
4+
hardhat: {
5+
forking: {
6+
url: `https://ethereum.rpc.thirdweb.com/39a3c037d7a88e6692c6681bccfd1f1cf36370324c4051a83acd0edcffb20708`,
7+
},
8+
chainId: 1,
9+
initialBaseFeePerGas: 0, // Allow 0 gas fees when testing
10+
throwOnTransactionFailures: true, // Brownie expects transactions to throw on revert
11+
throwOnCallFailures: true, // Brownie expects calls to throw on failure
12+
},
13+
},
14+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"devDependencies": {
3-
"hardhat": "^2.12.0"
3+
"hardhat": "^2.13.0"
44
}
55
}

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ mkdocstrings = "^0.18.1"
3636
pymdown-extensions = "^9.3"
3737
eth-brownie = "^1.18.1"
3838

39-
[tool.poetry.extras]
40-
novella = ["novella >=0.1.10,<0.3.0"]
41-
docs = ["novella >=0.1.10,<0.3.0", "mkdocs", "mkdocs-material"]
39+
# [tool.poetry.extras]
40+
# novella = ["novella>=0.1.10,<0.3.0"]
41+
# docs = ["novella>=0.1.10,<0.3.0", "mkdocs", "mkdocs-material"]
4242

4343
[tool.poetry.scripts]
4444
pydoc-markdown = "pydoc_markdown.main:cli"

thirdweb/contracts/edition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ def mint_to(
133133
receipt = self._contract_wrapper.send_transaction(
134134
"mint_to", [to, int(MAX_INT, 16), uri, metadata_with_supply.supply]
135135
)
136-
events = self._contract_wrapper.get_events("TokensMinted", receipt)
136+
events = self._contract_wrapper.get_events("TransferSingle", receipt)
137137

138138
if len(events) == 0:
139-
raise Exception("No TokensMinted event found")
139+
raise Exception("No TransferSingle event found")
140140

141-
id = events[0].get("args").get("tokenIdMinted") # type: ignore
141+
id = events[0].get("args").get("id") # type: ignore
142142

143143
return TxResultWithId(receipt, id=id, data=lambda: self.get(id))
144144

thirdweb/contracts/nft_collection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ def mint_to(
164164

165165
uri = upload_or_extract_uri(metadata, self._storage)
166166
receipt = self._contract_wrapper.send_transaction("mint_to", [to, uri])
167-
events = self._contract_wrapper.get_events("TokensMinted", receipt)
167+
events = self._contract_wrapper.get_events("Transfer", receipt)
168168

169169
if len(events) == 0:
170-
raise Exception("No TokensMinted event found")
170+
raise Exception("No Transfer event found")
171171

172-
id = events[0].get("args").get("tokenIdMinted") # type: ignore
172+
id = events[0].get("args").get("tokenId") # type: ignore
173173

174174
return TxResultWithId(receipt, id=id, data=lambda: self.get(id))
175175

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,10 +1210,10 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
12101210
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
12111211
integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
12121212

1213-
hardhat@^2.12.0:
1214-
version "2.12.0"
1215-
resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.12.0.tgz#51e59f1ff4991bcb66d1a380ea807e6c15fcac34"
1216-
integrity sha512-mNJFbVG479HwOzxiaLxobyvED2M1aEAuPPYhEo1+88yicMDSTrU2JIS7vV+V0GSNQKaDoiHCmV6bcKjiljT/dQ==
1213+
hardhat@^2.13.0:
1214+
version "2.13.0"
1215+
resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.13.0.tgz#d52a0ec9b733a651687e5b1c1b0ee9a11a30f3d0"
1216+
integrity sha512-ZlzBOLML1QGlm6JWyVAG8lVTEAoOaVm1in/RU2zoGAnYEoD1Rp4T+ZMvrLNhHaaeS9hfjJ1gJUBfiDr4cx+htQ==
12171217
dependencies:
12181218
"@ethersproject/abi" "^5.1.2"
12191219
"@metamask/eth-sig-util" "^4.0.0"
@@ -1262,7 +1262,7 @@ hardhat@^2.12.0:
12621262
source-map-support "^0.5.13"
12631263
stacktrace-parser "^0.1.10"
12641264
tsort "0.0.1"
1265-
undici "^5.4.0"
1265+
undici "^5.14.0"
12661266
uuid "^8.3.2"
12671267
ws "^7.4.6"
12681268

@@ -2080,10 +2080,10 @@ type-fest@^0.7.1:
20802080
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48"
20812081
integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==
20822082

2083-
undici@^5.4.0:
2084-
version "5.11.0"
2085-
resolved "https://registry.yarnpkg.com/undici/-/undici-5.11.0.tgz#1db25f285821828fc09d3804b9e2e934ae86fc13"
2086-
integrity sha512-oWjWJHzFet0Ow4YZBkyiJwiK5vWqEYoH7BINzJAJOLedZ++JpAlCbUktW2GQ2DS2FpKmxD/JMtWUUWl1BtghGw==
2083+
undici@^5.14.0:
2084+
version "5.20.0"
2085+
resolved "https://registry.yarnpkg.com/undici/-/undici-5.20.0.tgz#6327462f5ce1d3646bcdac99da7317f455bcc263"
2086+
integrity sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==
20872087
dependencies:
20882088
busboy "^1.6.0"
20892089

0 commit comments

Comments
 (0)