@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700071920 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00009E3423F132E4B11DF35B68D4FE14BE9169D828AEC8EA8EDE71F5BDB1A5D64FDF, amount: 50 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700071920 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00009E3423F132E4B11DF35B68D4FE14BE9169D828AEC8EA8EDE71F5BDB1A5D64FDF, 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 < 1700071920, content: Crypto.hash(String.to_hex(secret)) == 0x70EA219AA4D8B08F6C1D97C5104B76D66F02F6BCC28D31114D0BBF4D8413403F ] 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: 1700071920, secret_hash: 0x70EA219AA4D8B08F6C1D97C5104B76D66F02F6BCC28D31114D0BBF4D8413403F, secret_hash_signature: [ r: 0x710A2509A0333E6AB16BCACD32D80E3FAEE3EF488D6A033B1972316014A6F313, s: 0x5897FBF83F99EEC59306A8898794B5DDB02DA48F9048BAF43489DDFD5D5AE7F2, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
0BE608C52A3554C5E7321F74B38A55D088BF7C318CAAB8710DA74870B14ECCBE3A3B10DEB674E970A6B4B6AE6D057106FBB3C194D6B7D29577066EC0
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00000F34...32D5At 2023-11-15 16:12:57 UTCAmount 50.35066848 UCO
Previous public key
000107AEFFED12586CA36747BD0194A561F9B45276C69B6E7C963BF73996D9644B13
Previous signature
F24F3A2F3AFC9D5386701DD3BE86EEBD642C76FC1138E52E0218D30F7C0D7E4EE2943CA38DF591594E437884CBBB27FBD8C3759D7CF86AD06D0986B314A1DD02
Origin signature
3046022100E564C92DB845698418DA108B71201C44B166AE54C5262D9F861FC6D514FD33BA0221008B5ADAEBA651AADC51E6E3B2BAC2B895C0F11EF9C81341340FB5DF38E28553AF
Proof of work
010204892A04DBE05192BCB662689E7E19700F3F7202028EF0A9F20635C4948436ED85A43BA3017281EE97781342DD8F24ED6F583B5FE542830FDB5191A11843A72A61
Proof of integrity
00B08CE03694C464CFEEE78EA0730775185D0C620CB4267636F4D5FD6D9C96E6CA
Coordinator signature
AAFF14D4791DBCA00B1A9EC65E199C652F656B27BB5989C6E743DDC0B539143B6BC93A12870D74A9DED833B2D080E72B7EB6904CDCAD2DB813EF10894DFC210F
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
BF98A288DD2EFB9E06538DA4DE3339038AC65D49CFC378637E26D667753A9379D92A11D96A50B829EA67AA6466E5D14B16EC06BE34F09BAC9C94FE54A8ECB505
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
D7228FE339EFD5F054A72044AB88059BFE1A4A98EA2528E68FE726E5DD8AD67002565D4D9C46B617CB350D36F76757DA77C176EB7A882685767FE9F899703600