ltfschoen / XCMTemplate

Building Cross-chain (XCM) DApps with Docker
Mozilla Public License 2.0
3 stars 0 forks source link

Store the output of the Code Hash and the Contract Hash #6

Closed ltfschoen closed 1 year ago

ltfschoen commented 1 year ago

When you run

cargo contract upload --suri //Alice \
        --execute \
        --skip-confirm

It outputs a "Code hash" like

   Code hash "0x2b647f2b8cddc0a49ac43faaef0c420bbe2920484a8ec30dc375dec946fc25e5"

Also, when you run

cargo contract instantiate \
        --suri //Bob \
        --constructor new \
        --args true \
        --execute \
        --skip-confirm

It outputs a "Contract hash" at the end of the terminal output

    Contract 5EYY1hrjrU7ZEBVd7mufJkMTos2z6uhUN4F6Ax7k85XrfZvk

We want to get both those values when they are output and store them in environment variables CODE_HASH and CONTRACT_ADDR so they may be used programmatically in subsequent commands as a script

ltfschoen commented 1 year ago

solved in https://github.com/ltfschoen/InkTemplate/pull/7