@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) == 0x0000072E418B60C6DABD272BC2728B17B352B8104F068D11365D50134F96A4199609 ) ] 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: 0x00006AFF130BEB6BE9B02B80FFC13DB5EABFB0A7D167BAFC9F2DF8F141D7755FB39F, amount: 0.05, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 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: 0x00006AFF130BEB6BE9B02B80FFC13DB5EABFB0A7D167BAFC9F2DF8F141D7755FB39F, amount: 0.05, 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 < #{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: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 1.5e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 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
E2977BC713AA0DDD2A5D0F5287DFCF69B04553FD87FEBEECE71303F28F9E1E99F0141E943BE01C349B19B84DAAC552ACCDCDAB99AFF642360EA28FD9
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00003889...FDACAt 2023-11-15 00:55:13 UTCAmount 0.35790274 UCO
Previous public key
0001383C3A1E10D2B70C75D3446AE96CC752BC3098129F05BEBB327FA8E0BEFDFB9E
Previous signature
171ADB5C4B88095A1994F685DC7A04B87C145B9F3C7464C17E397C76A1A51339D7ED1D81EB166910E0C910BD7F1495D6377C494870F0FFF2D63E306DFFDE4D06
Origin signature
3045022100D8C23831A0A1F20255734D145A35E93BD51249BBD846837A8B3DBC3D21466B970220046E54241E52618EE5693EF80946C974F4A601C8CCBD6C1BF75E1A1327C4E62D
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
000CB13955198E8A398FCD59553AB83D21165BEF779004C10302491F67CC6885EF
Coordinator signature
20180874B89833F1765DAC1A0385D0E64482B2B07352F5324D77EFD6EDFCC3420C2F11B1EE203A3BCE7BF6D00391520A297CCB1146B20221FB79146EDF71A905
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
8AA4B8BBF8E13C404C3F2FB9863AFC04F0BEABE38C1A851E0ACD1B272543A8B4FA111A9DCA6E071730F462DA40F1672CE6E9091338DD13703450DEFBC5CFC50E
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
AE0F5EFECECBF3A20BFF234F7C7EA2AA5127E346F541DDB5E91A43BEF9FCFA55867F08EDD614E196BD6377F636A6281DEB6046A4BEA92131F3F9A022B165CB09