#Request for `soroban lab token wrap` to output the hash if the contract has already been deployed

28 messages · Page 1 of 1 (latest)

rugged oyster
#

It can actually be non-trivial to find the hash of an already deployed wrapped token contract. Rather than erroring I'd love to see the CLI output the hash of the existing wrapped token contract vs

% soroban lab token wrap --asset native --network Futurenet        
error: transaction simulation failed: HostError
Value: Status(UnknownError(0))

Debug events (newest first):
   0: "Debug Contract already exists"

Backtrace (newest first):
   0: soroban_env_host::host::err_helper::<impl soroban_env_host::host::Host>::err
   1: soroban_env_host::host::Host::create_contract_with_id_preimage
   2: soroban_env_host::host::Host::invoke_functions
   3: preflight::preflight_invoke_hf_op_or_maybe_panic
   4: preflight_invoke_hf_op
   5: _cgo_d46d261efae2_Cfunc_preflight_invoke_hf_op
             at /tmp/go-build/cgo-gcc-prolog:79:11
   6: runtime.asmcgocall
             at ./runtime/asm_amd64.s:848
slender vector
wicked haven
#

i've had alot of problem trying to find the installation id of a deployed contract

#

i was trying to figure it out here

#

i want to know the key of an installation so i can download the source code

#

not quite the same what you're trying to do but anyways

#

i know your big brain can answer

spice orbit
#

given stellar_strkey::Contract provide pub asset: String,?

wicked haven
#

ya that'd be great

#

we talked about having soroban lab asset lookup at some point but i don't think it happened

spice orbit
#

well, @slender vector just made it happen with this cmd 🙂 LOL ... you pass an asset string, get back ContractKey

wicked haven
#

awesome i have to install this

#

fine i made a new help thread for my problem instaed of trying to hijack this one

wicked haven
#

this indeed looks like it will help

#

i'm working on some helper functions to obtain contract data and metadata from the ledger and been struggling

slender vector
#

the token id is a sha256, getting it reversed is not possible (right?). But since this is a contract you can call symbol() and other functions on it.

spice orbit
sand pilot
#

yeah you can't get the asset from the strkey

spice orbit
sand pilot
#

ahh sure, got you 👍

slender vector
wicked haven
#

would the admin be the issuer?

slender vector
#

I suppose yes, but the interface does not expose it

wicked haven
#

perhaps you can obtain it from the ledger key associated to the storage somehow i'm really not sure. it's an interesting problem.