@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1701366060 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000C02B81FC7A0B0BA657DD178733BB2060D838FBA10F90401C1F226FD600D96D7A, amount: 20 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1701366060 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000C02B81FC7A0B0BA657DD178733BB2060D838FBA10F90401C1F226FD600D96D7A, amount: 20 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 < 1701366060, content: Crypto.hash(String.to_hex(secret)) == 0x75AFB5793A09109087B458CAD9471C5C9FDE264A5166DCB701C97F5EF637B045 ] 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: 19.94 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.06 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 19.94, end_time: 1701366060, secret_hash: 0x75AFB5793A09109087B458CAD9471C5C9FDE264A5166DCB701C97F5EF637B045, secret_hash_signature: [ r: 0x1B0C20DCEF0154B9FBFAC0EFF874241F344339F6A7725781BD44232D8CE386BC, s: 0x689E894A64876F215ECAB7AB5195E76DC2DDFD97390F564CCA046DD74B5CF929, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
47462B46BEE4880552476E02B9F5A8869745AB0C2BA81663A4DBC67F45EA10AA326D1C0A35A877E6D8EAD59159D76426820CE3E6412D47D9807C39A2
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000298C...CA7CAt 2023-11-30 15:41:13 UTCAmount 20.4188004 UCO
Previous public key
00012C726FF2953008032CDB62ED8275A22D06580F113DE9C08088E972EE0FD0D52B
Previous signature
B2D6A235E02179A31D0CB88E564C7299C1160876AE3B0C2FAE87307F7AC2A93AACE77E41885AC8AA22F5B7066EFDC82DCBEC44287010BBF54B9C3C62C5BA0409
Origin signature
3044022033A7E5286ABF918583CD1C45341B560240D59DD0AE35AD084B970147BEDEDBA102203D3C6B9143815BE797150145C3CDE208559FCF1619015477281E0A7C230FB84B
Proof of work
010104EB90F7BDD03D5A7FD9B61D9128D7CF24C11F3F7DA96825DA3680C2B6BCC48F1AFCE26E0A5F1A903EDAA4BC9390210A0A4F175847EC2A2BB325BB6D1CE8EC8F90
Proof of integrity
00EE0441FD444A435B4FD279E870ACB269ECB217006A5CDC4A9D494DB1C4B92ABE
Coordinator signature
10A1C8C60F5D8238D6C8CAA25FA33E1F2F883AC356E54063850BFB9769B36349D8EFBD717C54869EBCCD9928FD934AC6C444AD2A9DD8DB3C2E4A8FD2D658CB04
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
C44B69146DA9FB26030152BB95443F220848FB04992456DD234E8847CF6A7FE6DF9978B868F82E6DE1AAA1CDCE076A23BB5D4DA969AACC7B2065E8817DB78F0D
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
132F81617EC4942EA6F9533AE03EC11BDA3A055F132391DC8D8578D456CC20E22517C310BD73EB3B43FA98CCDA8EE6D85D3B754DD371CFCCD53D78105BADE60C