Guest User

tezos output

a guest
Oct 13th, 2020
164
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (venv) $ poetry run python3 test_dummy_contract_call.py
  2. # /Users/dariuscognac/tezos/tezos-node identity generate 0.0 --data-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-node.h526v1z6
  3. Generating a new identity... (level: 0.00)
  4. Stored the new identity (idtdKWnSQy9Ah1TsUVk8emeLfAswmL) into '/var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-node.h526v1z6/identity.json'.
  5.  
  6. # /Users/dariuscognac/tezos/tezos-node config init --data-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-node.h526v1z6 --net-addr 127.0.0.1:19730 --rpc-addr 127.0.0.1:18730 --expected-pow 0.0 --connections 500 --bootstrap-threshold 0 --private-mode --network sandbox
  7. Created /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-node.h526v1z6/config.json for network: sandbox.
  8.  
  9. # /Users/dariuscognac/tezos/tezos-node run --data-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-node.h526v1z6 --no-bootstrap-peers --connections 500 --bootstrap-threshold 0 --private-mode --network sandbox --peer 127.0.0.1:19730 --peer 127.0.0.1:19731 --peer 127.0.0.1:19732 --peer 127.0.0.1:19733 --peer 127.0.0.1:19734 --peer 127.0.0.1:19735 --peer 127.0.0.1:19736 --peer 127.0.0.1:19737 --peer 127.0.0.1:19738 --peer 127.0.0.1:19739 --peer 127.0.0.1:19740 --peer 127.0.0.1:19741 --peer 127.0.0.1:19742 --peer 127.0.0.1:19743 --peer 127.0.0.1:19744 --peer 127.0.0.1:19745 --peer 127.0.0.1:19746 --peer 127.0.0.1:19747 --peer 127.0.0.1:19748 --peer 127.0.0.1:19749 --peer 127.0.0.1:19750 --peer 127.0.0.1:19751 --peer 127.0.0.1:19752 --peer 127.0.0.1:19753 --peer 127.0.0.1:19754 --peer 127.0.0.1:19755 --peer 127.0.0.1:19756 --peer 127.0.0.1:19757 --peer 127.0.0.1:19758 --peer 127.0.0.1:19759 --peer 127.0.0.1:19760 --peer 127.0.0.1:19761 --peer 127.0.0.1:19762 --peer 127.0.0.1:19763 --peer 127.0.0.1:19764 --peer 127.0.0.1:19765 --peer 127.0.0.1:19766 --peer 127.0.0.1:19767 --peer 127.0.0.1:19768 --peer 127.0.0.1:19769 --peer 127.0.0.1:19770 --peer 127.0.0.1:19771 --peer 127.0.0.1:19772 --peer 127.0.0.1:19773 --peer 127.0.0.1:19774
  10. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 rpc get /network/version
  11. { "chain_name": "TEZOS", "distributed_db_version": 0, "p2p_version": 1 }
  12.  
  13. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 -w none config update
  14. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key bootstrap1 unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh
  15. Tezos address added: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
  16.  
  17. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key bootstrap2 unencrypted:edsk39qAm1fiMjgmPkw1EgQYkMzkJezLNewd7PLNHTkr6w9XA2zdfo
  18. Tezos address added: tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN
  19.  
  20. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key bootstrap3 unencrypted:edsk4ArLQgBTLWG5FJmnGnT689VKoqhXwmDPBuGx3z4cvwU9MmrPZZ
  21. Tezos address added: tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU
  22.  
  23. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key bootstrap4 unencrypted:edsk2uqQB9AY4FvioK2YMdfmyMrer5R8mGFyuaLLFfSRo8EoyNdht3
  24. Tezos address added: tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv
  25.  
  26. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key bootstrap5 unencrypted:edsk4QLrcijEffxV31gGdN2HU7UpyJjA8drFoNcmnB28n89YjPNRFm
  27. Tezos address added: tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv
  28.  
  29. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key baker1_key unencrypted:edsk432L71B91i1sE8rQxPDMo2Yxo4qaYqhktvpt8yovaMpo1NUbBt
  30. Tezos address added: tz1UJbFsTQfdpa1qYrqHG9Ykw834AXi5WqRR
  31.  
  32. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key baker2_key unencrypted:edsk3jjD4cLvE1t3SiZKCRiH9SXnJ4jHEsVpfcuRwfe7sfbnsMGX6f
  33. Tezos address added: tz1fWJ2oeeG6h2r61XY1wen2sV87AvCqGjAU
  34.  
  35. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key baker3_key unencrypted:edsk3EVDFeDsefk1UoWWhDhnBpERhAwqHbVzWnBwA4tdUL8aBhw7RC
  36. Tezos address added: tz1SERFDUknkjJTas8sUco7dskxWrUWhTc2s
  37.  
  38. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key baker4_key unencrypted:edsk2rAmeBDrQ5d1FhDoTdifMvBsqSosmPSBhxL74huszZhfMFtiKb
  39. Tezos address added: tz1eJ9yR95LmJgVrGLvgt56T6ngCFcgjLo2S
  40.  
  41. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key baker5_key unencrypted:edsk4Ssc63dnYJUptVMaKfmHLJNMBYv9piYiRCiYjcH3gacKWP1z3v
  42. Tezos address added: tz1cwoRFe3BzJv9nZZBA5fk8uV6w9AVVrBF9
  43.  
  44. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 import secret key activator unencrypted:edsk31vznjHSSpGExDMHYASz45VZqXN4DPxvsa4hAyY8dHM28cZzp6
  45. Tezos address added: tz1TGu6TN5GSez2ndXXeDX6LgUDvLzPLqgYV
  46.  
  47. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 -block genesis activate protocol ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK with fitness 1 and key activator and parameters /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tmpif0e41r7 --timestamp 2020-10-13T14:54:03Z
  48. Injected BM7j9XS6DWN3
  49.  
  50. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 remember contract baker1 SG1fpFaowYY8G7PfkYdKkGmsMziHKUfrHRHW
  51. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 remember contract baker2 SG1TLmKJHVJxQosY6iN21AW77HsAapdupxnR
  52. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 remember contract baker3 SG1hExdK69Z2RZkkQjKtLG6H4L4FGTZeGKHu
  53. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 remember contract baker4 SG1mHgeWHGMnCUMJ8jZ1Cdh3DkWEcQ88tziJ
  54. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 remember contract baker5 SG1jfZeHRzeWAM1T4zrwunEyUpwWc82D4tbv
  55. # /Users/dariuscognac/tezos/tezos-baker-alpha -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://127.0.0.1:18730 run with local node /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-node.h526v1z6 baker5
  56. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 originate contract pssig_contract transferring 0 from bootstrap1 running dummy_pssig.tz --init Unit --burn-cap 9
  57. Node is bootstrapped.
  58. Estimated gas: 26962000 units (will add 100000 for safety)
  59. Estimated storage: 937 bytes added (will add 20 for safety)
  60. Operation successfully injected in the node.
  61. Operation hash is 'opMTBCDCoQcAQ56Q6kqQmBo1RZWjVS14vBUtCyfd9vnzTY2iunW'
  62. NOT waiting for the operation to be included.
  63. Use command
  64. tezos-client wait for opMTBCDCoQcAQ56Q6kqQmBo1RZWjVS14vBUtCyfd9vnzTY2iunW to be included --confirmations 30 --branch BLTBN4vpkPq2HHRCse5MwR5BXkprF9Zdk1eXCW5rkpZ6xD7g69x
  65. and/or an external block explorer to make sure that it has been included.
  66. This sequence of operations was run:
  67. Manager signed operations:
  68. From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
  69. Fee to the baker: ꜩ0.003616
  70. Expected counter: 1
  71. Gas limit: 27062000
  72. Storage limit: 957 bytes
  73. Balance updates:
  74. tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ................ -ꜩ0.003616
  75. fees(the baker who will include this operation,0) ... +ꜩ0.003616
  76. Origination:
  77. From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
  78. Credit: ꜩ0
  79. Script:
  80. { parameter
  81. (pair (pair (pair (string %chanID) (pair (mutez %custBal) (string %g2)))
  82. (pair (contract %k
  83. (pair (pair (mutez %newCustBal) (mutez %newMerchBal))
  84. (pair (bytes %newRevLock) (bool %valid))))
  85. (pair (mutez %merchBal) (string %merchPk0))))
  86. (pair (pair (string %merchPk1) (pair (string %merchPk2) (string %merchPk3)))
  87. (pair (pair (string %merchPk4) (bytes %revLock)) (pair (string %s1) (string %s2))))) ;
  88. storage unit ;
  89. code { DUP ;
  90. CDR ;
  91. SWAP ;
  92. CAR ;
  93. DUP ;
  94. CDDDDR ;
  95. SWAP ;
  96. DUP ;
  97. DUG 2 ;
  98. CDDDAR ;
  99. CONCAT ;
  100. SIZE ;
  101. PUSH nat 5 ;
  102. COMPARE ;
  103. LT ;
  104. IF { PUSH bool True } { PUSH bool False } ;
  105. IF { DUP ;
  106. CADAR ;
  107. NIL operation ;
  108. SWAP ;
  109. PUSH mutez 0 ;
  110. PUSH bool True ;
  111. DIG 4 ;
  112. DUP ;
  113. DUG 5 ;
  114. CDDADR ;
  115. PAIR %newRevLock %valid ;
  116. DIG 4 ;
  117. DUP ;
  118. CADDAR ;
  119. SWAP ;
  120. CAADAR ;
  121. PAIR %newCustBal %newMerchBal ;
  122. PAIR ;
  123. TRANSFER_TOKENS ;
  124. CONS }
  125. { DUP ;
  126. CADAR ;
  127. NIL operation ;
  128. SWAP ;
  129. PUSH mutez 0 ;
  130. PUSH bool False ;
  131. DIG 4 ;
  132. DUP ;
  133. DUG 5 ;
  134. CDDADR ;
  135. PAIR %newRevLock %valid ;
  136. DIG 4 ;
  137. DUP ;
  138. CADDAR ;
  139. SWAP ;
  140. CAADAR ;
  141. PAIR %newCustBal %newMerchBal ;
  142. PAIR ;
  143. TRANSFER_TOKENS ;
  144. CONS } ;
  145. PAIR } }
  146. Initial storage: Unit
  147. No delegate for this contract
  148. This origination was successfully applied
  149. Originated contracts:
  150. KT1XLndPcmBKtsYcFtguZtstxeQKdLm2uxwy
  151. Storage size: 680 bytes
  152. Paid storage size diff: 680 bytes
  153. Consumed gas: 26962000
  154. Balance updates:
  155. tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ0.68
  156. tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ0.257
  157.  
  158. New contract KT1XLndPcmBKtsYcFtguZtstxeQKdLm2uxwy originated.
  159. Contract memorized as pssig_contract.
  160.  
  161. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 bake for baker5 --minimal-timestamp
  162. Injected block BLgfFfW6CpGu
  163.  
  164. Oct 13 15:54:11.596 - alpha.baking.forge: found 1 valid operations (0 refused) for timestamp 2020-10-13T14:54:13-00:00 (fitness 01::0000000000000005)
  165.  
  166. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 show known contract pssig_contract
  167. KT1XLndPcmBKtsYcFtguZtstxeQKdLm2uxwy
  168.  
  169.  
  170. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 originate contract my_zkchannel transferring 0 from bootstrap1 running zkchannel_mock.tz --init (Pair (Pair (Pair "randomchanid" (Pair "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" 0)) (Pair (Pair 20000000 "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav") (Pair "0" "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN"))) (Pair (Pair 0 (Pair 10000000 "edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9")) (Pair (Pair "KT1XLndPcmBKtsYcFtguZtstxeQKdLm2uxwy" 0x1f98c84caf714d00ede5d23142bc166d84f8cd42adc18be22c3d47453853ea49) (Pair 3 "awaitingFunding")))) --burn-cap 9
  171. Node is bootstrapped.
  172. Estimated gas: 216810000 units (will add 100000 for safety)
  173. Estimated storage: 8459 bytes added (will add 20 for safety)
  174. Operation successfully injected in the node.
  175. Operation hash is 'opNAPo5dRgF5YNKnZ1XghPXLqToYzeGAtmFrqj87bt7Y8RgW33g'
  176. NOT waiting for the operation to be included.
  177. Use command
  178. tezos-client wait for opNAPo5dRgF5YNKnZ1XghPXLqToYzeGAtmFrqj87bt7Y8RgW33g to be included --confirmations 30 --branch BLgfFfW6CpGuW7ZBQnKixNT1AKx5N9QQd2Ekojfafgsqb81eW2K
  179. and/or an external block explorer to make sure that it has been included.
  180. This sequence of operations was run:
  181. Manager signed operations:
  182. From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
  183. Fee to the baker: ꜩ0.030211
  184. Expected counter: 2
  185. Gas limit: 216910000
  186. Storage limit: 8479 bytes
  187. Balance updates:
  188. tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ................ -ꜩ0.030211
  189. fees(the baker who will include this operation,0) ... +ꜩ0.030211
  190. Origination:
  191. From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
  192. Credit: ꜩ0
  193. Script:
  194. { parameter
  195. (or (or (or (unit %addFunding) (unit %custClaim))
  196. (or (pair %custClose
  197. (pair (pair (string %g2) (string %merchPk0))
  198. (pair (string %merchPk1) (pair (string %merchPk2) (string %merchPk3))))
  199. (pair (pair (string %merchPk4) (pair (mutez %newCustBal) (mutez %newMerchBal)))
  200. (pair (bytes %revLock) (pair (string %s1) (string %s2)))))
  201. (unit %merchClaim)))
  202. (or (or (unit %merchClose) (bytes %merchDispute))
  203. (or (pair %mutualClose
  204. (pair (signature %custSig) (signature %merchSig))
  205. (pair (mutez %newCustBal) (mutez %newMerchBal)))
  206. (or (pair %receiveCall
  207. (pair (mutez %newCustBal) (mutez %newMerchBal))
  208. (pair (bytes %newRevLock) (bool %valid)))
  209. (unit %reclaimFunding))))) ;
  210. storage
  211. (pair (pair (pair (string %chanID) (pair (address %custAddr) (mutez %custBal)))
  212. (pair (pair (mutez %custFunding) (key %custPk))
  213. (pair (timestamp %delayExpiry) (address %merchAddr))))
  214. (pair (pair (mutez %merchBal) (pair (mutez %merchFunding) (key %merchPk)))
  215. (pair (pair (address %pssigContract) (bytes %revLock))
  216. (pair (int %selfDelay) (string %status))))) ;
  217. code { DUP ;
  218. CDR ;
  219. SWAP ;
  220. CAR ;
  221. IF_LEFT
  222. { IF_LEFT
  223. { IF_LEFT
  224. { DROP ;
  225. DUP ;
  226. CDDDDR ;
  227. PUSH string "checkingSig" ;
  228. COMPARE ;
  229. EQ ;
  230. IF {}
  231. { PUSH string "WrongCondition: self.data.status == 'awaitingFunding'" ;
  232. FAILWITH } ;
  233. DUP ;
  234. CAADAR ;
  235. SENDER ;
  236. COMPARE ;
  237. EQ ;
  238. IF { DUP ;
  239. CADAAR ;
  240. AMOUNT ;
  241. COMPARE ;
  242. EQ ;
  243. IF {}
  244. { PUSH string "WrongCondition: sp.amount == self.data.custFunding" ;
  245. FAILWITH } ;
  246. DUP ;
  247. DUP ;
  248. CDR ;
  249. SWAP ;
  250. CAR ;
  251. DUP ;
  252. CDR ;
  253. SWAP ;
  254. CAR ;
  255. DUP ;
  256. CAR ;
  257. SWAP ;
  258. CDAR ;
  259. DIG 4 ;
  260. CADAAR ;
  261. SWAP ;
  262. PAIR ;
  263. SWAP ;
  264. PAIR ;
  265. PAIR ;
  266. PAIR }
  267. {} ;
  268. DUP ;
  269. CADDDR ;
  270. SENDER ;
  271. COMPARE ;
  272. EQ ;
  273. IF { DUP ;
  274. CDADAR ;
  275. AMOUNT ;
  276. COMPARE ;
  277. EQ ;
  278. IF {}
  279. { PUSH string "WrongCondition: sp.amount == self.data.merchFunding" ;
  280. FAILWITH } ;
  281. DUP ;
  282. DUP ;
  283. CAR ;
  284. SWAP ;
  285. CDR ;
  286. DUP ;
  287. CDR ;
  288. SWAP ;
  289. CADR ;
  290. DIG 3 ;
  291. CDADAR ;
  292. PAIR ;
  293. PAIR ;
  294. SWAP ;
  295. PAIR }
  296. {} ;
  297. DUP ;
  298. CADAAR ;
  299. SWAP ;
  300. DUP ;
  301. DUG 2 ;
  302. CAADDR ;
  303. COMPARE ;
  304. EQ ;
  305. IF { DUP ; CDADAR ; SWAP ; DUP ; DUG 2 ; CDAAR ; COMPARE ; EQ }
  306. { PUSH bool False } ;
  307. IF { DUP ;
  308. CAR ;
  309. SWAP ;
  310. CDR ;
  311. DUP ;
  312. CAR ;
  313. SWAP ;
  314. CDR ;
  315. DUP ;
  316. CAR ;
  317. SWAP ;
  318. CDAR ;
  319. PUSH string "open" ;
  320. SWAP ;
  321. PAIR ;
  322. SWAP ;
  323. PAIR ;
  324. SWAP ;
  325. PAIR ;
  326. SWAP ;
  327. PAIR }
  328. {} ;
  329. NIL operation }
  330. { DROP ;
  331. DUP ;
  332. CAADAR ;
  333. SENDER ;
  334. COMPARE ;
  335. EQ ;
  336. IF {}
  337. { PUSH string "WrongCondition: self.data.custAddr == sp.sender" ; FAILWITH } ;
  338. DUP ;
  339. CDDDDR ;
  340. PUSH string "custClose" ;
  341. COMPARE ;
  342. EQ ;
  343. IF {}
  344. { PUSH string "WrongCondition: self.data.status == 'custClose'" ; FAILWITH } ;
  345. DUP ;
  346. CADDAR ;
  347. NOW ;
  348. COMPARE ;
  349. GT ;
  350. IF {}
  351. { PUSH string "WrongCondition: self.data.delayExpiry < sp.now" ; FAILWITH } ;
  352. DUP ;
  353. CAADAR ;
  354. CONTRACT unit ;
  355. NIL operation ;
  356. SWAP ;
  357. IF_SOME {} { PUSH int 218 ; FAILWITH } ;
  358. DIG 2 ;
  359. DUP ;
  360. DUG 3 ;
  361. CAADDR ;
  362. UNIT ;
  363. TRANSFER_TOKENS ;
  364. CONS ;
  365. SWAP ;
  366. DUP ;
  367. CDR ;
  368. SWAP ;
  369. CAR ;
  370. DUP ;
  371. CDR ;
  372. SWAP ;
  373. CAR ;
  374. DUP ;
  375. CAR ;
  376. SWAP ;
  377. CDAR ;
  378. PUSH mutez 0 ;
  379. SWAP ;
  380. PAIR ;
  381. SWAP ;
  382. PAIR ;
  383. PAIR ;
  384. PAIR ;
  385. DUP ;
  386. CAR ;
  387. SWAP ;
  388. CDR ;
  389. DUP ;
  390. CAR ;
  391. SWAP ;
  392. CDR ;
  393. DUP ;
  394. CAR ;
  395. SWAP ;
  396. CDAR ;
  397. PUSH string "closed" ;
  398. SWAP ;
  399. PAIR ;
  400. SWAP ;
  401. PAIR ;
  402. SWAP ;
  403. PAIR ;
  404. SWAP ;
  405. PAIR ;
  406. SWAP } }
  407. { IF_LEFT
  408. { SENDER ;
  409. DIG 2 ;
  410. DUP ;
  411. DUG 3 ;
  412. CAADAR ;
  413. COMPARE ;
  414. EQ ;
  415. IF {}
  416. { PUSH string "WrongCondition: self.data.custAddr == sp.sender" ; FAILWITH } ;
  417. PUSH string "open" ;
  418. DIG 2 ;
  419. DUP ;
  420. DUG 3 ;
  421. CDDDDR ;
  422. COMPARE ;
  423. EQ ;
  424. IF { PUSH bool True }
  425. { PUSH string "merchClose" ; DIG 2 ; DUP ; DUG 3 ; CDDDDR ; COMPARE ; EQ } ;
  426. IF {}
  427. { PUSH string
  428. "WrongCondition: (self.data.status == 'open') | (self.data.status == 'merchClose')" ;
  429. FAILWITH } ;
  430. SWAP ;
  431. DUP ;
  432. CDAAR ;
  433. SWAP ;
  434. DUP ;
  435. DUG 3 ;
  436. CAADDR ;
  437. ADD ;
  438. SWAP ;
  439. DUP ;
  440. CDADDR ;
  441. SWAP ;
  442. DUP ;
  443. DUG 3 ;
  444. CDADAR ;
  445. ADD ;
  446. COMPARE ;
  447. EQ ;
  448. IF {}
  449. { PUSH string
  450. "WrongCondition: (params.newCustBal + params.newMerchBal) == (self.data.custBal + self.data.merchBal)" ;
  451. FAILWITH } ;
  452. DUP ;
  453. CDADAR ;
  454. PUSH mutez 0 ;
  455. SWAP ;
  456. COMPARE ;
  457. GE ;
  458. IF {}
  459. { PUSH string "WrongCondition: params.newCustBal >= sp.tez(0)" ; FAILWITH } ;
  460. DUP ;
  461. CDADDR ;
  462. PUSH mutez 0 ;
  463. SWAP ;
  464. COMPARE ;
  465. GE ;
  466. IF {}
  467. { PUSH string "WrongCondition: params.newMerchBal >= sp.tez(0)" ; FAILWITH } ;
  468. SWAP ;
  469. DUP ;
  470. CAR ;
  471. SWAP ;
  472. CDR ;
  473. DUP ;
  474. CAR ;
  475. SWAP ;
  476. CDR ;
  477. DUP ;
  478. CAR ;
  479. SWAP ;
  480. CDAR ;
  481. PUSH string "checkingSig" ;
  482. SWAP ;
  483. PAIR ;
  484. SWAP ;
  485. PAIR ;
  486. SWAP ;
  487. PAIR ;
  488. SWAP ;
  489. PAIR ;
  490. SWAP ;
  491. NIL operation ;
  492. DIG 2 ;
  493. DUP ;
  494. DUG 3 ;
  495. CDDAAR ;
  496. CONTRACT
  497. (pair (pair (pair (string %chanID) (pair (mutez %custBal) (string %g2)))
  498. (pair (contract %k
  499. (pair (pair (mutez %newCustBal) (mutez %newMerchBal))
  500. (pair (bytes %newRevLock) (bool %valid))))
  501. (pair (mutez %merchBal) (string %merchPk0))))
  502. (pair (pair (string %merchPk1) (pair (string %merchPk2) (string %merchPk3)))
  503. (pair (pair (string %merchPk4) (bytes %revLock)) (pair (string %s1) (string %s2))))) ;
  504. IF_SOME {} { PUSH int 181 ; FAILWITH } ;
  505. PUSH mutez 0 ;
  506. DIG 3 ;
  507. DUP ;
  508. CDDDDR ;
  509. SWAP ;
  510. DUP ;
  511. DUG 5 ;
  512. CDDDAR ;
  513. PAIR %s1 %s2 ;
  514. DIG 4 ;
  515. DUP ;
  516. CDDAR ;
  517. SWAP ;
  518. DUP ;
  519. DUG 6 ;
  520. CDAAR ;
  521. PAIR %merchPk4 %revLock ;
  522. PAIR ;
  523. DIG 4 ;
  524. DUP ;
  525. CADDDR ;
  526. SWAP ;
  527. DUP ;
  528. DUG 6 ;
  529. CADDAR ;
  530. PAIR %merchPk2 %merchPk3 ;
  531. DIG 5 ;
  532. DUP ;
  533. DUG 6 ;
  534. CADAR ;
  535. PAIR %merchPk1 ;
  536. PAIR ;
  537. DIG 4 ;
  538. DUP ;
  539. CAADR ;
  540. SWAP ;
  541. DUP ;
  542. DUG 6 ;
  543. CDADDR ;
  544. PAIR %merchBal %merchPk0 ;
  545. SELF %receiveCall ;
  546. PAIR %k ;
  547. DIG 5 ;
  548. DUP ;
  549. CAAAR ;
  550. SWAP ;
  551. CDADAR ;
  552. PAIR %custBal %g2 ;
  553. DIG 6 ;
  554. DUP ;
  555. DUG 7 ;
  556. CAAAR ;
  557. PAIR %chanID ;
  558. PAIR ;
  559. PAIR ;
  560. TRANSFER_TOKENS ;
  561. CONS }
  562. { DROP ;
  563. DUP ;
  564. CADDDR ;
  565. SENDER ;
  566. COMPARE ;
  567. EQ ;
  568. IF {}
  569. { PUSH string "WrongCondition: self.data.merchAddr == sp.sender" ; FAILWITH } ;
  570. DUP ;
  571. CDDDDR ;
  572. PUSH string "merchClose" ;
  573. COMPARE ;
  574. EQ ;
  575. IF {}
  576. { PUSH string "WrongCondition: self.data.status == 'merchClose'" ; FAILWITH } ;
  577. DUP ;
  578. CADDAR ;
  579. NOW ;
  580. COMPARE ;
  581. GT ;
  582. IF {}
  583. { PUSH string "WrongCondition: self.data.delayExpiry < sp.now" ; FAILWITH } ;
  584. DUP ;
  585. CADDDR ;
  586. CONTRACT unit ;
  587. NIL operation ;
  588. SWAP ;
  589. IF_SOME {} { PUSH int 125 ; FAILWITH } ;
  590. DIG 2 ;
  591. DUP ;
  592. CDAAR ;
  593. SWAP ;
  594. DUP ;
  595. DUG 4 ;
  596. CAADDR ;
  597. ADD ;
  598. UNIT ;
  599. TRANSFER_TOKENS ;
  600. CONS ;
  601. SWAP ;
  602. DUP ;
  603. CDR ;
  604. SWAP ;
  605. CAR ;
  606. DUP ;
  607. CDR ;
  608. SWAP ;
  609. CAR ;
  610. DUP ;
  611. CAR ;
  612. SWAP ;
  613. CDAR ;
  614. PUSH mutez 0 ;
  615. SWAP ;
  616. PAIR ;
  617. SWAP ;
  618. PAIR ;
  619. PAIR ;
  620. PAIR ;
  621. DUP ;
  622. CAR ;
  623. SWAP ;
  624. CDR ;
  625. DUP ;
  626. CDR ;
  627. SWAP ;
  628. CADR ;
  629. PUSH mutez 0 ;
  630. PAIR ;
  631. PAIR ;
  632. SWAP ;
  633. PAIR ;
  634. DUP ;
  635. CAR ;
  636. SWAP ;
  637. CDR ;
  638. DUP ;
  639. CAR ;
  640. SWAP ;
  641. CDR ;
  642. DUP ;
  643. CAR ;
  644. SWAP ;
  645. CDAR ;
  646. PUSH string "closed" ;
  647. SWAP ;
  648. PAIR ;
  649. SWAP ;
  650. PAIR ;
  651. SWAP ;
  652. PAIR ;
  653. SWAP ;
  654. PAIR ;
  655. SWAP } } }
  656. { IF_LEFT
  657. { IF_LEFT
  658. { DROP ;
  659. DUP ;
  660. CADDDR ;
  661. SENDER ;
  662. COMPARE ;
  663. EQ ;
  664. IF {}
  665. { PUSH string "WrongCondition: self.data.merchAddr == sp.sender" ; FAILWITH } ;
  666. DUP ;
  667. CDDDDR ;
  668. PUSH string "open" ;
  669. COMPARE ;
  670. EQ ;
  671. IF {}
  672. { PUSH string "WrongCondition: self.data.status == 'open'" ; FAILWITH } ;
  673. DUP ;
  674. DUP ;
  675. CDR ;
  676. SWAP ;
  677. CAR ;
  678. DUP ;
  679. CAR ;
  680. SWAP ;
  681. CDR ;
  682. DUP ;
  683. CAR ;
  684. SWAP ;
  685. CDDR ;
  686. NOW ;
  687. DIG 5 ;
  688. CDDDAR ;
  689. ADD ;
  690. PAIR ;
  691. SWAP ;
  692. PAIR ;
  693. SWAP ;
  694. PAIR ;
  695. PAIR ;
  696. DUP ;
  697. CAR ;
  698. SWAP ;
  699. CDR ;
  700. DUP ;
  701. CAR ;
  702. SWAP ;
  703. CDR ;
  704. DUP ;
  705. CAR ;
  706. SWAP ;
  707. CDAR ;
  708. PUSH string "merchClose" ;
  709. SWAP ;
  710. PAIR ;
  711. SWAP ;
  712. PAIR ;
  713. SWAP ;
  714. PAIR ;
  715. SWAP ;
  716. PAIR ;
  717. NIL operation }
  718. { SENDER ;
  719. DIG 2 ;
  720. DUP ;
  721. DUG 3 ;
  722. CADDDR ;
  723. COMPARE ;
  724. EQ ;
  725. IF {}
  726. { PUSH string "WrongCondition: self.data.merchAddr == sp.sender" ; FAILWITH } ;
  727. PUSH string "custClose" ;
  728. DIG 2 ;
  729. DUP ;
  730. DUG 3 ;
  731. CDDDDR ;
  732. COMPARE ;
  733. EQ ;
  734. IF { PUSH bool True }
  735. { PUSH string "checkingSig" ; DIG 2 ; DUP ; DUG 3 ; CDDDDR ; COMPARE ; EQ } ;
  736. IF {}
  737. { PUSH string
  738. "WrongCondition: (self.data.status == 'custClose') | (self.data.status == 'checkingSig')" ;
  739. FAILWITH } ;
  740. BLAKE2B ;
  741. SWAP ;
  742. DUP ;
  743. DUG 2 ;
  744. CDDADR ;
  745. COMPARE ;
  746. EQ ;
  747. IF {}
  748. { PUSH string "WrongCondition: self.data.revLock == sp.blake2b(params.secret)" ;
  749. FAILWITH } ;
  750. DUP ;
  751. CADDDR ;
  752. CONTRACT unit ;
  753. NIL operation ;
  754. SWAP ;
  755. IF_SOME {} { PUSH int 207 ; FAILWITH } ;
  756. DIG 2 ;
  757. DUP ;
  758. DUG 3 ;
  759. CAADDR ;
  760. UNIT ;
  761. TRANSFER_TOKENS ;
  762. CONS ;
  763. SWAP ;
  764. DUP ;
  765. CDR ;
  766. SWAP ;
  767. CAR ;
  768. DUP ;
  769. CDR ;
  770. SWAP ;
  771. CAR ;
  772. DUP ;
  773. CAR ;
  774. SWAP ;
  775. CDAR ;
  776. PUSH mutez 0 ;
  777. SWAP ;
  778. PAIR ;
  779. SWAP ;
  780. PAIR ;
  781. PAIR ;
  782. PAIR ;
  783. DUP ;
  784. CAR ;
  785. SWAP ;
  786. CDR ;
  787. DUP ;
  788. CAR ;
  789. SWAP ;
  790. CDR ;
  791. DUP ;
  792. CAR ;
  793. SWAP ;
  794. CDAR ;
  795. PUSH string "closed" ;
  796. SWAP ;
  797. PAIR ;
  798. SWAP ;
  799. PAIR ;
  800. SWAP ;
  801. PAIR ;
  802. SWAP ;
  803. PAIR ;
  804. SWAP } }
  805. { IF_LEFT
  806. { PUSH string "open" ;
  807. DIG 2 ;
  808. DUP ;
  809. DUG 3 ;
  810. CDDDDR ;
  811. COMPARE ;
  812. EQ ;
  813. IF {}
  814. { PUSH string "WrongCondition: self.data.status == 'open'" ; FAILWITH } ;
  815. DUP ;
  816. CDDR ;
  817. SWAP ;
  818. DUP ;
  819. DUG 2 ;
  820. CDAR ;
  821. PAIR %newCustBal %newMerchBal ;
  822. DIG 2 ;
  823. DUP ;
  824. DUG 3 ;
  825. CADDDR ;
  826. PAIR %merchAddr ;
  827. DIG 2 ;
  828. DUP ;
  829. CAADAR ;
  830. SWAP ;
  831. DUP ;
  832. DUG 4 ;
  833. CAAAR ;
  834. PAIR %chanID %custAddr ;
  835. PAIR ;
  836. PACK ;
  837. SWAP ;
  838. DUP ;
  839. DUG 2 ;
  840. CAAR ;
  841. DIG 3 ;
  842. DUP ;
  843. DUG 4 ;
  844. CADADR ;
  845. CHECK_SIGNATURE ;
  846. IF {}
  847. { PUSH string
  848. "WrongCondition: sp.check_signature(self.data.custPk, params.custSig, sp.pack(sp.record(chanID = self.data.chanID, custAddr = self.data.custAddr, merchAddr = self.data.merchAddr, newCustBal = params.newCustBal, newMerchBal = params.newMerchBal)))" ;
  849. FAILWITH } ;
  850. DUP ;
  851. CDDR ;
  852. SWAP ;
  853. DUP ;
  854. DUG 2 ;
  855. CDAR ;
  856. PAIR %newCustBal %newMerchBal ;
  857. DIG 2 ;
  858. DUP ;
  859. DUG 3 ;
  860. CADDDR ;
  861. PAIR %merchAddr ;
  862. DIG 2 ;
  863. DUP ;
  864. CAADAR ;
  865. SWAP ;
  866. DUP ;
  867. DUG 4 ;
  868. CAAAR ;
  869. PAIR %chanID %custAddr ;
  870. PAIR ;
  871. PACK ;
  872. SWAP ;
  873. DUP ;
  874. DUG 2 ;
  875. CADR ;
  876. DIG 3 ;
  877. DUP ;
  878. DUG 4 ;
  879. CDADDR ;
  880. CHECK_SIGNATURE ;
  881. IF {}
  882. { PUSH string
  883. "WrongCondition: sp.check_signature(self.data.merchPk, params.merchSig, sp.pack(sp.record(chanID = self.data.chanID, custAddr = self.data.custAddr, merchAddr = self.data.merchAddr, newCustBal = params.newCustBal, newMerchBal = params.newMerchBal)))" ;
  884. FAILWITH } ;
  885. SWAP ;
  886. DUP ;
  887. CDR ;
  888. SWAP ;
  889. CAR ;
  890. DUP ;
  891. CDR ;
  892. SWAP ;
  893. CAR ;
  894. DUP ;
  895. CAR ;
  896. SWAP ;
  897. CDAR ;
  898. DIG 4 ;
  899. DUP ;
  900. DUG 5 ;
  901. CDAR ;
  902. SWAP ;
  903. PAIR ;
  904. SWAP ;
  905. PAIR ;
  906. PAIR ;
  907. PAIR ;
  908. DUP ;
  909. CAR ;
  910. SWAP ;
  911. CDR ;
  912. DUP ;
  913. CDR ;
  914. SWAP ;
  915. CADR ;
  916. DIG 3 ;
  917. CDDR ;
  918. PAIR ;
  919. PAIR ;
  920. SWAP ;
  921. PAIR ;
  922. DUP ;
  923. CAADAR ;
  924. CONTRACT unit ;
  925. NIL operation ;
  926. SWAP ;
  927. IF_SOME {} { PUSH int 252 ; FAILWITH } ;
  928. DIG 2 ;
  929. DUP ;
  930. DUG 3 ;
  931. CAADDR ;
  932. UNIT ;
  933. TRANSFER_TOKENS ;
  934. CONS ;
  935. SWAP ;
  936. DUP ;
  937. DUG 2 ;
  938. CADDDR ;
  939. CONTRACT unit ;
  940. IF_SOME {} { PUSH int 253 ; FAILWITH } ;
  941. DIG 2 ;
  942. DUP ;
  943. DUG 3 ;
  944. CDAAR ;
  945. UNIT ;
  946. TRANSFER_TOKENS ;
  947. CONS ;
  948. SWAP ;
  949. DUP ;
  950. CDR ;
  951. SWAP ;
  952. CAR ;
  953. DUP ;
  954. CDR ;
  955. SWAP ;
  956. CAR ;
  957. DUP ;
  958. CAR ;
  959. SWAP ;
  960. CDAR ;
  961. PUSH mutez 0 ;
  962. SWAP ;
  963. PAIR ;
  964. SWAP ;
  965. PAIR ;
  966. PAIR ;
  967. PAIR ;
  968. DUP ;
  969. CAR ;
  970. SWAP ;
  971. CDR ;
  972. DUP ;
  973. CDR ;
  974. SWAP ;
  975. CADR ;
  976. PUSH mutez 0 ;
  977. PAIR ;
  978. PAIR ;
  979. SWAP ;
  980. PAIR ;
  981. DUP ;
  982. CAR ;
  983. SWAP ;
  984. CDR ;
  985. DUP ;
  986. CAR ;
  987. SWAP ;
  988. CDR ;
  989. DUP ;
  990. CAR ;
  991. SWAP ;
  992. CDAR ;
  993. PUSH string "closed" ;
  994. SWAP ;
  995. PAIR ;
  996. SWAP ;
  997. PAIR ;
  998. SWAP ;
  999. PAIR ;
  1000. SWAP ;
  1001. PAIR ;
  1002. SWAP }
  1003. { IF_LEFT
  1004. { SENDER ;
  1005. DIG 2 ;
  1006. DUP ;
  1007. DUG 3 ;
  1008. CDDAAR ;
  1009. COMPARE ;
  1010. EQ ;
  1011. IF {}
  1012. { PUSH string "WrongCondition: self.data.pssigContract == sp.sender" ;
  1013. FAILWITH } ;
  1014. PUSH string "checkingSig" ;
  1015. DIG 2 ;
  1016. DUP ;
  1017. DUG 3 ;
  1018. CDDDDR ;
  1019. COMPARE ;
  1020. EQ ;
  1021. IF {}
  1022. { PUSH string "WrongCondition: self.data.status == 'checkingSig'" ; FAILWITH } ;
  1023. DUP ;
  1024. CDDR ;
  1025. PUSH bool True ;
  1026. COMPARE ;
  1027. EQ ;
  1028. IF {} { PUSH string "WrongCondition: params.valid == True" ; FAILWITH } ;
  1029. SWAP ;
  1030. DUP ;
  1031. CDR ;
  1032. SWAP ;
  1033. CAR ;
  1034. DUP ;
  1035. CDR ;
  1036. SWAP ;
  1037. CAR ;
  1038. DUP ;
  1039. CAR ;
  1040. SWAP ;
  1041. CDAR ;
  1042. DIG 4 ;
  1043. DUP ;
  1044. DUG 5 ;
  1045. CAAR ;
  1046. SWAP ;
  1047. PAIR ;
  1048. SWAP ;
  1049. PAIR ;
  1050. PAIR ;
  1051. PAIR ;
  1052. DUP ;
  1053. CAR ;
  1054. SWAP ;
  1055. CDR ;
  1056. DUP ;
  1057. CDR ;
  1058. SWAP ;
  1059. CADR ;
  1060. DIG 3 ;
  1061. DUP ;
  1062. DUG 4 ;
  1063. CADR ;
  1064. PAIR ;
  1065. PAIR ;
  1066. SWAP ;
  1067. PAIR ;
  1068. DUP ;
  1069. CAR ;
  1070. SWAP ;
  1071. CDR ;
  1072. DUP ;
  1073. CAR ;
  1074. SWAP ;
  1075. CDR ;
  1076. DUP ;
  1077. CDR ;
  1078. SWAP ;
  1079. CAAR ;
  1080. DIG 4 ;
  1081. CDAR ;
  1082. SWAP ;
  1083. PAIR ;
  1084. PAIR ;
  1085. SWAP ;
  1086. PAIR ;
  1087. SWAP ;
  1088. PAIR ;
  1089. DUP ;
  1090. DUP ;
  1091. CDR ;
  1092. SWAP ;
  1093. CAR ;
  1094. DUP ;
  1095. CAR ;
  1096. SWAP ;
  1097. CDR ;
  1098. DUP ;
  1099. CAR ;
  1100. SWAP ;
  1101. CDDR ;
  1102. NOW ;
  1103. DIG 5 ;
  1104. CDDDAR ;
  1105. ADD ;
  1106. PAIR ;
  1107. SWAP ;
  1108. PAIR ;
  1109. SWAP ;
  1110. PAIR ;
  1111. PAIR ;
  1112. DUP ;
  1113. CADDDR ;
  1114. CONTRACT unit ;
  1115. NIL operation ;
  1116. SWAP ;
  1117. IF_SOME {} { PUSH int 195 ; FAILWITH } ;
  1118. DIG 2 ;
  1119. DUP ;
  1120. DUG 3 ;
  1121. CDAAR ;
  1122. UNIT ;
  1123. TRANSFER_TOKENS ;
  1124. CONS ;
  1125. SWAP ;
  1126. DUP ;
  1127. CAR ;
  1128. SWAP ;
  1129. CDR ;
  1130. DUP ;
  1131. CDR ;
  1132. SWAP ;
  1133. CADR ;
  1134. PUSH mutez 0 ;
  1135. PAIR ;
  1136. PAIR ;
  1137. SWAP ;
  1138. PAIR ;
  1139. DUP ;
  1140. CAR ;
  1141. SWAP ;
  1142. CDR ;
  1143. DUP ;
  1144. CAR ;
  1145. SWAP ;
  1146. CDR ;
  1147. DUP ;
  1148. CAR ;
  1149. SWAP ;
  1150. CDAR ;
  1151. PUSH string "custClose" ;
  1152. SWAP ;
  1153. PAIR ;
  1154. SWAP ;
  1155. PAIR ;
  1156. SWAP ;
  1157. PAIR ;
  1158. SWAP ;
  1159. PAIR ;
  1160. SWAP }
  1161. { PUSH string "awaitingFunding" ;
  1162. DIG 2 ;
  1163. DUP ;
  1164. DUG 3 ;
  1165. CDDDDR ;
  1166. COMPARE ;
  1167. EQ ;
  1168. IF {}
  1169. { PUSH string "WrongCondition: self.data.status == 'awaitingFunding'" ;
  1170. FAILWITH } ;
  1171. SENDER ;
  1172. DIG 2 ;
  1173. DUP ;
  1174. DUG 3 ;
  1175. CAADAR ;
  1176. COMPARE ;
  1177. EQ ;
  1178. IF { SWAP ;
  1179. DUP ;
  1180. CADAAR ;
  1181. SWAP ;
  1182. DUP ;
  1183. DUG 3 ;
  1184. CAADDR ;
  1185. COMPARE ;
  1186. EQ ;
  1187. IF {}
  1188. { PUSH string "WrongCondition: self.data.custBal == self.data.custFunding" ;
  1189. FAILWITH } ;
  1190. NIL operation ;
  1191. DIG 2 ;
  1192. DUP ;
  1193. DUG 3 ;
  1194. CAADAR ;
  1195. CONTRACT unit ;
  1196. IF_SOME {} { PUSH int 100 ; FAILWITH } ;
  1197. DIG 3 ;
  1198. DUP ;
  1199. DUG 4 ;
  1200. CAADDR ;
  1201. UNIT ;
  1202. TRANSFER_TOKENS ;
  1203. CONS ;
  1204. DIG 2 ;
  1205. DUP ;
  1206. CDR ;
  1207. SWAP ;
  1208. CAR ;
  1209. DUP ;
  1210. CDR ;
  1211. SWAP ;
  1212. CAR ;
  1213. DUP ;
  1214. CAR ;
  1215. SWAP ;
  1216. CDAR ;
  1217. PUSH mutez 0 ;
  1218. SWAP ;
  1219. PAIR ;
  1220. SWAP ;
  1221. PAIR ;
  1222. PAIR ;
  1223. PAIR ;
  1224. DUG 2 }
  1225. { NIL operation } ;
  1226. SENDER ;
  1227. DIG 3 ;
  1228. DUP ;
  1229. DUG 4 ;
  1230. CADDDR ;
  1231. COMPARE ;
  1232. EQ ;
  1233. IF { DIG 2 ;
  1234. DUP ;
  1235. CDADAR ;
  1236. SWAP ;
  1237. DUP ;
  1238. DUG 4 ;
  1239. CDAAR ;
  1240. COMPARE ;
  1241. EQ ;
  1242. IF { SWAP ; DROP }
  1243. { PUSH string "WrongCondition: self.data.merchBal == self.data.merchFunding" ;
  1244. FAILWITH } ;
  1245. SWAP ;
  1246. DUP ;
  1247. DUG 2 ;
  1248. CADDDR ;
  1249. CONTRACT unit ;
  1250. IF_SOME {} { PUSH int 104 ; FAILWITH } ;
  1251. DIG 2 ;
  1252. DUP ;
  1253. DUG 3 ;
  1254. CDAAR ;
  1255. UNIT ;
  1256. TRANSFER_TOKENS ;
  1257. CONS ;
  1258. SWAP ;
  1259. DUP ;
  1260. CAR ;
  1261. SWAP ;
  1262. CDR ;
  1263. DUP ;
  1264. CDR ;
  1265. SWAP ;
  1266. CADR ;
  1267. PUSH mutez 0 ;
  1268. PAIR ;
  1269. PAIR ;
  1270. SWAP ;
  1271. PAIR ;
  1272. SWAP }
  1273. { SWAP ; DROP } } } } } ;
  1274. NIL operation ;
  1275. SWAP ;
  1276. ITER { CONS } ;
  1277. PAIR } }
  1278. Initial storage:
  1279. (Pair (Pair (Pair "randomchanid" (Pair "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" 0))
  1280. (Pair (Pair 20000000 "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav")
  1281. (Pair "0" "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN")))
  1282. (Pair (Pair 0 (Pair 10000000 "edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9"))
  1283. (Pair (Pair "KT1XLndPcmBKtsYcFtguZtstxeQKdLm2uxwy"
  1284. 0x1f98c84caf714d00ede5d23142bc166d84f8cd42adc18be22c3d47453853ea49)
  1285. (Pair 3 "awaitingFunding"))))
  1286. No delegate for this contract
  1287. This origination was successfully applied
  1288. Originated contracts:
  1289. KT1DskKf2HwDqoiL45PWZ7d72pn2jhfNxoos
  1290. Storage size: 8202 bytes
  1291. Paid storage size diff: 8202 bytes
  1292. Consumed gas: 216810000
  1293. Balance updates:
  1294. tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ8.202
  1295. tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ0.257
  1296.  
  1297. New contract KT1DskKf2HwDqoiL45PWZ7d72pn2jhfNxoos originated.
  1298. Contract memorized as my_zkchannel.
  1299.  
  1300. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 bake for baker5 --minimal-timestamp
  1301. Injected block BKwxDKAjs6AL
  1302.  
  1303. Oct 13 15:54:12.798 - alpha.baking.forge: found 1 valid operations (0 refused) for timestamp 2020-10-13T14:54:15-00:00 (fitness 01::0000000000000006)
  1304.  
  1305. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 show known contract my_zkchannel
  1306. KT1DskKf2HwDqoiL45PWZ7d72pn2jhfNxoos
  1307.  
  1308.  
  1309. # /Users/dariuscognac/tezos/tezos-client -base-dir /var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m -endpoint http://localhost:18730 transfer 0 from bootstrap1 to pssig_contract --burn-cap 9 --arg (Pair (Pair (Pair "randomchanid" (Pair 1000000 "dummy_g2")) (Pair "KT1DskKf2HwDqoiL45PWZ7d72pn2jhfNxoos%receiveCall" (Pair (Pair 1000000 29000000) (Pair 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c False))) (Pair 29000000 "dummy_merchPk0")) (Pair (Pair "dummy_merchPk1"(Pair "dummy_merchPk2" "dummy_merchPk3")) (Pair (Pair "dummy_merchPk4" 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c) (Pair "dummy_s1" "dummy_s2"))))
  1310. Node is bootstrapped.
  1311. This simulation failed:
  1312. Manager signed operations:
  1313. From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
  1314. Fee to the baker: ꜩ0
  1315. Expected counter: 3
  1316. Gas limit: 1040000000
  1317. Storage limit: 60000 bytes
  1318. Transaction:
  1319. Amount: ꜩ0
  1320. From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
  1321. To: KT1XLndPcmBKtsYcFtguZtstxeQKdLm2uxwy
  1322. Parameter: (Pair (Pair (Pair "randomchanid" (Pair 1000000 "dummy_g2"))
  1323. (Pair "KT1DskKf2HwDqoiL45PWZ7d72pn2jhfNxoos%receiveCall"
  1324. (Pair (Pair 1000000 29000000)
  1325. (Pair 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c False)))
  1326. (Pair 29000000 "dummy_merchPk0"))
  1327. (Pair (Pair "dummy_merchPk1" (Pair "dummy_merchPk2" "dummy_merchPk3"))
  1328. (Pair (Pair "dummy_merchPk4"
  1329. 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c)
  1330. (Pair "dummy_s1" "dummy_s2"))))
  1331. This operation FAILED.
  1332.  
  1333.  
  1334. Invalid argument passed to contract KT1XLndPcmBKtsYcFtguZtstxeQKdLm2uxwy.
  1335. At (unshown) location 0, value
  1336. (Pair (Pair (Pair "randomchanid" (Pair 1000000 "dummy_g2"))
  1337. (Pair "KT1DskKf2HwDqoiL45PWZ7d72pn2jhfNxoos%receiveCall"
  1338. (Pair (Pair 1000000 29000000)
  1339. (Pair 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c False)))
  1340. (Pair 29000000 "dummy_merchPk0"))
  1341. (Pair (Pair "dummy_merchPk1" (Pair "dummy_merchPk2" "dummy_merchPk3"))
  1342. (Pair (Pair "dummy_merchPk4"
  1343. 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c)
  1344. (Pair "dummy_s1" "dummy_s2"))))
  1345. is invalid for type
  1346. pair (pair (pair (string %chanID) (pair (mutez %custBal) (string %g2)))
  1347. (pair (contract %k
  1348. (pair (pair (mutez %newCustBal) (mutez %newMerchBal))
  1349. (pair (bytes %newRevLock) (bool %valid))))
  1350. (pair (mutez %merchBal) (string %merchPk0))))
  1351. (pair (pair (string %merchPk1) (pair (string %merchPk2) (string %merchPk3)))
  1352. (pair (pair (string %merchPk4) (bytes %revLock)) (pair (string %s1) (string %s2)))).
  1353. At (unshown) location 1, primitive Pair expects 2 arguments but is given 3.
  1354. Fatal error:
  1355. transfer simulation failed
  1356.  
  1357. Traceback (most recent call last):
  1358. File "test_dummy_contract_call.py", line 127, in <module>
  1359. scenario_cust_close()
  1360. File "test_dummy_contract_call.py", line 101, in scenario_cust_close
  1361. '--arg', storage])
  1362. File "/Users/dariuscognac/tezos/tests_python/client/client.py", line 384, in transfer
  1363. res = self.run(cmd)
  1364. File "/Users/dariuscognac/tezos/tests_python/client/client.py", line 164, in run
  1365. (stdout, _, _) = self.run_generic(params, admin, check, trace)
  1366. File "/Users/dariuscognac/tezos/tests_python/client/client.py", line 153, in run_generic
  1367. completed_process.check_returncode()
  1368. File "/Users/dariuscognac/anaconda3/lib/python3.7/subprocess.py", line 409, in check_returncode
  1369. self.stderr)
  1370. subprocess.CalledProcessError: Command '['/Users/dariuscognac/tezos/tezos-client', '-base-dir', '/var/folders/r5/yk8yg2xs1gs8xzkn5l8vr72w0000gn/T/tezos-client.8rx7z57m', '-endpoint', 'http://localhost:18730', 'transfer', '0', 'from', 'bootstrap1', 'to', 'pssig_contract', '--burn-cap', '9', '--arg', '(Pair (Pair (Pair "randomchanid" (Pair 1000000 "dummy_g2")) (Pair "KT1DskKf2HwDqoiL45PWZ7d72pn2jhfNxoos%receiveCall" (Pair (Pair 1000000 29000000) (Pair 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c False))) (Pair 29000000 "dummy_merchPk0")) (Pair (Pair "dummy_merchPk1"(Pair "dummy_merchPk2" "dummy_merchPk3")) (Pair (Pair "dummy_merchPk4" 0x5d33df275854dc7aea1323eab177a195935d0af0cb7fa727c5b491d41244d42c) (Pair "dummy_s1" "dummy_s2"))))']' returned non-zero exit status 1.
  1371. (venv) $
  1372.  
RAW Paste Data