Is the NFT basic contract missing in the emulator-net?

Hi guys! I’m playing with the emulator trying to recreate the kitty-items repository. When setting the NON_FUNGIBLE_TOKEN_ADDRESS in the .env file (kitty-items-deployer) I noted that in the log of the command 'flow emulator start --init" (image) the address of the NFT core contract is missing.

Am I supposed to deploy it by copying from the core contracts page? If yes, I think it could be usefull to put it in the default emulator starter version.

Ok, by looking to the DappStarter repository by Decentology I just realized that the NFT contract is not a core contract :sweat_smile: I was thinking that there was a core contract with the NFT basic functionalities (like interfaces) that had to be pointed by the new NFT smart contarct declaration. So, in order to create a NFT the only necessary thing is pub resource NFT, am I right?

In order to create an NFT, you need to import the NFT contract interface and implement it. You can find the NFT interface in this repo: GitHub - onflow/flow-nft: The Non-Fungible Token standard on the Flow Blockchain

The NFT interface is already deployed to testnet and mainnet (addresses here: Non-Fungible Token Contract - Flow Documentation) but if you are testing in the emulator, you’ll need to deploy it yourself before importing it.

If you don’t implement the NFT interface, your NFT will not be interoperable with many of the other smart contracts that work with general NFTs, so we highly recommend it.

Any other questions?

1 Like

@fabius Although the NFT contract doesn’t have “core contract” status, I think there’s still a strong case to include it in the emulator by default.

The team is actually working through this right now – pretty soon there’ll be a way to specify default contracts that are automatically loaded when the emulator starts.


Thank you @flowjosh! Thank you @pete!

I fixed it by “manual” uploading the NFT smart contract in the emulator :wink:

Right now I’m stucked cause kitty-items is developed with testnet in mind. After uploading all contracts and setting the local emulator as entry point I got issues in the web interface. It seems that somewhere it’s actually trying to connect to testnet (I’m trying to debug, if it will take too much time I will ask for a help here).

Anyway, taking the bull by the horns, I would like to develop directly on testnet. I sent my request for the faucet a couple of days ago but still nothing. Is the testnet still down or am I doing something wrong? (I just generated the key pairs with the flow-cli and copied the pub key in the form - my RequestID is 544eece5-8421-4d77-9f78-cf7a15ea484a)

Ah, sorry about that @fabius! I accepted your request 3 days ago, but the account creation failed due to a formatting error with the public key. I’ll email you with more details :slight_smile:

1 Like

Thanks @pete! Just answered you back. Next time gonna double check the public key. The blind copy paste from windows power shell after the ‘generate key’ command results in a public key splitted by an empty space.

Hi @pete ! I’m not able to deploy on testnet yet. Still waiting to have a response from the faucet. Can you check my request? RequestID: 63b3527a-6c9d-4ee3-9d96-1ae56da68afa

You should have just received an email with your new account. Sorry about that!

Hey Pete! I’m back! Everything’s working, just deployed my first smart contract on the testnet! Thank you!

1 Like

Great to hear!!