1

I have a simple smart-contract that holds user funds and that can be withdrawn by sending a signed message.

However, I would like to offer the possibility for users to anticipate the fees they have to pay everytime they send funds to the contract.

I can properly call the contract with the taquito library by using the contract abstraction object:

const operation = await contract.methods
        .feedUserAccount(this.tezosAddress)
        .send({ amount });

However, when I test it with the EstimationProvider class, I get a TezosOperationError:

try{
    const e = await Tezos.contract.at("KT1KBhwoSeqJt26oK8yjubTfdSgDuaVC87xR");
    const o = await Tezos.estimate.transfer({ 
      to: "KT1KBhwoSeqJt26oK8yjubTfdSgDuaVC87xR", 
      amount: 1,
      source: "tz1wWzjK62ft3jufvrua6zfT3sLVmo7776kq",
      parameter: {
        entrypoint: 'feedUserAccount',
        value: {prim:"Left",args:[{prim:"Left",args:[{prim:"Right",args:[{string:"tz1wWzjK62ft3jufvrua6zfT3sLVmo7776kq"}]}]}]}
      }
    });
    console.log(o.suggestedFeeMutez);

Error message:

TezosOperationError {
  errors: 
   [ { kind: 'permanent',
       id: 'proto.005-PsBabyM1.michelson_v1.bad_contract_parameter',
       contract: 'KT1KBhwoSeqJt26oK8yjubTfdSgDuaVC87xR' },
     { kind: 'permanent',
       id: 'proto.005-PsBabyM1.invalidSyntacticConstantError',
       location: 0,
       expectedForm: [Object],
       wrongExpression: [Object] },
     { kind: 'permanent',
       id: 'proto.005-PsBabyM1.invalidSyntacticConstantError',
       location: 0,
       expectedForm: [Object],
       wrongExpression: [Object] },
     { kind: 'permanent',
       id: 'proto.005-PsBabyM1.invalidSyntacticConstantError',
       location: 0,
       expectedForm: [Object],
       wrongExpression: [Object] },
     { kind: 'permanent',
       id: 'proto.005-PsBabyM1.invalidSyntacticConstantError',
       location: 0,
       expectedForm: [Object],
       wrongExpression: [Object] },
     { kind: 'permanent',
       id: 'proto.005-PsBabyM1.michelson_v1.invalid_expression_kind',
       location: 0,
       expected_kinds: [Array],
       wrong_kind: 'primitiveApplication' } ],
  name: 'TezosOperationError',
  id: 'proto.005-PsBabyM1.michelson_v1.invalid_expression_kind',
  kind: 'permanent',
  message: '(permanent) proto.005-PsBabyM1.michelson_v1.invalid_expression_kind' }

The feedUserAccount expects a key_hash and I generated the value parameter with SmartPY explorer. But I can't make it work, is it the library or the way I generate the query?

The babylonet contract can be found at this address: KT1KBhwoSeqJt26oK8yjubTfdSgDuaVC87xR

  • Sorry, I'm not an export on taquito. Do you have any reference to the documentation of the estimator? Do you know if there is a way of running taquito in a debugging mode, so that the underlying RPC calls are visible? That would help to understand the error you receive. – arvidj Feb 4 at 18:56
  • From the tezos-dev slack, #taquito: "if your script runs in the browser, you can use the browser’s debugging console/network tab". I think this output could help to diagnose your error. – arvidj Feb 4 at 19:13

Your Answer

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

Browse other questions tagged or ask your own question.