@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700312100 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000AC85636947ADF7293D3F72AA2DFA8D3363AC74EE6688E83891CF810541658047, amount: 0.00139 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700312100 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000AC85636947ADF7293D3F72AA2DFA8D3363AC74EE6688E83891CF810541658047, amount: 0.00139 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 < 1700312100, content: Crypto.hash(String.to_hex(secret)) == 0x0BFFEC86895B3EEAC934811374D290BFE7260718EA245F859AE43E8A60DAADB1 ] 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.00138583 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 4.17e-6 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.00138583, end_time: 1700312100, secret_hash: 0x0BFFEC86895B3EEAC934811374D290BFE7260718EA245F859AE43E8A60DAADB1, secret_hash_signature: [ r: 0xBCCDDF94C55138A52EE77EC168BB4C9AAD86E076A0441793D36BC75914042577, s: 0x715544A925F09E6DB23AC0CAB94254CF8489CC311C0AD9EB6984BEE632C2FA18, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
881E0400E7FC81F6B3D552F03509656C6ED012C918CFA74390A86292116F54F95F8B1BF4200DEAC5BCED1DD41635F237812AA3DEFD5DCFD0A0963C3F
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00006704...5300At 2023-11-18 10:55:46 UTCAmount 0.37516296 UCO
Previous public key
0001E4A2083F8CCB6158997179947238EBF053974318438E9784A73D89F350EBFF18
Previous signature
5F101C51B8CC9F22F75C77E7B12B8128B75EF2D07EBC6275045FB2126E0B4902540BC4FF1BA0F3057A6D41E8AC7B7471D86897E9B7A0B32058AB4A8CC9EE960E
Origin signature
3045022100980FEB24AB47DC68696B1DAFD82B3716A2D4EE51CC206A271DE9194D673408AF02204FA9CB509AAC0E556523B26A3442A34E1F6BBD2493062194D98CCC3CDA6C731A
Proof of work
0101046C39D56B717142B6EE14B0F8B2561ECA458F3D2D12C9977D613F78829419063211F9C21F7BB0D56B6523040A8156BE22B6E9D6332B88ED882574D12AE32F7A45
Proof of integrity
00A8D29839AC1459D5413A5270CB0A5BBA12CF2A7A83CB556A7BED8C39ABA55F71
Coordinator signature
74298F67533A1E4024A7EFD05DDE77AD844E510A516255ADC0283A7195AD1ECE961899A38D9BE0AB52DCF3EFB315BF8A89B971180901E50C804A56E23640490B
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
249E9B2438D8584CB1781A7BCAA58FA1E5CE0B02ACD79D29CF8947F9CB4494F6608162C8E8475CD1A4F8D811300764F0B6FCDBCB8A3B0DBE1AA9DCFA0C04B20C
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
3DCB9D1CD7C0BA50E44FCCF65B6EE2D6EDC4ED48F17999A452B5A0E592C78F7E414A759FF01A69ED07B7FBE50F4AEDE36BF899479F0D8342F01AC1A583DA1209