@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1701318600 do
Contract.set_type "transfer"
# Send back the token to the user address
Contract.add_uco_transfer to: 0x000052DBB0394202F5E1A0290DC1595870AC160515BE80781452FCB0A205644F801B, amount: 0.0019
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1701318600
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Send back the token to the user address
Contract.add_uco_transfer to: 0x000052DBB0394202F5E1A0290DC1595870AC160515BE80781452FCB0A205644F801B, amount: 0.0019
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 < 1701318600,
content: Crypto.hash(String.to_hex(secret)) == 0x101D273300974C020A7146F02E9C04115D507339C23089697B5E72EB61C54A14
]
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: 0.0018943
Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 5.7e-6
Contract.set_code next_code
end
export fun get_htlc_data() do
[
amount: 0.0018943,
end_time: 1701318600,
secret_hash: 0x101D273300974C020A7146F02E9C04115D507339C23089697B5E72EB61C54A14,
secret_hash_signature: [
r: 0x219A2FFFD853BE5F0C61AAACE03C7C8BBACAB5E6F9F4468541D9094BD5F2B46F,
s: 0x613FB5755B8DABBAF3682BF1999ED1AA8DF0D32D9AB729713977D9352920FA7A,
v: 28
]
]
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
2E41FAFB18912A33CCA96FCAC99793BFE9F9F1B4E0D177FA6759D431AC89E7E35DAF87552D288C8C7BB4E11731C172D229F4E6DD311F9ACE130FD097
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000EB66...FB7EAt 2023-11-30 02:30:58 UTCAmount 0.42320854 UCO
Previous public key
000110F25955E22DA1CDF14969A0AC49DCF9E8EA2713E80461C2DD3235D643624D36
Previous signature
6EAFF08277BEF4A9932DDB68712F00284CAE77A9B8D0E49EFBF482C2585FD9BDE657DD8C4152092ABC5A83C9D1F14D4371E347DA60DA9E8008491A743D2C900D
Origin signature
3045022100F0A5CE99CBCCCA5EA8B56AC5C37A59D0F75F29F69631EFC1785EEA2AD6BFB4C602207B5825B26C6B00276D526A0A30A44CF54752C0D65C17363AB497794BE92D123E
Proof of work
010204B3B2A53580086B9F36919CF40ABC55904729F78BF43673E216FAC1EB2451DD1E521879C6588F0CB09B150A103A39A73E2816B5ADF51F0721348BA3A66C33023B
Proof of integrity
004C6805DA206503FD16FBC58DF70264047C086B1D09A9C77363E7A7398F3D4000
Coordinator signature
38711AC1D1DA0F2D468E07CD536AC76CDAAD1AD703F87806BA4252474A31EFC03BE09D972AAACE1FDADA3E8780C87F618402A39299E62F18B3E99F1C236B3C04
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
126A031C2CD3E2DDE778D1FDA82A567C723C275B2A64B03BEF6922773847006D28935452DC7CD39FCACD57E9E49F7549221228A7E5A5049E80EA8CBF6410B600
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
A341028C49CE79C4329FE07B7B1090254026C083542E3CC11DCB2A12859208EA22975500A2DEEA54A043F2550C8550026FFED5762329A6373EA574E19CB71F02