@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700014380 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00008D5D4054C44E2D545884BD557D7E1CEA9B3669EB223C11CDADD6D99A1334F9F8, amount: 0.4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700014380 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00008D5D4054C44E2D545884BD557D7E1CEA9B3669EB223C11CDADD6D99A1334F9F8, amount: 0.4 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 < 1700014380, content: Crypto.hash(String.to_hex(secret)) == 0x0CC8A5B1C80C547734351E2007676D2841C52B805D87F74872C0A708C63CFEDD ] 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.3988 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.0012 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.3988, end_time: 1700014380, secret_hash: 0x0CC8A5B1C80C547734351E2007676D2841C52B805D87F74872C0A708C63CFEDD, secret_hash_signature: [ r: 0xA2A6EBA361824E96ECECBDCC08BC7164E307C1DAE9C36AF5B483AAA52A1E88F1, s: 0x33AD31BECFC1AF25F955BC2915902FB5D2EA22B471BC7AD8487A12CCD04E8BB9, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
163BB307475F2425C3151863AE554B83FE9B3501D49639927AE7D080FBCD36073CC1EAD794AF83C1CBE2CA514320E10872C73A18C3FF31870E4F3AF7
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00001146...CEE0At 2023-11-15 00:13:30 UTCAmount 0.75908476 UCO
Previous public key
0001ABE4745D98F0A36665D92C62232E92ED0EBAA3F7B8897CE91A1C988E054ED379
Previous signature
76C74E390B9577C18DDF20398291D229A4E39B88C52819E8CB9D74DC350DF0732DEDD0C77E9E61381789DC9B8FFD5BB56C5E6504D8B03E7A0FF6BE619CCAAA04
Origin signature
304502207F9786B95EE5BF51D1E262DF10C6B5F538D19B09EBFBB4111F3F66641B9A318602210095FBFA818131C9A1EFC2661B290A77DF6B40416B9C3F08A69614EA2B5C6F0046
Proof of work
0101046C39D56B717142B6EE14B0F8B2561ECA458F3D2D12C9977D613F78829419063211F9C21F7BB0D56B6523040A8156BE22B6E9D6332B88ED882574D12AE32F7A45
Proof of integrity
00AB00A4E2CDA59D604487B9DADA6FAEC76BC6B418A7092079C05CC29C18B1792E
Coordinator signature
1BAA71B27649BF2EBD5D2B6E5E6EC5B4C300FC730B2B1E01F6EB82CF0E151B2FC22EF0EAE4A359121B51C0A2931C13780AE92A18C73F40E682392F4B263C300C
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
8E96A796DA0D85646EDF53BBC7BBD689DCF83DC9B456BB97CB18D4D20EA19EF231A461C87BE68E0180685E641D6CA00C2253D194015239969FEDDC508F9EB504
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
E0C0E21098924FEF40B3BC512F1FFB8B498580A89CD67A7272BD7656453B94133D30AD8457A046F9C87157E499B606D0A1A90513082E2B13A02324CF1E291C08