Launch starknet-devnet
npx ts-node ./src/1.declareDeployContract.ts
After creation of the king.json
file with the file2felts tool, you send the data in a new smart-contract.
This contract is already declared in Tesnet with this Class_hash And has been deployed first here
You can deploy your own contract (including your own binary file), using this class.
npx ts-node ./src/2.CallInvokeContract.ts
You ask to the contract to send you the content of the binary file, the result is kingRead.json
.
npx ts-node ./src/3.decodeJson.ts
A file kingRecovered.gif
is created, identical to the original king.gif
.
Then you can use this result in your DAPP.
Typical use case is a non upgradable NFT smart-contract, that includes a tiny picture of the NFT. It's an ultra strong proof that this picture belong to this NFT.