@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700003820 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000B2EB08BF3D472A2E4141D37FD3DA8B61D0E58246B4F37436A5404C6151BE7FFD, amount: 50 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700003820 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000B2EB08BF3D472A2E4141D37FD3DA8B61D0E58246B4F37436A5404C6151BE7FFD, amount: 50 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 < 1700003820, content: Crypto.hash(String.to_hex(secret)) == 0x08F9CCABDC4FC077AAA5EA56009D5FF44C02C42C524A9941BE2BC64BF9337B55 ] 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: 49.85 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.15 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 49.85, end_time: 1700003820, secret_hash: 0x08F9CCABDC4FC077AAA5EA56009D5FF44C02C42C524A9941BE2BC64BF9337B55, secret_hash_signature: [ r: 0x5A26CDE7844E871004A2C3F5783FB8CF7DA6BCE2EDA325A5825A758BCA68C41A, s: 0x1DCB3B4D08C74866EF5062D1251391FC93BF629BC4FA2284FE980A955DCA6EBC, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
B35A2952E7A23C3456358E14E5ACC16A6386CA6BC1E8230762446210A1FB4AA068E96800A73030601BC7C7879B4ECF6AC78F80789A7F3FB6755FCC11
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 000026C5...C444At 2023-11-14 21:17:20 UTCAmount 50.35347368 UCO
Previous public key
0001578E7CB3AEAFA3DFCFAE74D51154E48FF5E5798E08483A323E5AC12A1EFA5FF4
Previous signature
1DA8B22A819A3371929EF07864C16E619D3639AC73D1F3EF5FFFCD66E2CC406442D128B0485B8B7A903DDC950C2EE97BCA07493A1448312A90F0F20C4F923301
Origin signature
30450221008810473A033B6B22ECDC607A069FD64874C9DF9CCEDD507E230FBA46F5D327E2022054A77996ABA88FC880DDE5C39ACF046D3E48A75EB6DA62FE9C7BEBF046D85D2C
Proof of work
010104AB672F1E69B064D192819F1797C1926F158DBA8F3924AC732B4C4D70D0C8EA0A0D6506E5896C9C2524D2BE26CB5016287E1816A597C408008BA36FCB154A7765
Proof of integrity
00020C149E60289EDFECB4424D2EBFA107AA37FD1B3DC90660049EB417042930CF
Coordinator signature
CE1B76D68BED7BF42F6448AB2BC793EEEC51FDC0C027610632D364AB6766B38AAC6F2DEB976F02D3E813C158AF64FDA8C72B0FB4E0F4BDF3D0BFC89F63F2FF00
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
327453BAC1A005D9F8A69E25F17EF31217BB3B2C981CE59B51673C218A26B7CC5CF10D7EDEBF2DC1B78DBCF457A3DEA811803A8F6234C341583295ECD5CBDD02
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
56E7D84AB42DE94F7FFB0D342BE5D89CA9D8DC4ED9692C0CCB8B4A0EB87647AC4A7EB7AFCA09227F5FAF1E92A50CCEDA4E00168CF346036BC462348F9C43A208