@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: 0x00009E3423F132E4B11DF35B68D4FE14BE9169D828AEC8EA8EDE71F5BDB1A5D64FDF, amount: 25 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: 0x00009E3423F132E4B11DF35B68D4FE14BE9169D828AEC8EA8EDE71F5BDB1A5D64FDF, amount: 25 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: 24.925 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.075 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 24.925, 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
1BB5D6A3EB0A59F215E6B2E25A0A661C43D15DB09154B48D63475C2CB4F906C00D0EED8E9A705AB1A1E31E9AD4CEDDCB97261B58A12A3E920D032DFE
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00007ECC...9C28At 2023-11-15 16:19:16 UTCAmount 0.35145764 UCO
Previous public key
00012E7D7C2E750F8E1F591C746233CC2719B931C614C4C61A9E4B619D084A8AB4D2
Previous signature
6AB22D1113678D145EC9561DB79FDD4A8BE610A85E27175A1C9B6F8EE4B34A1311608903E5F91F60612209F7590FACE5F1AC1B6E8F52894010BEBB072E0EB10F
Origin signature
3045022100989F2476842C5B8DE2B29C4F33BACF981E41BA6E7E86AD8F6FBFCBA8A5F35F1102201E4B95126AB0AD07FA28220A4BF6234424B549FEC7F63FC948194D22A921D735
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00EEFCF51E1692359A248B27B08125A29265C13B70E0BD0CCD9BE451D394C653E4
Coordinator signature
BA94C1F299EBF33B67535632046FDE35084F7C016D98CF41512CF17BF3F17CE4E4BA163BE9CAA08D02ADFB3CF23E2CA2E1C03DF6D5AC4E98EAE73A821696A505
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
E3ED54796F45CD75D49F170DBAB813EFA819A27D78A743A5C36C4A9003AB5F0CABE7C9214DC3CAA3859329CA58BAB6D7DBBD654AB14057BE7864CA4CFEAF5307
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
58975B4008BF9F2CBE3326C845E825F94C761E2E43DB7BCE8E00B3AA7C1BA451097113D1C3DDB16126263A2AE6096D32491F89039710A1144DCA39D98598C009