@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700917140 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x00008D5D4054C44E2D545884BD557D7E1CEA9B3669EB223C11CDADD6D99A1334F9F8, amount: 0.1, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700917140 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x00008D5D4054C44E2D545884BD557D7E1CEA9B3669EB223C11CDADD6D99A1334F9F8, amount: 0.1, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827 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) == 0x00008DD22E7496E86901E9B276A1BE6F9512EB09980CC04C7B76495EF37D5666A709 ), timestamp: transaction.timestamp < 1700917140, content: Crypto.hash(String.to_hex(secret)) == 0xBF4880341F7817EB573A3DDB17926289DF27FE0C5B973EB41786556D25ADF276 ] 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.0997, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.0003, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.0997, end_time: 1700917140, secret_hash: 0xBF4880341F7817EB573A3DDB17926289DF27FE0C5B973EB41786556D25ADF276, secret_hash_signature: [ r: 0x7E83E050A7E6FF61A9C5CE945052D3875DB6B24B9B40AE0F3B606FC6406F4995, s: 0x70765C7272519AEC32EA9A5E304BFAA6C19AB4273B50D10A98CD81466C9B955D, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
C72E6843C92DFFD6F0D3704775B6A16BB621D27BB61E07E034FF078379C487C7EAB9136F7E0F01153A5136B1D510EEB3324F3550867E6CFACA167FCF
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 00005F50...0692At 2023-11-25 11:00:02 UTCAmount 0.41231132 UCO
-
From 00008F0C...B097At 2023-11-25 10:59:51 UTCAmount 0.1 0000288B...B827
Previous public key
000169D1CE48B66C64280A318BCE13B5EBC6E9076CF792FCFE620528D37A5B5CD6E2
Previous signature
C24C29112507EA6F0AEC046C3F2840D1A01FD3B7D8A94C942A7AB2B62341E16C51F71DD6495421D219F6676007D6CEDC63FD4205E3CB8DF94564AC2F09809B07
Origin signature
3046022100A6786BE7189256B573F2E51A53F7F05C1C4B1B44A2B2CB1E1FB119E53A481296022100AE7DE195B33871961388622A690B43E80BC38C8887A696D72397E441FA49D17E
Proof of work
010104EB90F7BDD03D5A7FD9B61D9128D7CF24C11F3F7DA96825DA3680C2B6BCC48F1AFCE26E0A5F1A903EDAA4BC9390210A0A4F175847EC2A2BB325BB6D1CE8EC8F90
Proof of integrity
003DC35464F58A9381E9584317B879F3F236FEF4620F252BABED17BFF6EA1C4F12
Coordinator signature
45B7FC9C2796F90E5CB12CF251E001A3CB184F63A891644F23EE1A22D98A33F5D5D4DBC85B9A9F48EE49B23202327A3EF4F4CF4AEEEFE67AFC60070B5A489A0F
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
4A5BCD009E0ED3E9E56AABE0C3F15D728BDC364AC6F402D5A800D9E8838837FEFB7ACE60189842F39583C7DA4C3F36FC5F9D5C7C3899EC87FE93582721BE8E09
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
03077CA51015A513B17B10EF2863B28B0AB959C07E45A011523DE9487965AE0A23FE9A5010F1A3609AEA3AADACA3D65AF37D7E6C469997777E5D7D57AD7D0005