@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1701043440 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00008EA3709AA5C52D6B072D883E80ACFDC5BCCE22C9738C98C529DF0BF84B24778A, amount: 10 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1701043440 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00008EA3709AA5C52D6B072D883E80ACFDC5BCCE22C9738C98C529DF0BF84B24778A, 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 < 1701043440, content: Crypto.hash(String.to_hex(secret)) == 0x64735888DE39EFF7864A649491A9B5A6B59964EC23D5460C65D314E2491C124E ] 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: 1701043440, secret_hash: 0x64735888DE39EFF7864A649491A9B5A6B59964EC23D5460C65D314E2491C124E, secret_hash_signature: [ r: 0x5BF47397FF3FB741B92FD4E889B1DEAA14AB37E7454A00AC42851B37F8C11F24, s: 0x25226F896AEFF9A2B64CC3ACC294C693969256B1D24466BEFB161BCDE6F48703, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
E5EE19208A9555FD651F826C361C4E5DF61616E6B9C9EAE738BC3A121BA37E1DCDD8BDE274ABCE5B37678DB597ED5630FD2C878A4AF77BBD7F1A39F5
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 000068FA...371EAt 2023-11-26 22:04:35 UTCAmount 10.42297146 UCO
Previous public key
00013FC3B7B0325AD56D0C597AD9FBF1A78862512389753719C7022FB85B614DF1B4
Previous signature
5A04C6A645DFB9D60C3D9371AE2BEBB96D3731FA919FFD39E1545ABCBD65C895B60C69437EE9469367F4858D2093500CEBBF1386D19ED975A9AEB8EEFC715904
Origin signature
304502202A0D3546AB92E3516FBA12D3390E2FF70B2A5C6145EDB9CC1481600C9E839F0A022100F92CDDD288B0B185828A93DFA82AA6C57213B5CA7E1FF133CD4C099ECA0A13D4
Proof of work
010104EB90F7BDD03D5A7FD9B61D9128D7CF24C11F3F7DA96825DA3680C2B6BCC48F1AFCE26E0A5F1A903EDAA4BC9390210A0A4F175847EC2A2BB325BB6D1CE8EC8F90
Proof of integrity
001D7497B88415B2389E543C3CC30B1EA9BAA477B07B528BC5A6B9485FAE834D4B
Coordinator signature
5C317CF8DEB1C9C2DAC39F9D1867EFCE281A84CE464174A3360B60ACBEC12511265C72E4F8FC31DA7A2A910275A923FB27ED44DF68D52DC93EF8D9EF0AD2B701
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
0538F779EAB27E04C809A81D181A34C65115FE298A3729D888A832F51349CE750F4716B65085DFE8746E9FFF621949CAEBC15FF7B0DB9FFA2F362875B48FAD09
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
36A128FD1B23897B562BE2472F3CBA17C6A256BF556FC22AFED2CE9E5C7F08047E8C9DD70D89D6A49ECB8525EFE2D0F74D092393FD6793A8657060DD5FA3EC02