Skip to content

Commit

Permalink
adds generate-assert-id-condition
Browse files Browse the repository at this point in the history
  • Loading branch information
wbendick authored and hoffmang9 committed Feb 4, 2021
1 parent 721dcd2 commit cf8d092
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wallet/rl_wallet/rl.clvm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
(defconstant CLAWBACK_MODE 3)
(defconstant AGGSIG 50)
(defconstant CREATE_COIN 51)
(defconstant ASSERT_MY_COIN_ID 53)
(defconstant ASSERT_BLOCK_AGE_EXCEEDS 56)

(defun sha256tree (TREE)
Expand Down Expand Up @@ -72,7 +73,8 @@
(defun create-change (my_puzzlehash my_amount outgoing_amount fee)
(list CREATE_COIN my_puzzlehash (- my_amount (+ outgoing_amount fee))))

(defun template-my-id () ())
(defun generate-assert-id-condition (my_parent_id my_puzzlehash my_amount)
(list ASSERT_MY_COIN_ID (sha256 my_parent_id my_puzzlehash my_amount)))

(defun create-new-coin () ())

Expand All @@ -91,7 +93,7 @@
(= origin_id my_parent_id))
(list (generate-block-age-condition min_block_time outgoing_amount)
(create-change my_puzzlehash my_amount outgoing_amount fee)
(template-my-id)
(generate-assert-id-condition my_parent_id my_puzzlehash my_amount)
(create-new-coin))))

(if (= mode CLAWBACK_MODE)
Expand Down

0 comments on commit cf8d092

Please sign in to comment.