@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: 0.01 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: 0.01 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.00997 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 3.0e-5 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.00997, 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
F92D3C78DCEC1063E7B900BDB2359806A2FDA524A986FFE9E3B68335B2C0DB36A60B0F58C74E1D4FC0C22AE6CA309CF561F0644A1F9BA4AAAB15A78D
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00009023...F43AAt 2023-10-26 14:08:46 UTCAmount 0.56945032 UCO
Previous public key
0001A2D4FB5A3F7761D93282C417C64A8DE3DC70CA2957BAD6B4BE82C9F794A9D086
Previous signature
6962AAC19DDB1F98C0EC358278392AACAC33E2D60EE7CCF4394FD22C4931BC0C605CD31CD651407890DAAB0CE0244367EC71DED43822C76B733FC6C4BCC82109
Origin signature
304402204E077806206FFB3B2119BFFE5B53CF20E96CFCEC9C1DA02178C17FF9A351925102204D8819568F486D4F6410ED60B79E936A0475925B2B20F8672FB2657ADA0EB0A7
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
006CB79570E8A000D0358DF6D6F3BB3CD68799A224645E1976F419DE4DF476EAEA
Coordinator signature
4B4F27EF8D78DBEE2BF3B9AE048CB0D49361A0D96ACA16ACA407541759775C2C5A534D257008DE922DFF83B404EE9B9F3A0957EC333FB95C55A9204EE7DE420C
Validator #1 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #1 signature
3F5F923722A05C04A39632FD7445849C4E5202AACAE0750EAE9C3C2BB8D0E6E818EA3BF3D43B17576A94136AFEC806FD8A12082B11A201EAAB91686B11E05402
Validator #2 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #2 signature
260D2EA15A29F672FC1330400A73E05F230C90DEDED3554CFEC37CF2EE69DFAFE96D4A28D75DAB080B1E52A910D2A1DBEF784BD94ABBF1751AD145F35A201700