@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: 0.008 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: 0.008 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.007976 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.4e-5 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.007976, 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
854330E5EB87ABB1E65463822B8B09F8F2BF66A30A5CC409D0F8E5155AA58D875A144B34073BBF329A86BE000A71FD3C0D0F08756AF5DAECFD600243
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000C5B1...7AA8At 2023-11-15 22:06:24 UTCAmount 0.34845114 UCO
Previous public key
00010445EC670397C47639F2A0637CF58CA0B97BA4A90F4C1B5EB3AFE1B589CBC253
Previous signature
8677518A83F9022FC287FF0450A77802E120A3E0C3883EEE439FABC20D076439DA3BA38A41FE183D50FB61DF7E4D3322D5A1E13CD27EF8C2B9DEE89D3CC29E0A
Origin signature
30440220623C3FDF44952ED07445E0E5DCE68BF6BE8DE11918E37A4987F0BDD1D75ACC3A02204B35D9F870D296669AB4E3E28F502EA009333E213DDB3D93D571B0A01524C4D2
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00080D212C96182059B6315C9791B363A311F393970B04E7231CF99E5E423C474C
Coordinator signature
A65E52D5E0912D17597957D0FEF1EC9908FA734AD410F5755BA772B03536A32CB376FF5852E0CBBB004AFFC87B544FBFA7CE2BA33501575AD996EFA61F25B206
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
DC8E0C46ED6902ED8ADDA08DDFB251248F10081F8DD8BE4561ED12BBB85F879982245F6B20B58B7D4E94416B02ACEB2C8BB18C228B15204149D0CC12C5A22101
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
A677CF0FD78231BCD519EAA0171783719C258676290FAAE3744A50FBDA7DB2D19A0912A87C1293D01E762DC0852C110D4DE756F51F7FA0256D6630B5D932420F