@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700012940 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00006AFF130BEB6BE9B02B80FFC13DB5EABFB0A7D167BAFC9F2DF8F141D7755FB39F, amount: 20 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700012940 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00006AFF130BEB6BE9B02B80FFC13DB5EABFB0A7D167BAFC9F2DF8F141D7755FB39F, 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 < 1700012940, content: Crypto.hash(String.to_hex(secret)) == 0x5F5A61B58AD3AE58DF19CB3DDB40BCE4D36833976CC37FE2C9FD3790B3257652 ] 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: 1700012940, secret_hash: 0x5F5A61B58AD3AE58DF19CB3DDB40BCE4D36833976CC37FE2C9FD3790B3257652, secret_hash_signature: [ r: 0xCB5A5201B16266A2BBF4152ED45F107B70CD1ABB7173596F9B4941709DEFBC9C, s: 0x72F4635FDFAD4BBBFA5F8F83BE8DC9C57EDAD8A58E57FEA8E1F057CC286248DD, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
4F200E652219CB8FCB52A82EBE72F97882EA5FD25EF8CA8A69826AB603A8F56225C6286E9F87A715F44D00530D950345D184530DD590CD8179688820
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000E6EB...2581At 2023-11-14 23:49:33 UTCAmount 20.35859577 UCO
Previous public key
00010F9B1C831BCB990087EEE5F9D35E6B48283BA0E9F88E133B29CAA09C95C51DF7
Previous signature
5BAE9B7BDB86EAA8A9543C53DE06E522E9BB8A7E5B267AD9B28186628A278AA06C8EE16D0ACA3285C4DCD864BEFE5F68E9C6E4B9BCA4D2BA20A78452888DFE0B
Origin signature
304502204E37BE6BB0810F1192C1784C54D2473C53272E2AF7FFFB486CAD8A47CEF1CB13022100F0B8AC98712588095D288B28F09CAF841820C425B8B428CE6C3EA0BACE8A7BBE
Proof of work
010104AB672F1E69B064D192819F1797C1926F158DBA8F3924AC732B4C4D70D0C8EA0A0D6506E5896C9C2524D2BE26CB5016287E1816A597C408008BA36FCB154A7765
Proof of integrity
00AAAEB4BE9A9D9F78FBBF39D814CAAFCC646E613748D23EC13622B1579EF43355
Coordinator signature
7B25D4EAAA1C5E827609466831CED954F7C58CD6B878202056C8CD3661C1F4EB1B1A7DF0C223C86060A1424D37BAE8F55D6C3691A17000B988594AB3CB53AD0A
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
7552428390C31BD08CFB0F17BEC54F2CB64EDCEDC6A44820D08012AB9698AD0A8EAD419384E653804965A30BB0F0A63F2235721893317556C40C6C26D0509C05
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
BFF479B939E8869D30D17612EB18247F0CF6641D20C969E4435DE17CFA5DD4881D01E36FB9914B91C82A27B1C75708B86684BE922F92C4E6EBE052C237DD0108