diff --git a/CHANGELOG.md b/CHANGELOG.md index d1a19f971..9f3342823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,13 +31,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Added -- Added `verifyEthers` method to verify Ethereum signatures using the EIP-191 message hashing standard https://github.com/o1-labs/o1js/pull/1815 +- Added `verifyEthers` method to verify Ethereum signatures using the EIP-191 message hashing standard. https://github.com/o1-labs/o1js/pull/1815 - Added `fromEthers` method for parsing and converting Ethereum public keys into `ForeignCurve` points, supporting both compressed and uncompressed formats. - Added `fromHex` method for converting hexadecimal strings into `ForeignCurve` points. ### Fixes -- Fix incorrect behavior of optional proving for zkPrograms where `myProgram.setProofsEnabled(false)` wouldn't work when called before `myProgram.compile()` https://github.com/o1-labs/o1js/pull/1827 +- Fix incorrect behavior of optional proving for zkPrograms where `myProgram.setProofsEnabled(false)` wouldn't work when called before `myProgram.compile()`. https://github.com/o1-labs/o1js/pull/1827 +- Fix incorrect behavior of `state.fetch()` for custom token contracts. [@rpanic](https://github.com/rpanic) https://github.com/o1-labs/o1js/pull/1853 ## [1.7.0](https://github.com/o1-labs/o1js/compare/d6abf1d97...5006e4f) - 2024-09-04 diff --git a/src/lib/mina/state.ts b/src/lib/mina/state.ts index 43b480cb2..cfa23b605 100644 --- a/src/lib/mina/state.ts +++ b/src/lib/mina/state.ts @@ -362,13 +362,14 @@ function createState(defaultValue?: T): InternalStateType { let layout = getLayoutPosition(this._contract); let address: PublicKey = this._contract.instance.address; + let tokenId: Field = this._contract.instance.tokenId; let account: Account | undefined; if (networkConfig.minaEndpoint === '') { - account = Mina.getAccount(address, TokenId.default); + account = Mina.getAccount(address, tokenId); } else { ({ account } = await fetchAccount({ publicKey: address, - tokenId: TokenId.toBase58(TokenId.default), + tokenId: TokenId.toBase58(tokenId), })); } if (account === undefined) return undefined;