@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1699991820 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000BA28CE06631FF2EF4FE3DC89A34BE13C0D252F8952BBFA3173B03DBEF3C04AFD, amount: 20 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1699991820 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x0000BA28CE06631FF2EF4FE3DC89A34BE13C0D252F8952BBFA3173B03DBEF3C04AFD, amount: 20 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 < 1699991820, content: Crypto.hash(String.to_hex(secret)) == 0xF96B7EA6E93942E6CAE8667868D56E34E0BA7B81F5221078BEE79A0674011BE9 ] 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: 19.94 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.06 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 19.94, end_time: 1699991820, secret_hash: 0xF96B7EA6E93942E6CAE8667868D56E34E0BA7B81F5221078BEE79A0674011BE9, secret_hash_signature: [ r: 0x3C29CBDAE8538ED975C23D06B5F66CA8C93CB8F0B676ED222EB1223E1CA46C68, s: 0x04EFDA2A7B90241C17683EFAF1A8F8602A677932DA6F8B3E472F7F0FE1C23EED, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
3071BA554F2322286A9FDE2DCFFBE7AAFB512D3B8931FB6C68EA84FB257E55A293415C9ABC52C0CA41D0804BB381D29E430ED226EB964B8EEB94C004
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000FFBC...77C9At 2023-11-14 17:57:15 UTCAmount 20.3484084 UCO
Previous public key
0001A52BF4DACE7754B3B8F7C7CA351B82166842FA4B523CDA4236A9D4DD514D06DE
Previous signature
E454FB0978D50C9E7BEDB8A4D3207C377BCB3587836F45DB326DDB737FF1EA07C53B060397D741F4F0C39D6EFCF6AA3989B8B4DFEF57A3AB2DC6591EF2F92B0D
Origin signature
304402206ABD064440D178EDFF499BC8087407195488A6E6EFB121CC0E13FA2983493A9C02206CB53170F1F6A704B516FB0CF77E96DA4F4C64A4ED4A5CB39A5C1715F3A94F58
Proof of work
0101046C39D56B717142B6EE14B0F8B2561ECA458F3D2D12C9977D613F78829419063211F9C21F7BB0D56B6523040A8156BE22B6E9D6332B88ED882574D12AE32F7A45
Proof of integrity
00A2A86F69775F579B223E32E454EA8FF87FD78B4922FECAE17C14E7ADCD52320D
Coordinator signature
4A7EBF3159E64A076AB3ECDD1F4D47451AA4AA30DB0FFC71A19F5B24443D965A992A449ADDE14E52CF4EBE81B1C0274188167C6959607C7E338C0B19FD793F0B
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
28B65479058DFE58A4D4AC76A178D37B2D213A0F8FAB1F77CD358416C50F9C0EB0780AA93D1D84D8A36C58DAFD3F9F63AA4B5EB6A6B96C3C1A022E7017905603
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
2F9E900A264FBC638D53A2808273275C39C702D75F8D308CEEDE8940479E708FC0249ECCE6F70D6AE57C5CCE9E2EABD8445A653B7C2872C6534985A780116C05