@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: 0x00001675BECDA24450FAD82114A15B58567979E8E7AEA1CFFC54CE8C1779513EA2AF, 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: 0x00001675BECDA24450FAD82114A15B58567979E8E7AEA1CFFC54CE8C1779513EA2AF, 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
B0E294FA74FA6E5541CDAC15BDB39780381134CA4CF5829D8CFE412CFF8D311E50E0539B1F9984C2C1F86739E6C8BED21547A49447189CD16A0DCE3E
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000A522...9E8AAt 2023-11-21 21:13:21 UTCAmount 0.38118018 UCO
Previous public key
0001F528ED6EF2B56BAFE99DB5FDEED17DFE593AB884D2A8CF2D34BC6F4914775812
Previous signature
129EC4EFC23EEF99AC71A1EFAD80457F0077DB9A3E34006D9DBE51936CCAD61C9030B97AB30FE14200EEED36F7ADA8457A0E15F7DF29B9875844C317D7202107
Origin signature
3045022100E81A71AD74E09626B71E281ACABFB05B0336F4B5ADD386409FCA051F01DB945C02201B3778913AA53C4CE5FD80F435FD33DE35F1AD4BEE57D433D098830EADFD00A7
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00B6622650152332A8258A61B034EE7E6F65F0423528D36B09B34D50526BEC81E8
Coordinator signature
20FEACCD787D9CE6A387296D07C54FF60EFBE49DE8D8EE31A3712AFDE036C0D619182D9FDF7584050FE6F1004EEC0611871A4A7498F20D96F5A5E05CAE9C3209
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
1FEA2BC6BF6B0D831F8F336527E62DBC0A12C3FF48D3E8FE8407F3623EC0178FE6E79FA0B52B022CAD5B41FEFCE45D6C0347BBE02E3E06750E8BB15B2D0F7304
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
EC9A183650B8BC08C7B6EBCEAB1B2F37613CC9FEB91FD77E5AF26342EBFD1DBD8FDBF5278D823C4C25EB28751BE6AAB0F745DDDC7943085CD94896CD068CBA02