Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Transfer xtz from a smart contract to another smart contract #54

Open
Tore19 opened this issue Oct 21, 2019 · 1 comment
Open

Comments

@Tore19
Copy link

Tore19 commented Oct 21, 2019

"parameters": {
"entrypoint": "do",
"value": [{
"prim": "DROP"
}, {
"prim": "NIL",
"args": [{
"prim": "operation"
}]
}, {
"prim": "PUSH",
"args": [{
"prim": "address"
}, {
"string": "KT1LsXWNrbvbtkjHjryJLEPyWESy4vPzrxzh"
}]
}, {
"prim": "CONTRACT",
"args": [{
"prim": "unit"
}]
}, {
"prim": "ASSERT_SOME"
}, {
"prim": "PUSH",
"args": [{
"prim": "mutez"
}, {
"int": "100000"
}]
}, {
"prim": "UNIT"
}, {
"prim": "TRANSFER_TOKENS"
}, {
"prim": "CONS"
}]
},

It shows error as follows:

Failed to parse the request body: No case matched:
At /kind, unexpected string instead of endorsement
At /kind, unexpected string instead of seed_nonce_revelation
At /kind, unexpected string instead of double_endorsement_evidence
At /kind, unexpected string instead of double_baking_evidence
At /kind, unexpected string instead of activate_account
At /kind, unexpected string instead of proposals
At /kind, unexpected string instead of ballot
At /kind, unexpected string instead of reveal
At /parameters/value, no case matched:
Unexpected array instead of object
Unexpected array instead of object
Unexpected array instead of object
At [4], no case matched:
Missing object field int
Missing object field string
Missing object field bytes
Unexpected object instead of array
At /prim, unexpected string value "ASSERT_SOME" instead of "ADD" , "IF_NONE" , "SWAP" , "set" , "nat" , "CHECK_SIGNATURE" , "IF_LEFT" , "LAMBDA" , "Elt" , "CREATE_CONTRACT" , "NEG" , "big_map" , "map" , "or" , "BLAKE2B" , "bytes" , "SHA256" , "SET_DELEGATE" , "CONTRACT" , "LSL" , "SUB" , "IMPLICIT_ACCOUNT" , "PACK" , "list" , "PAIR" , "Right" , "contract" , "GT" , "LEFT" , "STEPS_TO_QUOTA" , "storage" , "TRANSFER_TOKENS" , "CDR" , "SLICE" , "PUSH" , "False" , "SHA512" , "CHAIN_ID" , "BALANCE" , "signature" , "DUG" , "SELF" , "EMPTY_BIG_MAP" , "LSR" , "OR" , "XOR" , "lambda" , "COMPARE" , "key" , "option" , "Unit" , "Some" , "UNPACK" , "NEQ" , "INT" , "pair" , "AMOUNT" , "DIP" , "ABS" , "ISNAT" , "EXEC" , "NOW" , "LOOP" , "chain_id" , "string" , "MEM" , "MAP" , "None" , "address" , "CONCAT" , "EMPTY_SET" , "MUL" , "LOOP_LEFT" , "timestamp" , "LT" , "UPDATE" , "DUP" , "SOURCE" , "mutez" , "SENDER" , "IF_CONS" , "RIGHT" , "CAR" , "CONS" , "LE" , "NONE" , "IF" , "SOME" , "GET" , "Left" , "CAST" , "int" , "SIZE" , "key_hash" , "unit" , "DROP" , "EMPTY_MAP" , "NIL" , "DIG" , "APPLY" , "bool" , "RENAME" , "operation" , "True" , "FAILWITH" , "parameter" , "HASH_KEY" , "EQ" , "NOT" , "UNIT" , "Pair" , "ADDRESS" , "EDIV" , "CREATE_ACCOUNT" , "GE" , "ITER" , "code" or "AND"
Unexpected array instead of object
At /kind, unexpected string instead of origination
At /kind, unexpected string instead of delegation

@iguerNL
Copy link

iguerNL commented Feb 8, 2020

We have also this issue in Dune Wallet as it's based on Tezbox codebase.
ASSERT_SOME is not a valid Michelson instruction, but a macro expended by the client to:

 IF_NONE {
   UNIT  ;
   FAILWITH
 }

So, this line in /skin/js/tezbox.js should be replaced with:

      [ { "prim": "IF_NONE",
                          "args":
                            [ [ [ { "prim": "UNIT" },
                                  { "prim": "FAILWITH" } ] ], [] ] } ],

This needs 45k gas at least

@stephenandrews

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants