@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1698164400 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00009E731DE71C9598A6C853EA89C736B1DAC3652AE00753651B642536AB14821F06, amount: 8 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1698164400 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00009E731DE71C9598A6C853EA89C736B1DAC3652AE00753651B642536AB14821F06, amount: 8 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 < 1698164400, content: Crypto.hash(String.to_hex(secret)) == 0xB66E6A81142904ABB3A5A2B8B3CFC2118315021A5A0CC9996AEE2A46A7FBA7B5 ] 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: 7.976 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.024 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 7.976, end_time: 1698164400, secret_hash: 0xB66E6A81142904ABB3A5A2B8B3CFC2118315021A5A0CC9996AEE2A46A7FBA7B5, secret_hash_signature: [ r: 0x210ADA90287E99E7C0C3C84CFDC43B98CD212223B41915928CDA787A013AAC49, s: 0x312320382BA39BFAF8755B6DD946B9CC7356BC405DFA4A84076EB7409C238E40, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
DBB4F34CA36C3EC371C4B832E85C8DAEB93E2B94391E1592F9F1F5F0AF1232490517D10216AE285F3315C2FFD34553F8664ABDF8A2BE6D0D1024DF93
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000D348...C5AEAt 2023-10-24 14:20:35 UTCAmount 8.6244016 UCO
Previous public key
00013229C4B3B118925588203AE0EF7A1276790DF5FDF712FFC088FEA13BCA8F12F1
Previous signature
F4D176333204FDD9BCE8FDA7335BE4850A139C3DCC3346A929090740D459E2C195F6805212D72747EAF048000F728CCB5897B322676101E2AB449FA8D08FD106
Origin signature
3046022100B30B374B622CCB0F45C4998DFE0C2EF1C3B531276D4B4469639D1F8663A2C7FD022100EE0C935E914CB160BB18A81E281F3D9B52044C8C44B632F454ED98C005BCF556
Proof of work
010104AB672F1E69B064D192819F1797C1926F158DBA8F3924AC732B4C4D70D0C8EA0A0D6506E5896C9C2524D2BE26CB5016287E1816A597C408008BA36FCB154A7765
Proof of integrity
0005FDF85A451FC2D0FA6F6136245F2545EAE015E3990F0EC3B967BB694F3F04A4
Coordinator signature
70619D8681963A270143378999F01002F355A3EECA42875FFEF91CD11F125BC38C6ED07D5282140986F047CF3F809631848E0FE16525650551DA760419EAD00A
Validator #1 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #1 signature
4A807CF07BFB06A3685AE6432616019FCCF04C2021AC1DF3F73968F8D62CDFB627BA88150F80839B9E7FEC4F259E285E0F68E8B7E25388AB093AC66F2D920501
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
69DB910B7B8AE65E49331CD5A69BD9A4719296D22244756B60E07409C5BA3BB8DB7900FC063298C18FCEB87A793DB2DAD7E0AF69763E636522B0A920921C1B0C