@version 1 condition triggered_by: transaction, on: set_secret_hash(_secret_hash, _secret_hash_signature, _end_time), as: [ previous_public_key: ( # Transaction is not yet validated so we need to use previous address # to get the genesis address previous_address = Chain.get_previous_address() Chain.get_genesis_address(previous_address) == 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801 ) ] actions triggered_by: transaction, on: set_secret_hash(secret_hash, secret_hash_signature, end_time) do next_code = """ @version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: #{end_time} do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000F74EE60CE89C9227127F41A4DCD1946F11721BF74D07C812591D48611D3601F7, amount: 10 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= #{end_time} ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000F74EE60CE89C9227127F41A4DCD1946F11721BF74D07C812591D48611D3601F7, amount: 10 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret, secret_signature), as: [ previous_public_key: ( # Transaction is not yet validated so we need to use previous address # to get the genesis address previous_address = Chain.get_previous_address() Chain.get_genesis_address(previous_address) == 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801 ), timestamp: transaction.timestamp < #{end_time}, content: Crypto.hash(String.to_hex(secret)) == 0x#{secret_hash} ] actions triggered_by: transaction, on: reveal_secret(secret, secret_signature) do next_code = """ @version 1 export fun get_secret() do [ secret: 0x\#{secret}, secret_signature: [ r: 0x\#{secret_signature.r}, s: 0x\#{secret_signature.s}, v: \#{secret_signature.v} ] ] end \""" Contract.set_type "transfer" Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 9.97 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.03 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 9.97, end_time: #{end_time}, secret_hash: 0x#{secret_hash}, secret_hash_signature: [ r: 0x#{secret_hash_signature.r}, s: 0x#{secret_hash_signature.s}, v: #{secret_hash_signature.v} ] ] end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
4C39BD8A560F7A6E7C1BBF47846C79D85E2E2A26F1AA322E6E1E0B7F98CD987FBA2FF50C7200BED57BBD57A34492132FC01BB0994416993E22D4CF1D
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00005676...CAB0At 2023-11-15 09:55:50 UTCAmount 0.35490324 UCO
Previous public key
0001D0AB3E1C6C668B795B30E1C2C8F74BDADB2D7F204F28B948C6AE3E5B3BC62527
Previous signature
EAB61107B123070003DAE90ABB6C9D205838FA2069A56418DC0051CFE2E8CB5759D92F2922B057DA6DA543394A8D8EEC20E9E193ECA4ACBA5786CF56E76E6702
Origin signature
304402202A3ADE0DF2ED94295BFC57F4CA6DE69C5AB324D8D0A8DB908E43FCACBEB88B9602203F9A89629259AC833338BE22F6DC92552244CA80FBE5F6CEC77E51375A10FECB
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
0049E647BE79E5A0481684AC7A64069EB655658A4CB0A6A63B5B05FEE6FE37FD2A
Coordinator signature
729DD7D7BC146618E60B6AF7EA7EF058769B2E0D5F0A75A85DD005FA83954FF68003DF1C38C599A87C7EBE0CC01075AD000D400191359B766EE19FC7126A6704
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
C54B1C4A3C7B6904F6C7AE6D1F538B3EBBB2D8345DF5E49A546A76B427BA65B2062158C3ED14870FD3E18028D0D1FAAB159B635ACC4C29D72DAB4077E827CE03
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
6B5BE19F054E69CC5B15A03F309C2F0085CC8C76E72F0786DB5492B02BB6921EB88D55F5EC8F62F27F582E0C045D2BFB8B573EE9AA13258985507CB9DDC57307