I would like to deploy my smart contract but I don't know what to put as parameters in the storage (I'm new to tezos). Thank you very much to those who will take the time to help me :)
//FA2
'(pair (pair (pair (address %admin) (big_map %ledger nat address))
(pair (big_map %metadata string bytes) (nat %next_token_id)))
(pair (pair (big_map %operators (pair address (pair address nat)) unit)
(big_map %reverse_ledger address (list nat)))
(big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes)))))' ;
//FA2
'(pair (pair (pair { Elt "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" } { Elt 1 "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" })
(pair { Elt "" 0x68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f6f7269616e6131332f36663138333737353065366562383163646434666633363230663738613133322f7261772f653238396663353037326235613931353134383936376239613433333765313835343731363561322f636f6e74726163745f6d6574612e6a736f6e } { 0 2 }))
(pair (pair { Elt (pair "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" 1) unit }
{ Elt "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" (list nat)) }
{ Elt 0 (pair 1 { Elt "" 0x68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f6f7269616e6131332f35313763373231396531383639333938613765666631343335623862653237392f7261772f326337336132613564353365626466313662633864623831643837343236353964323763646462332f6e66745f6d6574612e6a736f6e)))) }' ;
my deploy.ts file:
import { TezosToolkit } from '@taquito/taquito'
import { importKey } from '@taquito/signer'
import * as fs from 'fs';
const provider = 'https://rpc.hangzhou.tzstats.com'
async function deploy() {
const tezos = new TezosToolkit(provider)
await importKey(
tezos,
'[email protected]', //mail
'ZSrbDk3Nzf', //password
[
"sky",
"inquiry",
"build",
"man",
"aunt",
"topic",
"pattern",
"image",
"giant",
"burger",
"shock",
"banner",
"safe",
"initial",
"big"
].join(' '),
'My Secret' //private key
)
try {
const op = await tezos.contract.originate({
//smart contract code
code: JSON.parse(fs.readFileSync("./nft2.json").toString()),
//storage state
init: '(Pair (Pair (Pair "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" { Elt 1 "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" }) (Pair { Elt "" 0x68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f6f7269616e6131332f36663138333737353065366562383163646434666633363230663738613133322f7261772f653238396663353037326235613931353134383936376239613433333765313835343731363561322f636f6e74726163745f6d6574612e6a736f6e } 2)) (Pair (Pair { 1 1 } { Elt "tz1i3veHnR4ogcwKmgugcqnunTmTYP8s8ZAr" 1 }) { Elt 1 (Pair 1 { Elt "" 0x68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f6f7269616e6131332f35313763373231396531383639333938613765666631343335623862653237392f7261772f326337336132613564353365626466313662633864623831643837343236353964323763646462332f6e66745f6d6574612e6a736f6e }) }))'
})
//beginning to deploy
console.log('Awaiting confirmation...')
const contract = await op.contract()
//deployment report: amount of used gas, storage state
console.log('Gas Used', op.consumedGas)
console.log('Storage', await contract.storage())
//operation hash one can use to find the contract in the explorer
console.log('Operation hash:', op.hash)
} catch (ex) {
console.error(ex)
}
}
deploy()
But the parameters that I provide in the deploy file, in my init variable are not good, I am trying to understand which parameters to pass.