5

I'm trying to work with the example code from the liquidity documentation for Contract.create(). The code compiles and tests on the online-editor properly. It also deploys using the editor. But when I call it after deployment, it throws an error: Unhandled error: Failure backtracked The code is given below:

contract S = struct
  type storage = tez * string
  let%entry main () s  = [], s
end

type storage = address

let%init storage (add : address) = add  

let%entry main ((delegate : key_hash), (manager : key_hash)) _ =
  let delegatable = true in
  let spendable = false in
  let initial_storage = (10tz,"Hello") in
  let (op, addr) =
    Contract.create ~storage:initial_storage ~manager ~spendable
      ~delegatable ~delegate:(Some delegate) ~amount:10tz (contract S) in
  [op], addr
  • 3
    Could you give more information ? With which parameters are you calling ? What are the balances of both contracts ? – lefessan Feb 23 at 17:35
  • 1
    I'm calling the main function from the call function provided alongside the editor itself. I'm passing my account key_hash (downloaded from alphanet faucet) as both parameters. Balance in my main account is ~25000tz and in the deployed contract is 100tz. – pathfinder Feb 23 at 19:46
  • 1
    Is this an implicit vs originated account issue? Can I register my account (which I had downloaded from alphanet faucet) as delegate and will that help? – pathfinder Feb 23 at 20:00

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.