I am using multisig.liq
at Try-Liquidity to generate a KT1 address(which has 3 owners, need 2 agree) and I send 10 xtz to it. When I transfer 2 to another KT1 address, I got ../preapply/operations failed
.
I made sure transfer's param "parameters" is right(I paid and transfered 2 xtz to a tz1 address, then I found the block that include pay or manage transaction to get "parameters").
For pay is:
'parameters': {
'prim': 'Left',
'args': [{
'prim': 'Unit'
}]
}
For manage is:
'parameters': {
'prim': 'Right',
'args': [{
'prim': 'Some',
'args': [{
'prim': 'Pair',
'args': [{
'string': $destination
}, {
'int': $amount
}]
}]
}]
}
So I want to transfer to another KT1 address. First, I forged operation. Here's the code:
header2 = {"Content-Type": "application/json","Cache-Control": "no-cache"}
branch = requests.get("https://alphanet.tezrpc.me/chains/main/blocks/head/hash",headers=header1)
counter = requests.get("https://alphanet.tezrpc.me/chains/main/blocks/head/context/contracts/tz1PvVPHCtyvwrpLKoCFBXbiPh3DwmiFFKnQ/counter",headers=header1)
print(branch.json())
print(counter.json())
body = {'contents': [{
'kind': 'transaction',
'amount': '0',
'source': 'tz1PvVPHCtyvwrpLKoCFBXbiPh3DwmiFFKnQ',
'destination': 'KT1DKT2QpnwNnRCzVnYYuwuZuuS2AAajHBC4',
'storage_limit': '60000',
'gas_limit': '400000',
'fee': '50000',
'counter': str(int(counter.json()) + 1),
'parameters': {
'prim': 'Right',
'args': [{
'prim': 'Some',
'args': [{
'prim': 'Pair',
'args': [{
'string': 'KT1CY4g5MTxwyfC7zT5eju8FkdgmnGgHF5Qj'
}, {
'int': '2000000'
}]
}]
}]
}
}],
'branch': branch.json()
}
r = requests.post("https://alphanet.tezrpc.me/chains/main/blocks/head/helpers/forge/operations",json = body,headers=header2)
print(r.json())
result is ok,return: iaee37aa2db362fd021d14d669e7f34df15216e98714d31d4ecccc4c6bcdc11b10800002efd70b3ca5eb8d39531d36aa1b4eea21d52e8a0d08603c76880b518e0d403000133f2e99faa15741f833d623aa99800701aa2036900ff0000003405080509070701000000244b543143593467354d547877796643377a5435656a7538466b64676d6e4767484635516a008092f401
This is when ../preapply/operations failed
happens. Here is the result:
'contents': [{
'kind': 'transaction',
'source': 'tz1PvVPHCtyvwrpLKoCFBXbiPh3DwmiFFKnQ',
'fee': '50000',
'counter': '13383',
'gas_limit': '400000',
'storage_limit': '60000',
'amount': '0',
'destination': 'KT1DKT2QpnwNnRCzVnYYuwuZuuS2AAajHBC4',
'parameters': {
'prim': 'Right',
'args': [{
'prim': 'Some',
'args': [{
'prim': 'Pair',
'args': [{
'string': 'KT1CY4g5MTxwyfC7zT5eju8FkdgmnGgHF5Qj'
}, {
'int': '2000000'
}]
}]
}]
},
'metadata': {
'balance_updates': [{
'kind': 'contract',
'contract': 'tz1PvVPHCtyvwrpLKoCFBXbiPh3DwmiFFKnQ',
'change': '-50000'
}, {
'kind': 'freezer',
'category': 'fees',
'delegate': 'tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU',
'level': 104,
'change': '50000'
}],
'operation_result': {
'status': 'failed',
'errors': [{
'kind': 'permanent',
'id': 'proto.003-PsddFKi3.badContractParameter',
'contract': 'KT1DKT2QpnwNnRCzVnYYuwuZuuS2AAajHBC4'
}, {
'kind': 'permanent',
'id': 'proto.003-PsddFKi3.invalidConstantTypeError',
'location': 0,
'expectedType': {
'prim': 'or',
'args': [{
'prim': 'unit',
'annots': ['%_Liq_entry_pay']
}, {
'prim': 'option',
'args': [{
'prim': 'pair',
'args': [{
'prim': 'key_hash',
'annots': ['%destination']
}, {
'prim': 'mutez',
'annots': ['%amount']
}],
'annots': [':proposition']
}],
'annots': ['%_Liq_entry_manage']
}],
'annots': [':_entries']
},
'wrongExpression': {
'prim': 'Right',
'args': [{
'prim': 'Some',
'args': [{
'prim': 'Pair',
'args': [{
'string': 'KT1CY4g5MTxwyfC7zT5eju8FkdgmnGgHF5Qj'
}, {
'int': '2000000'
}]
}]
}]
}
}, {
'kind': 'permanent',
'id': 'proto.003-PsddFKi3.invalidConstantTypeError',
'location': 1,
'expectedType': {
'prim': 'option',
'args': [{
'prim': 'pair',
'args': [{
'prim': 'key_hash',
'annots': ['%destination']
}, {
'prim': 'mutez',
'annots': ['%amount']
}],
'annots': [':proposition']
}]
},
'wrongExpression': {
'prim': 'Some',
'args': [{
'prim': 'Pair',
'args': [{
'string': 'KT1CY4g5MTxwyfC7zT5eju8FkdgmnGgHF5Qj'
}, {
'int': '2000000'
}]
}]
}
}, {
'kind': 'permanent',
'id': 'proto.003-PsddFKi3.invalidConstantTypeError',
'location': 2,
'expectedType': {
'prim': 'pair',
'args': [{
'prim': 'key_hash',
'annots': ['%destination']
}, {
'prim': 'mutez',
'annots': ['%amount']
}],
'annots': [':proposition']
},
'wrongExpression': {
'prim': 'Pair',
'args': [{
'string': 'KT1CY4g5MTxwyfC7zT5eju8FkdgmnGgHF5Qj'
}, {
'int': '2000000'
}]
}
}, {
'kind': 'permanent',
'id': 'proto.003-PsddFKi3.invalidConstantTypeError',
'location': 3,
'expectedType': {
'prim': 'key_hash'
},
'wrongExpression': {
'string': 'KT1CY4g5MTxwyfC7zT5eju8FkdgmnGgHF5Qj'
}
}]
}
}
}],
'signature': 'edsigtu9rtsMXF9GeMTu9QCwWeNMLmsn8BMMkcMVRPuLD9mtNAQSmPuMvNBvuXza4sygyxT9KGjsWyBNsEpVGB8mg8t5mUShekk'
}]
Could someone tell me how to transfer from a KT1 address to another KT1 address? After all, the application only exists for the scenario: transfer XTZ between 2 multisign KT1 address.
hope Ocaml Pro can answer. because the example mulitisig.liq can't send to another KT1 address