@@ -56,26 +56,27 @@ The Bitauth IDE will show you the two-way mapping between the CashScript contrac
56
56
57
57
``` js
58
58
// "TransferWithTimeout" contract constructor parameters
59
- < timeout> // int = <0x07 >
60
- < recipient> // pubkey = <0x0262f5c18adf3d9800c18b5e63fa6505ec8eb1d49c65855d62aea698425a39966e >
61
- < sender> // pubkey = <0x0262f5c18adf3d9800c18b5e63fa6505ec8eb1d49c65855d62aea698425a39966e >
59
+ < timeout> // int = <0x90d003 >
60
+ < recipient> // pubkey = <0x038f55548d7f3d183cebb8ee77036feeb408f4a5030fb486717659bb944fe5eb4c >
61
+ < sender> // pubkey = <0x0218d4166169298d42c1f763e243e4b5bc3df8e11690aa953b17a6e02902625f90 >
62
62
63
63
// bytecode
64
- /* pragma cashscript >= 0.11.0; */
65
- /* */
66
- /* contract TransferWithTimeout(pubkey sender, pubkey recipient, int timeout) { */
67
- /* // Require recipient's signature to match */
68
- OP_3 OP_PICK OP_0 OP_NUMEQUAL OP_IF /* function transfer(sig recipientSig) { */
69
- OP_4 OP_ROLL OP_2 OP_ROLL OP_CHECKSIG /* require(checkSig(recipientSig, recipient)); */
70
- OP_NIP OP_NIP OP_NIP OP_ELSE /* } */
71
- /* */
72
- /* // Require timeout time to be reached and sender's signature to match */
73
- OP_3 OP_ROLL OP_1 OP_NUMEQUAL OP_VERIFY /* function timeout(sig senderSig) { */
74
- OP_3 OP_ROLL OP_1 OP_ROLL OP_CHECKSIG OP_VERIFY /* require(checkSig(senderSig, sender)); */
75
- OP_1 OP_ROLL OP_CHECKLOCKTIMEVERIFY OP_DROP /* require(tx.time >= timeout); */
76
- OP_1 OP_NIP /* } */
77
- OP_ENDIF /* } */
78
- /*
64
+ /* pragma cashscript ~ 0.11.0; */
65
+ /* */
66
+ /* contract TransferWithTimeout(pubkey sender, pubkey recipient, int timeout) { */
67
+ /* // Require recipient's signature to match */
68
+ OP_3 OP_PICK OP_0 OP_NUMEQUAL OP_IF /* function transfer(sig recipientSig) { */
69
+ OP_4 OP_ROLL OP_ROT OP_CHECKSIG /* require(checkSig(recipientSig, recipient)); */
70
+ OP_NIP OP_NIP OP_NIP OP_ELSE /* } */
71
+ /* */
72
+ /* // Require timeout time to be reached and sender's signature to match */
73
+ OP_3 OP_ROLL OP_1 OP_NUMEQUALVERIFY /* function timeout(sig senderSig) { */
74
+ OP_3 OP_ROLL OP_SWAP OP_CHECKSIGVERIFY /* require(checkSig(senderSig, sender)); */
75
+ OP_SWAP OP_CHECKLOCKTIMEVERIFY /* require(tx.time >= timeout); */
76
+ OP_2DROP OP_1 /* } */
77
+ OP_ENDIF /* } */
78
+
79
79
```
80
80
81
- [BitauthIDE]: https://ide.bitauth.com/import-template/eJzVWG1v2zYQ_isCMWBJ4drUG21lbYAmcRsjaZIl6YqhDgyKomItNuVRVJbA8H_fUe9-qeF06Yfxg0WRvLvnjs9RR8_RLwkb8ylFB2is1Cw56HSigLf9SNFUjdssnnZ0hwsVMaqiWLxVfDqbUMXfPuJ2Ltv-K4kFaqGAJ0xGM70K1A2ms1gqHhihjKcGo8k4n4WFgk45rLiVVCQhl18jNb6NpjxO9WSSznJBdPANHR2fjixs2SPsorsWeuQyybTjFtKQVMQTdDBHMypBpYJZ_baM4zgWSlKmDCZ55oFBBYBKBcteGqIVsKWxXFei0Uxi9gAjqdCdUfamQVEZUX-SI5GcRbMIsI2S6H4dzLBecBPdD1Ft3ojDGtQQqSI2Q1TDaorCqHqe6dEz_owWAJOLgMtNFvOZVVtqHCUGK2JT2yjUVNq_0smEqxOqqDZSIdjq2Y6mamXfsaYKTmywVUztaElV5Npopwz7KALfn9bN3WT9eneyZYaKDf7EWap4bWhF00Z70Bqkmi-xKaNykvCMbfyRTlJItFGpVZOtMJQLVeyEkU5niTWbCD4U75boqdNXxFLqvqAqlbwNOEcQqVmqkkMDVMLMUAwF9Fa8j0QVZ1C77HcmGQllvDfe4cOhqFIG3MpzCCJQ-qufkbi_zQM1s5KxbdUB3ejlhnMDHGZVnsciUTJlKpbLzhc0WIL3hLu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