@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: 0x00001C6353CF7015A1BEB7096B1ADE63CB30508CBDF143A84818B53029BA13910199, amount: 1 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: 0x00001C6353CF7015A1BEB7096B1ADE63CB30508CBDF143A84818B53029BA13910199, amount: 1 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: 0.997 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.003 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.997, 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
9E0EB02FE771A5ECD2A5ECF7489A7C53B3C922137762E2BB6A9EBB24D2BA3C84C42B2B8E89A349A080B4B703EFAC31FD8E1D2AC00C0D3BFD34D482BB
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00005488...3BC2At 2023-10-30 15:25:24 UTCAmount 0.55667986 UCO
Previous public key
0001F0D4711DDDDBC676475E8D323CE316A95D00507C671D29F242BABF08096DD969
Previous signature
67D13553F31F203B14102406306807CA7B015358E6EC0B8B18C98FF8204F3952D1A8BBFCE9D9466BDE7DF19CEE52571F6856BDAA0F59022AF935B6B40B5EB80F
Origin signature
3044022025A24B6AE3D7B3798D4CE7F1D9BA3D133E75FFA26D7E9A8B0B866DC046A1586A02204AEC18B7AB0D7EB4467A560F6BA889932FEC5EED66F5F66C036608403E251E7D
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00B024B06C3FB5B0C93AEB57F605DB415A9E81608761EE455AFBE9E69FF271B7B6
Coordinator signature
9AF1AFE687622E5F51666B26C5DC64037945154951C0AB11EB7E43AC47207B0F649F4F7E14D0D47029AAD66F8180B177312A09D96674D5E8CC83F7AC04190E02
Validator #1 public key
00011ED0B570D680BE5ECD58D2D121689DA73C46DCB38A01C6E10D06286040ADE30A
Validator #1 signature
3C240CFEFA6BDD5F5A4388726473F3178030989B8410D2A7160EDDE382D2CD5DC243BF7D8233C274E46AB7F6D4865A48E9F17C38727943BBA38F615F4BC3230C
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
857E017368AF1E1525255CB3D8F784C760FBFC64CCCA93F2EE334D51A09F06658B8B9552D825327781B7486E67BCF1654D08A965BC228FAA4C0ADC080CFF4000