wallet.rs: [BUG] Can mint NFTs on ShimmerTestnet but not on Mainnet using the same code
Bug description
If I use the following code on testnet 'nodes': ['https://api.testnet.shimmer.network']
it mints the collection NFT
without issues
import os
import json
from dotenv import load_dotenv
from iota_wallet import IotaWallet
load_dotenv()
shimmer_mnemonic = os.getenv("SHIMMER_MNEMONIC")
stronghold_password = os.getenv("STRONGHOLD_PASSWORD")
wallet_db_name = os.getenv("WALLET_DB_NAME")
shimmer_account_name = os.getenv("SHIMMER_ACCOUNT_NAME")
stronghold_db_name = os.getenv("STRONGHOLD_DB_NAME")
# In this example we will mint an nft
client_options = {
'nodes': ['https://api.testnet.shimmer.network'],
}
wallet = IotaWallet(wallet_db_name, client_options)
account = wallet.get_account(shimmer_account_name)
your_rms_address = "rms1qp87g8hagfent9j98me285rqpzgu3z8fghthyj53rp94v9usyhl3srp88mq"
# Sync account with the node
response = account.sync()
print(f'Synced: {response}')
wallet.set_stronghold_password(stronghold_password)
immutable_metadata = bytes(json.dumps({
"standard": "IRC27",
"version": "v1.0",
"type": "image/png",
"uri": "ipfs://bafybeiac6yvelxcmzssznmcgjh27rstrcjp5ppdfmkjzdk4k2kiz3wskei",
"name": "Cypherpunk Warriors",
"description": "Skip Warrior Collection",
"issuerName": "Skip"
}).encode('utf-8')).hex()
combined_metadata = "0x" + immutable_metadata
nft_options = [{
"issuer": your_rms_address,
"immutableMetadata": combined_metadata,
}]
transaction = account.mint_nfts(nft_options)
#transaction = account.mint_nfts(outputs)
print(f'Sent transaction: {transaction}')
Synced: {'baseCoin': {'total': '999971300', 'available': '998890500'}, 'requiredStorageDeposit': {'alias': '100600', 'basic': '646000', 'foundry': '119200', 'nft': '811400'}, 'nativeTokens': [{'tokenId': '0x0893fd21720b0567e4ede5bcaa16d16b7bf6ca1440e3240c9a010d1f01ddb7745b0200000000', 'metadata': None, 'total': '0x2698', 'available': '0x2698'}], 'nfts': ['0x5dc21522823738b9774ee7fcd338fe5362c033b1ef523b2816b85e78ff9df503', '0x06985660335c822e15dea65ddf3deb664f4b4d7493d5487be03c4a6704e602da', '0x30feecaa0bf7edf8890286f3fbb3eb7234b1da16590ef54e2bd811e3e027a428', '0x69baa05ab4eff824e41edf9689c46ca7637741bd50453068655adcb90aac5b3f', '0x0a54eb20b48a4e3f6dd1d8e23877cec2d6c78941d84dbe76e800e44f704dfeca', '0x65de12a939114ecf28df6597c3af77a3b80be6edc357f7bb047fc68939dd0429', '0x226aa64f2a63193aba3e5264aae4a42fbb125c869b42589828cea6d90362fd29', '0x114ce670419bb687af58a182693e871c46333681e3105526e0b9e541e4df1224', '0xf8b8603961cb875f18078b469b4505532380fae82e2b1e93a04a2d06f075ccff', '0x21ed5a71186d37ec23ca28d72429df5f01d857a870af286feb0a88ed55f9557b'], 'aliases': ['0xd53560febb9f512ebe8d1800fc9aa28f712974f0e5ccb37d747100196bc52cb5', '0x93fd21720b0567e4ede5bcaa16d16b7bf6ca1440e3240c9a010d1f01ddb7745b'], 'foundries': ['0x0893fd21720b0567e4ede5bcaa16d16b7bf6ca1440e3240c9a010d1f01ddb7745b0200000000', '0x0893fd21720b0567e4ede5bcaa16d16b7bf6ca1440e3240c9a010d1f01ddb7745b0100000000'], 'potentiallyLockedOutputs': {'0xef24e69ab0baefdb6d776e3181b938c8dca14a63a0100d694aafc77aa97081850000': False}}
Sent transaction: {'payload': {'type': 6, 'essence': {'type': 1, 'networkId': '8342982141227064571', 'inputs': [{'type': 0, 'transactionId': '0x98eee28cd3b018de6ba491274dcdb583da908bf31893c851d754c0b494ec4ab6', 'transactionOutputIndex': 1}, {'type': 0, 'transactionId': '0x52d361cf565174d10edcf9d352f22f637fbed346260e42874acad3b17f819949', 'transactionOutputIndex': 0}], 'inputsCommitment': '0x0fdf98e9eef002ab12d4b3bb10295d88648415265cb14f92b132671c94b1df6e', 'outputs': [{'type': 6, 'amount': '73300', 'nftId': '0x0000000000000000000000000000000000000000000000000000000000000000', 'unlockConditions': [{'type': 0, 'address': {'type': 0, 'pubKeyHash': '0x8ecdca9142a9082a106efdc8f11bd66e6364269be89101df5b646e57e5966d15'}}], 'immutableFeatures': [{'type': 1, 'address': {'type': 0, 'pubKeyHash': '0x8ecdca9142a9082a106efdc8f11bd66e6364269be89101df5b646e57e5966d15'}}, {'type': 2, 'data': '0x7b227374616e64617264223a20224952433237222c202276657273696f6e223a202276312e30222c202274797065223a2022696d6167652f706e67222c2022757269223a2022697066733a2f2f626166796265696163367976656c78636d7a73737a6e6d63676a68323772737472636a7035707064666d6b6a7a646b346b326b697a3377736b6569222c20226e616d65223a202243797068657270756e6b2057617272696f7273222c20226465736372697074696f6e223a2022536b69702057617272696f7220436f6c6c656374696f6e222c20226973737565724e616d65223a2022536b6970204c4c43227d'}]}, {'type': 3, 'amount': '86000', 'unlockConditions': [{'type': 0, 'address': {'type': 0, 'pubKeyHash': '0x8ecdca9142a9082a106efdc8f11bd66e6364269be89101df5b646e57e5966d15'}}]}]}, 'unlocks': [{'type': 0, 'signature': {'type': 0, 'publicKey': '0x4069f5a08c2688c41cc726364d4210fedcbf90b0059b2a5eb9f48949cdc52987', 'signature': '0xff3ca0f1e62f6a6a7c439440ddac1283e625d814da1309122796114463ea68156c92384c07d85602ed2ef5af4f7bcdfdf3658f67bbd90b6c57d55d7742705001'}}, {'type': 1, 'reference': 0}]}, 'blockId': '0x2d520e232088b73a14a825be5976c08a61106df82f377482a34e59658ec80748', 'inclusionState': 'Pending', 'timestamp': '1677829006855', 'transactionId': '0xa2100ec3f8aa8b69a35cc4f190eb6907993cb1cb7a39f072999589466036e21f', 'networkId': '8342982141227064571', 'incoming': False, 'note': None, 'inputs': [{'metadata': {'blockId': '0x0ea05a4908c398154a198da7793725873daacff0b94e5fd5343183565b34826a', 'transactionId': '0x98eee28cd3b018de6ba491274dcdb583da908bf31893c851d754c0b494ec4ab6', 'outputIndex': 1, 'isSpent': False, 'milestoneIndexBooked': 3933361, 'milestoneTimestampBooked': 1677828991, 'ledgerIndex': 3933363}, 'output': {'type': 3, 'amount': '84800', 'unlockConditions': [{'type': 0, 'address': {'type': 0, 'pubKeyHash': '0x8ecdca9142a9082a106efdc8f11bd66e6364269be89101df5b646e57e5966d15'}}]}}, {'metadata': {'blockId': '0x4032304bb15fdf383e95fb67b9e6a9cf609acfbf9e8ea80a1bb50d282064cde9', 'transactionId': '0x52d361cf565174d10edcf9d352f22f637fbed346260e42874acad3b17f819949', 'outputIndex': 0, 'isSpent': False, 'milestoneIndexBooked': 3905983, 'milestoneTimestampBooked': 1677688015, 'ledgerIndex': 3906012}, 'output': {'type': 3, 'amount': '74500', 'unlockConditions': [{'type': 0, 'address': {'type': 0, 'pubKeyHash': '0x8ecdca9142a9082a106efdc8f11bd66e6364269be89101df5b646e57e5966d15'}}]}}]}
As soon as the node is changed to mainnet, and change the address, I am not able to mint the NFT anymore
# In this example we will mint an nft
client_options = {
'nodes': ['https://api.shimmer.network'],
}
wallet = IotaWallet(wallet_db_name, client_options)
account = wallet.get_account(shimmer_account_name)
your_rms_address = "smr1qpjnykapsl3u533kgzaewzkfm7rju30xx0ncrw9etegzswl9050suxvm7uq"
Synced: {'baseCoin': {'total': '47414507', 'available': '47090207'}, 'requiredStorageDeposit': {'alias': '100600', 'basic': '84600', 'foundry': '139100', 'nft': '0'}, 'nativeTokens': [{'tokenId': '0x08967b40894f97a226630ea16a752bd44697154e5c514da0f5fa76076eaaf4cf5a0300000000', 'metadata': None, 'total': '0x7745691da795c', 'available': '0x7745691da795c'}, {'tokenId': '0x0860ad2b2896b4c3ffae07af00a97c1dc5a5f14385522caf575137d2b36cef280e0100000000', 'metadata': None, 'total': '0x2540be400', 'available': '0x2540be400'}, {'tokenId': '0x0813e2f6fe4445e966cdafa5204de2dc07a6c9c37b398d7915038d63bc374de94a0100000000', 'metadata': None, 'total': '0x110d9316eb18c', 'available': '0x110d9316eb18c'}, {'tokenId': '0x08967b40894f97a226630ea16a752bd44697154e5c514da0f5fa76076eaaf4cf5a0100000000', 'metadata': None, 'total': '0xeecb4', 'available': '0xeecb4'}, {'tokenId': '0x089e0286290a5b662c1b83936cd4b3e7a7274893111c672eb10c7f3ff761a0cb320500000000', 'metadata': None, 'total': '0xf4240', 'available': '0xf4240'}, {'tokenId': '0x08095d5fea11012668e515cacad1801ef8fe078ebe8bba448612509ecdca88cbaa0100000000', 'metadata': None, 'total': '0x25c86', 'available': '0x25c86'}], 'nfts': [], 'aliases': ['0x60ad2b2896b4c3ffae07af00a97c1dc5a5f14385522caf575137d2b36cef280e', '0x13e2f6fe4445e966cdafa5204de2dc07a6c9c37b398d7915038d63bc374de94a'], 'foundries': ['0x0813e2f6fe4445e966cdafa5204de2dc07a6c9c37b398d7915038d63bc374de94a0100000000', '0x0860ad2b2896b4c3ffae07af00a97c1dc5a5f14385522caf575137d2b36cef280e0100000000'], 'potentiallyLockedOutputs': {}}
Traceback (most recent call last):
File "/home/antonio/dev/nft_collection/mint_collection_nft.py", line 47, in <module>
transaction = account.mint_nfts(nft_options)
File "/home/antonio/.local/lib/python3.10/site-packages/iota_wallet/account.py", line 339, in mint_nfts
return self._call_account_method(
File "/home/antonio/.local/lib/python3.10/site-packages/iota_wallet/common.py", line 20, in wrapper
raise IotaWalletError(json_response['payload'])
iota_wallet.common.IotaWalletError: {'type': 'client', 'error': 'unfulfillable requirement Issuer(Ed25519(Ed25519Address(0x65325ba187e3ca463640bb970ac9df872e45e633e781b8b95e50283be57d1f0e)))'}
Rust version
Which version of Rust are you running?
- Rust version: rustc 1.67.1 (d5a82bbd2 2023-02-07)
Version
Which version of the library are you using?
- Version number, commit, or branch: 1.0.0rc2
Hardware specification
What hardware are you using?
Language: en Platform: linux Platform Version: 5.15.94-1-MANJARO Platform Architecture: x64 CPU Count: 24 Total Memory: 64231.6 MB Free Memory: 42544.0 MB
Steps To reproduce the bug
Explain how the maintainer can reproduce the bug. Explained above
Expected behaviour
I would expect to be able to switch to mainnet nodes and change my address to a smr1
address and be able to mint.
Actual behaviour
The software halts and gives an error.
Errors
iota_wallet.common.IotaWalletError: {‘type’: ‘client’, ‘error’: ‘unfulfillable requirement Issuer(Ed25519(Ed25519Address(0x65325ba187e3ca463640bb970ac9df872e45e633e781b8b95e50283be57d1f0e)))’}
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (5 by maintainers)
UPDATE: It works. I am not to sure what was the issue, I just cleaned up the code a bit: