@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700048340 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000F74EE60CE89C9227127F41A4DCD1946F11721BF74D07C812591D48611D3601F7, amount: 100 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700048340 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000F74EE60CE89C9227127F41A4DCD1946F11721BF74D07C812591D48611D3601F7, amount: 100 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 < 1700048340, content: Crypto.hash(String.to_hex(secret)) == 0xA19F4B3B7E3577F3B325CCEC62B5C8E79DA18ED06163338A120105D3EEE14379 ] 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: 99.7 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.3 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 99.7, end_time: 1700048340, secret_hash: 0xA19F4B3B7E3577F3B325CCEC62B5C8E79DA18ED06163338A120105D3EEE14379, secret_hash_signature: [ r: 0x455A265BE380EA6C6108E47A4ADBC469FBB03D513A6D99C99C1E607121FBBC13, s: 0x6F20D6B3294E01AA48AE9DFBEAA1994E16D046061C0B0D5E443312B15D7E593C, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
C2F2BCB3C234BF49C8124059C252CAED3DE870CEFBEA3DFA5771B4D20E2B9A1885B09BEAF4E20B2B0819B7E2F78A707C16630453D1CC302E46FEE508
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000ECDD...1A71At 2023-11-15 09:39:52 UTCAmount 100.35464107 UCO
Previous public key
0001DE21152A8FE3D9E23AFA9D94CC7E8679ADC60FAA795741094865A1F3C8156720
Previous signature
B29B29D36E49CF193387BF3EB21295C70D857A9507FAB022770C481227BC9C463CC5EFCB67E4626EE33C472CA05F840A89238A0AFDAA4D74690F63B28837CB09
Origin signature
3046022100F41A03D763608376FCCC902D60C2DAC72FA6F27877A5AE648A1B29C6C06BFF400221009238AA2756341DB5351422805CCA5F9E33407AD538A4E6C0A88CD1E69F986080
Proof of work
010204D6052E0C6CA9244CDE5F3D664296BDFBA0090B330404C3C16B098758F27965DFEC0D3F25D1365F389C2B6C516195552F8779DEE0796C8C33F1A9C0404F4E3381
Proof of integrity
00345D7F92E4810F0813845933B1BBFF95C9D7A4B9F34F64C0283D155D542DF327
Coordinator signature
778B82A6C2E606BF9066F682557F2A8D7D161BFCB8294917BED0E7612A0E0586B2F7074F1D5EEAFC1002B85E588FC7F8FFAA9674485199E28C3EA66C01526F0B
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
B92A7274D0C8BD18F55A376C740326394887CE42EB5C9FCBA73C95B59AF2B2C8D87F62D5557C640B43240A3A13BBA6CB73E0D5AC6A5FAFA87442467A974C1109
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
B8434F07EEEF91EE6CFF84D347DB8DC327AC67C48FA40616DD5AE65CD329E23F75A5AEC09747F238422B4DD9273350C99473CCD27D1C1DF13DC6656CE3BFA207