@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) == 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801 ) ] 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_uco_transfer to: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, amount: 0.001 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_uco_transfer to: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, amount: 0.001 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 < #{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_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 9.97e-4 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 3.0e-6 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 9.97e-4, 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
42B865681DF83B7C3AB410999D6E1332F35283C5E0A0D1D6FF6D94DC0974ED550A4F54C959042936CA5786D2F7F7AA62277A6EF294ED3727BB6B409A
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00007E81...3A2AAt 2023-10-25 17:56:49 UTCAmount 0.57464236 UCO
Previous public key
00016FABAF4927859226A5B2424AD5C41702C384683F418D068363E6123F19BB9B30
Previous signature
7B4D428D351B5E12ADA86BFD6B50B8D27D9BDEA5D5836B2A207F0E045D94EE59B92CF65C51733C9DE74BE50DD7B3645C8297ED7B8CB0865645881BC195FC130B
Origin signature
3045022100A6622864FD0B1AF0F2D4754E17CB158571CE7C241D21D3758AABEE62D9E8837402200141180A9501C8B6D37CC9C6EACFBF53EE44172FBCDFECC6FDA31258CD8472BA
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00B709DB36610AC3BD735DB44B089E5C7FE5050D707C059BC66F1A4E68CABB69DD
Coordinator signature
5B2CD12D741AC92F32821832A8A0E3A3545A1B2D9E474AAA63BF59E36AD66253A44FD9366D7B759BF2247981871F1ECB1B18BAD539F1828BA1A5AFD2ACEEE30F
Validator #1 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #1 signature
D452532512E6684D6A15A731765148A858BB89E902A8B9F111CA98B3557B70B81D412E818BAB0917EDA838D9AC0471F0838C368B3871B624D2CC17882C36870A
Validator #2 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #2 signature
2BAF2785B1375DF16655D5F0308277B9B125EB6F875493DA5C9CFA19E4D6DFD65B29DBE61D670647CA282849783E10FDEDD76ABE7FCB2C2A439D5878E1F3530C