@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: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, 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: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, 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
6EFF3127ECCE57D36F47457AD0C35DEF76B4E91E1E2574452C6A0F2009C410B11359CD7C91905C65CEC3E7FE6EF32C83567B2BB971692DA95DCE6B19
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00008626...1C47At 2023-11-13 08:48:12 UTCAmount 0.35054266 UCO
Previous public key
00019A9AF309BAB37FA0CD28515CBF11A89D65664CC9151ECA7D7411CB966DCA62B8
Previous signature
AB4678F35B855656846506CCF722B0930B04FBB77A0973E5AE22708FBBA9830FEDD3A7BB880CAAF232BD71A5575369B8D9DE409FEE8A7C4A36D772F7FDC73404
Origin signature
304402205D0E504A9DDC7D6ADE187BF118085DAE4D89E902760DE0A7BED13BE60D94F010022061E00106FDB040D279F41D7198C424D281B0D9767AA4EDE1AB32E183CF615799
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
0031BCAA8E460107CCD0DB2F1D036906969755B924A8C0320E17CB7A9D6070B560
Coordinator signature
7555CFB81680A190F05BB0EDADA3F9630420812A9CD9A62377DA940C7582F85A7CEEC2EE3CFF56D5CD34D0E2F805B1ECE98AEECFD1E6DD74107E606D9A59E207
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
EB54CE088EEB77697F07BD34545F2F9838FE90B8648D70F5DA99A64005118D5FA0701C4F3623AFA38994C88AE8B658A50422198CD55E93BF4C68D584126F000B
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
D3103612B471340B6D6E7D07CA942BF14F8F9D1447850166A7A53AF13A71B8D97CD59A3CE65AB9C0E8CEA16A7F2067F6D30F25D447B84C802FC31D08FEEBE704