@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1699911240 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x000024EFC168359BBE0ABF897270CBFABBFF5784622EA02A463BA2EAF7C5219EAFD7, amount: 0.0992015, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1699911240 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x000024EFC168359BBE0ABF897270CBFABBFF5784622EA02A463BA2EAF7C5219EAFD7, amount: 0.0992015, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 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) == 0x0000072E418B60C6DABD272BC2728B17B352B8104F068D11365D50134F96A4199609 ), timestamp: transaction.timestamp < 1699911240, content: Crypto.hash(String.to_hex(secret)) == 0x5A5B3CD66F0416916AAE10F7DEABB795B5787F7B74BC32030AC44E95AA2A71BC ] 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_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0989039, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.976e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.0989039, end_time: 1699911240, secret_hash: 0x5A5B3CD66F0416916AAE10F7DEABB795B5787F7B74BC32030AC44E95AA2A71BC, secret_hash_signature: [ r: 0x75F47AD96C5A10D2B1FF84639B9832DCC838B379B558EB58D878D76C8D439D40, s: 0x28A586E77D57119B70928182EFD9B8EA2D5CA8FF9B4FE8AF35EB92417B5E13AD, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
0A49E78B6A183438B5E4AC2954FDCF366F9F0EA2A0ECF7FC9C8B171CCCCBD18B58C075F97B341EEF949C1894311F5140D0C3B510B8F0CD83BBB3F638
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 00000AD2...FA5DAt 2023-11-13 19:34:29 UTCAmount 0.34745206 UCO
-
From 0000A0B1...750EAt 2023-11-13 19:34:19 UTCAmount 0.0992015 00001A4A...01F1
Previous public key
0001FE768F0205D1981B6D709473632BCE701A9E63A8F7EDFC8824FC26607ED294FE
Previous signature
9CBCCAE59EBA680364F03E11C6C9AEEBC9F8AA1711BB53E103E5B676472CAE1C895AEEB15995B44DD8AEC687274D9F34B21503A9F69814F436E6D7EA3C8F1B0F
Origin signature
3046022100EA7BA997E19D5705B40D43067CDEC7AFC9A3FAF1EBCC8A9BE1862F46A1F4930F022100F79005BA5BB6369360826809B9B635C3A615C722CD07B4528D407EAF81EDC006
Proof of work
010104EB90F7BDD03D5A7FD9B61D9128D7CF24C11F3F7DA96825DA3680C2B6BCC48F1AFCE26E0A5F1A903EDAA4BC9390210A0A4F175847EC2A2BB325BB6D1CE8EC8F90
Proof of integrity
004E946B8A04939DCC8DA59918AF1CEA7854147ACF1B9AE95C36D7BA43A980BEB0
Coordinator signature
DCF31DCB74DB4C67581B76F36ECEF3957C868024B09455356CF8C0C16305DADF0980F049E50B1D7186CA7C45B00834520F14A06D89290AF2C52D15295521BD0A
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
0A6A0A67FA7B93693DA5AD75E3BD09810A65F409280D0B1F9E64369E9913D045ED553BE6CCFE500A82D01FAA33F1641385F41FBD64399780145E58385D1D9A07
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
779BB176D8CA63C9B22A9ED54F344E72975E32D45BEB137EA6940B734F87493F044AA6FE78A2755DBE4FE39B03852CD3444FB73FBE6706467BD02DE8EDCBDA09