2

I'm checking the Value locked by certain ValidatorHash of another script that I deployed. Does anyone know how to get Ledger.Address or ValidatorHash from Plutus or cardano-cli? I know the "address" that is a string that starts with "addr_test1..." but how do I turn that into the above Plutus types?

Sort of like this question but for ValidatorHash. I know that you can use cardano-cli transaction policyid for monetary policies, is there an equivalent for ValidatorHash?

Thanks!

1
  • So you want to go from address (addr_test1...) to Ledger.Address or ValidatorHash?
    – georgeos
    Nov 18 '21 at 22:16
1

Just tested on testnet, cardano-cli transaction policyid --script-file ... works.

Just make sure in your Haskell code to include something like the following to turn it into an address:

testnetDumpValidatorHash :: ValidatorHash
testnetDumpValidatorHash = "10101010110101010101010101010101010101010101010101123456"
 
testnetDumpAddress :: Ledger.Address
testnetDumpAddress = scriptHashAddress testnetDumpValidatorHash

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.