@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: 0x00006AFF130BEB6BE9B02B80FFC13DB5EABFB0A7D167BAFC9F2DF8F141D7755FB39F, amount: 10.03 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: 0x00006AFF130BEB6BE9B02B80FFC13DB5EABFB0A7D167BAFC9F2DF8F141D7755FB39F, amount: 10.03 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.99991 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.03009 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 9.99991, 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
EF516CCC7D176D2361F5676629CE74E45DE761B900BC68F3DA76F8D3EDB583D98C3B1F826D0E9213A572AD7E823A033C0017ECFB24A6D556D452814C
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00006A73...EBD1At 2023-11-16 23:44:19 UTCAmount 0.35336256 UCO
Previous public key
00018A89F0E88D565E39B3D236F8FC4D0B08951646F4C10C80EA72C886E72D0BA26C
Previous signature
B4F3899D46C570FF7284D14856ACC0A00448721409E655E5F0DE75A90BE075E3A5240B0ECB7D7D09B8FAC0B33B21064DA37BBF6637B612164D696ABA180B4307
Origin signature
304502210083B6E219142FB392340EE9BA00B1FE433070553E8CF4961C67F018C94E5947FA02204F223465C30DBFBF4BA27E8EBDB9BEB89DCCD8E6389B100B63648C7CD51EBBB3
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
003AA29F47B0EBD9FA2D18A85DE074D0696AB346E5FB23B773FFA6B3ED33BBCB71
Coordinator signature
A2053A237A8722DAAA74CF33DB577B12D6C0EAD34A4E9CADC713504D0D72A7EE14B2221B9B48861AECD48BDA3F398E8B958E2437230451E2DA281A32353D7100
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
858509CFB48003114AFE9A7DF341A213A1F53AB6B3FE53DDA3922ACD1816D51C050070226B643B8DBB871278F629A15DC9E8AC148337ED48C57FA2DBAF8DBF0E
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
DE96BB0AE90A7268F70BE53FFD3C0FA63FBC766286C6D64EB5F13642E8164D3126DD79DB43EC0F12E52B02BCC4DB378562C1DB92433C70BD9CC812866E269907