@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700002560 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x0000B2EB08BF3D472A2E4141D37FD3DA8B61D0E58246B4F37436A5404C6151BE7FFD, amount: 0.09, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700002560 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x0000B2EB08BF3D472A2E4141D37FD3DA8B61D0E58246B4F37436A5404C6151BE7FFD, amount: 0.09, 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 < 1700002560, content: Crypto.hash(String.to_hex(secret)) == 0x7F358EE563076D2D9619CAA9BAF7F5B8A1C7A6B8BA5DA98D990B2100A88545C0 ] 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.08973, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.7e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.08973, end_time: 1700002560, secret_hash: 0x7F358EE563076D2D9619CAA9BAF7F5B8A1C7A6B8BA5DA98D990B2100A88545C0, secret_hash_signature: [ r: 0x1ED13D0D80284127BE59CEFC9741B5228FAFA967EF5BBEADD37ED82299B85150, s: 0x030A33E717BD59A2ADDF9E0CD158BA1DDF403BB3C9E2F3ABAE2CDBC79FECA116, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
54881E9AD4E14465419CCB364EF36A7B129F5B661BEE1EB841AF36C8688F84C6AC5F3BAF485B5CC4152511CDE34E35981CB58A1F68D6FEA3A9D41B34
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 000061DE...5C9DAt 2023-11-14 20:56:36 UTCAmount 0.35363411 UCO
-
From 00007236...2FFAAt 2023-11-14 20:56:24 UTCAmount 0.09 00001A4A...01F1
Previous public key
00013E1B6F746248CF1FCF7E530D81D3EAB11A216B92BB7BEC32E00C4073E7673B84
Previous signature
74513EDBB49F23C6078983E359BAC5357906BCD8802DBB75C85DE7B4CD403AD7E0B3794F8909520DB8BA4B48C3963C86511066608A792A6545AE9F43E98EB203
Origin signature
3046022100D51C8E10A65A66B98BEF2AB380FC426E1D157BA353821028B70D53454398496C0221009C8AB276A3F72306048AA31EB09951A510B3639B9F408B39EE035C3E01571BBE
Proof of work
010204E9BB401A767B0C92D5DB139379AAB18E1B449B455F49E3A44F3466B2D38E59F0516B79493A528A95E5A74CF46F79CF12DEB73293458F6A4403D2B3E57D697347
Proof of integrity
0027ABA6284EB1C6BC1104E87F00BDCD96BEE30C346CE3F42BB05CDCB011C1ADF5
Coordinator signature
498BA134211E959A0A588A839895586BC13A055570A28141D7A865BF6AFFC4A94CF13DDDE8581BA175333CAE28174D2522EC8A1F20268183FC1228CC17327B0A
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
5391778246D8974E6214AF7AD242D9B6316600D5482EAA60287FE6F2EDA1CB2C590E7FF93A2720B2FA23C252304823D0A4666B01876DFF2EA521D7694D6EE603
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
E8C699AC3F6C1FD8F2995FEF51106FE906E165A5C29DD42C14D115E6E280B614DEE82C445D7A23004710380C326011C02EF24A6669CDC820FDAA19C86B558E04