#DID contract deploy

17 messages · Page 1 of 1 (latest)

south mortar
#

Hey @warm patio, I have a question regarding the algo-did deployment. I used the app spec from https://github.com/joe-p/algo-did/tree/main/contracts/artifacts

and generated a typed client and try to deploy the app to localnet with:

from algokit_utils import OnSchemaBreak, OnUpdate

from smart_contracts.artifacts.algo_did.client import AlgoDidMethodCallCreateParams

factory = algorand.client.get_typed_app_factory(
  AlgoDidFactory,
  default_sender=deployer.address,
  default_signer=deployer.signer
)
app_client, result = factory.deploy(
  on_update=OnUpdate.AppendApp, on_schema_break=OnSchemaBreak.AppendApp
)

I get the following error on the factory.deploy call:

python3.12/site-packages/algosdk/v2client/algod.py", line 111, in algod_request
    raise error.AlgodHTTPError(e, code)
algosdk.error.AlgodHTTPError: TransactionPool.Remember: transaction KT5HMSJCDK6VKGEOBSEIJMWEDWYJ3LFDN5EJBZTDFTOBA3SUUNNQ: logic eval error: invalid ApplicationArgs index 0. Details: app=1011, pc=655, opcodes=return; label1:; pushbytes 0xb8447b36 // 0xb8447b36; txna ApplicationArgs 0

Is there an app arg expected which is not provided with the standard factory deploy call?

GitHub

Contribute to joe-p/algo-did development by creating an account on GitHub.

warm patio
#

This error occurs when you try to call a bare method on a app that doesn't support it. You'll need to call the createApplication method by adding that method to create_params on the deploy call. Alternatively if you don't need the deploy logic then you can create an app client directly without deploy (with app id 0) and call createApplication

south mortar
#

Thanks I could deploy a contract, never encountered that before.

Any idea why this fails?

let atc = appClient.newGroup();
    const mbrPayment = await appClient.algorand.createTransaction.payment({
      amount: totalCost.microAlgos(),
      receiver: appClient.appAddress,
      sender: creator.addr,
      signer: creator.signer,
    });
    console.log('[DID]: TEST PAYMENT');
    // atc.addTransaction(mbrPayment);
    // const res = await atc.send({ populateAppCallResources: true });
    // console.log(res);

    console.log('[DID]: Add start upload ');
    atc.startUpload({
      args: {
        pubKey: publicKey,
        numBoxes: numBoxes,
        endBoxSize: endBoxSize,
        mbrPayment: mbrPayment,
      },
    });
    const res = await atc.send({ populateAppCallResources: true });
    console.log(res);

with error:

address seems to be malformed: expected length 58, got 32: �����2�Tq$>�/�F8��.
��+��m�m dress seems to be malformed: expected length 58, got 32: �����2�Tq$>�/�F8��.
...
at async TransactionComposer.build...

the payment transaction itself works fine, but as soon as I try to plug it into the appcall I get this error

south mortar
#

the public key is calculated like this:

    Buffer.from(decodeAddress(wallet).publicKey).toString(
      'hex'
    );

after I changed the public key to use just the wallet (58 chars hint) it works.

why the actual wallet needs to be passed here? Is it because the contract is only working with the 32 byte public key when working with addresses?

south mortar
#

Also the typed client does not provide access to the boxes, any chance you can provide the arc56.json?

fathom cave
#

public key expects an Address value of 58 chars

#

can ya try passing the Address itself not encode into hex

south mortar
#

Hey, @fathom cave as I texted, the deploy was working with the address as input 👍

fathom cave
#

cool

warm patio
south mortar
small cloakBOT
#

Gave +1 Rep to @warm patio (current: #12 - 23)

warm patio
#

This hasn’t been merged yet but yes this repo should be the source of truth. I will archive my old repo once this is merged (probably next week)

south mortar
#

I see that this is based on your tealscript contract. Does this mean this contract also has this create_params quirks with the deploy factory?

fathom cave
#

how to verify the VC ? in the did

#

like get the box and check if the vc exists