@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: 0x00008A140026B9CA26355E22AC341F39F16EAC5A2B7B82BB468572937E04F2A65448, amount: 0.5 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: 0x00008A140026B9CA26355E22AC341F39F16EAC5A2B7B82BB468572937E04F2A65448, amount: 0.5 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.4985 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.0015 Contract.set_code next_code end export fun get_htlc_data() do [ 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
E132C3632526EF7BD35C432FF3CC6BA86F9818B1178297F55FA953CF69DE011984A9BD984A79A4716A3C631504DC43B155559E71092A699E484796AE
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00003144...7E51At 2023-10-18 20:01:32 UTCAmount 0.50061422 UCO
Previous public key
0001919F1C319E5CACC52BBF5F3CBF18B1D53CD5D487B81900F481179F75DB64ABEA
Previous signature
EE1E3FE398B44CC9A967EE2D94204EE12E403D1FF732B857532BA933E6E1B819A9E2C0340FC8F538AD65F746692F5F5A690C1B583885B2A36B199D518F93580F
Origin signature
3044022001E4411AEAF24F1D68E81D550099D9909BE9D97C94EECDD81FEBB455D47FB9C30220742E8967F46F8E32CA6038752A5523922AEB5E62C81CC267B2065CF946412E1A
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00C4793298F04129FEA8ECAD8E84CDF4807CDC45626CAD9FEC853B9370D769D4E2
Coordinator signature
6DCAADD09E6B744DA4BCC18AA5011279A65BA536F90014232778A8CEE888790EDBB39D1A8F9127D8DDFF8238466115B86DE779CFA6D647112ED53A22383AA504
Validator #1 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #1 signature
B92593B57C8F11995853E905D817A183BDB0B4CE2DCD99E5266DF46AC2E74D48EB197335A00C3C4106CE42800C9E120CAB100952E12F00393733B1DE54434707
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
AF2CA03A99D158972611A2F77E8FB0E07390C7A5317D64999D2B5FD59CC60F079AF388D96A51E19CD57D09EF68EA97FC24F5289088B91AC7078386B4E22DDA07