Cancel mojo technique: Difference between revisions

From mojo_puzzler
Jump to navigation Jump to search
(Created page with "===== Return to: Chialisp ===== The following chialisp code ensure that the introduced parent puzzlehash of the parent coin is correct first, before sending the rebate coin which is restricted to that one possible wallet address: (mod (pwd ppid pph pamt ph amt) (defconstant CREATE_COIN 51) (defconstant ASSERT_MY_PARENT_ID 71) (if (= pwd (q . cancel)) (list (list ASSERT_MY_PARENT_ID (sha256 (concat ppid pph pamt))) (list CREATE_CO...")
 
(No difference)

Latest revision as of 15:55, 17 November 2023

Return to: Chialisp

The following chialisp code ensure that the introduced parent puzzlehash of the parent coin is correct first, before sending the rebate coin which is restricted to that one possible wallet address:

 (mod (pwd ppid pph pamt ph amt)
    (defconstant CREATE_COIN 51)
    (defconstant ASSERT_MY_PARENT_ID 71)
    (if (= pwd (q . cancel))
    (list (list ASSERT_MY_PARENT_ID (sha256 (concat ppid pph pamt))) 
    (list CREATE_COIN pph amt))
    (if (= pwd (q . hello))
    (list (list CREATE_COIN ph amt))
    (x)
    )
    )
 )