@version 1 condition triggered_by: transaction, on: set_secret_hash(_secret_hash, _secret_hash_signature, _end_time), 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 ) ] actions triggered_by: transaction, on: set_secret_hash(secret_hash, secret_hash_signature, end_time) do next_code = """ @version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: #{end_time} do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, amount: 0.05, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= #{end_time} ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, amount: 0.05, 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 < #{end_time}, content: Crypto.hash(String.to_hex(secret)) == 0x#{secret_hash} ] 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.04985, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 1.5e-4, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.04985, end_time: #{end_time}, secret_hash: 0x#{secret_hash}, secret_hash_signature: [ r: 0x#{secret_hash_signature.r}, s: 0x#{secret_hash_signature.s}, v: #{secret_hash_signature.v} ] ] end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
0BF38E29C896BFE0142D0B401551E35B2BB1326C0B1F6A73B8D7B0EAB1F459089417A2F0FC49987D5055A9A4A55DB905B5FDE2E270AF5912A119A34B
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00005278...AC23At 2023-11-12 15:50:40 UTCAmount 0.34341008 UCO
Previous public key
0001AA744703AF7E5CF48CE3576BE1C27EDD24819356BC0CD9D18D92FC453ED57D69
Previous signature
8CC3A3F2A0856CAF5F7ED47E6BC36BD920EFF2D18F64D044E38CF7D2F5B9C0B4581AFB9DD33E415E45B5DD043BE061FACD772908DB008A2F0DFD51AE9CFE5B0D
Origin signature
3044022012F09091F142D09122D822FCF2569546F35E650589AE06CD6ACD424B032F5EE102203E79D2B7273CACF78AC5CBC93B689A896DB31C6B3EA8A33A8E0D63D498BC25EA
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00E9AF0FF1D4DD9021BAB1D64449ED1A9E45CE84F3D35A532BD10EE983D0751B93
Coordinator signature
A2DF3EB1781E476672D8BD372C80F97342FD8C60E3D40C37F172523A89DF2A996204706C1A4D9D1DC87EAC64D7563AD769CDEE91F5B8C15CE8977DD02E9E2F03
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
9AEC75EE8C22BF85E6B0815CA0C6EC0266004B1AD8918327C9068EF38A2F83EA2A35416FEF668A50D3BA753DAE72C22B758DAF47B4E37727D7E056734448D90D
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
9CE026E58B5FFA32EC823348E5A09360D30DB979F05630112887399C1A28861463FC037015570FB247DD76E6C703AB4D64040C4D560027E207C63F889D10A504