@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700588160 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000F0399652294DADBD09B8099A7FE9762B98E7DFEC079AB2F1F5D33D8C933FEFDD, amount: 10 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700588160 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000F0399652294DADBD09B8099A7FE9762B98E7DFEC079AB2F1F5D33D8C933FEFDD, amount: 10 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 < 1700588160, content: Crypto.hash(String.to_hex(secret)) == 0x3B03A1DAF2F2E0AEC2D1A0E23E417E17534682F9E13CB744F6AA8C02F1154516 ] 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.97 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.03 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 9.97, end_time: 1700588160, secret_hash: 0x3B03A1DAF2F2E0AEC2D1A0E23E417E17534682F9E13CB744F6AA8C02F1154516, secret_hash_signature: [ r: 0x9843B0D3B7B4CE41D8F3554A8E69C0921A1B2B98DB4315F429A70B4C6A29640E, s: 0x6959C777F4A5D090BDCB76B38A912A6F07A8E0F34F50061BC3B7BB250EAB8025, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
DAD4C01290F7CA167BA8DDCA01403749EDBF2C86691BFB31D489A409AF787036514FA79E2C1B40AFB668064FE074F7BB9B1ECD054CF4AAC3A04F6CCD
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000B8ED...A2A5At 2023-11-21 15:36:26 UTCAmount 10.3792799 UCO
Previous public key
0001D0825BD2C5FDE1ED41073311A8EA7BC73F699ADCC23333378062130539ECB6B7
Previous signature
E19A446CB27B719662E86E5C9D1698DED1DBEF590CD3A69AC0708F51FADC0AB60ECFB11F61F5B6E7E95EC7A643D4994D5BE5DC886703C3C4F2C1B1937458400A
Origin signature
3046022100D581E5F62BB6C319BF6878AA986DD22B00645B8FEEE23C4F6240D48C8FC09585022100D132CEA39395A5FCD2797FFACA4E7C5E14A9782CD320009C5426C8F8CE38F5B1
Proof of work
01020451684966573439C38DA99334546FBBDE4A6D96A50B4A4ECBB6572CDBED023F079607407E254421D1779525D11C60D55684F0B403B93B95823554E29D1E2CDB16
Proof of integrity
0023875BA3426633F89EA3600F2513127D7B071B22E1A1ADEE068A8B464360E176
Coordinator signature
84A4330A2C53904DB3931917EF6D9BF8ADA15270B8D6A996EDC37A80814B3630DC3D9B055A73B69A5CFB5FAB67D2164EC56843C0403A415B10E65618F3762207
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
B91F9FDF19472DEC746651D5E8B4F657F3369A20753DEECCF51ADB42B7754E5C9087FCA1259B300059A7BE41BD32618D8102F3730087AFE892C6A782AB002E08
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
04E779C0EEAF41792BE6292A508FF28E430736CF1079BA754AAB0DE957813EB4FEB8C73D9B45A40B128136EC24A741CF50FB51BA47AB784D2BAEEB801023F40C