@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1698922620 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00001C6353CF7015A1BEB7096B1ADE63CB30508CBDF143A84818B53029BA13910199, amount: 2 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1698922620 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00001C6353CF7015A1BEB7096B1ADE63CB30508CBDF143A84818B53029BA13910199, amount: 2 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 < 1698922620, content: Crypto.hash(String.to_hex(secret)) == 0xC62B09AD5599235C73254975204ADC359ACA7C1709BBFD1E143B67F2728DD318 ] 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: 1.994 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.006 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 1.994, end_time: 1698922620, secret_hash: 0xC62B09AD5599235C73254975204ADC359ACA7C1709BBFD1E143B67F2728DD318, secret_hash_signature: [ r: 0xC6FC3B6933356A244CECA01443A43476E8F67885F125B5AA86F2A9321DE87748, s: 0x03769AA36620CEEFAFDF08AE7A533726E2C8DEA6D024D7D5BCD7276A3BCE104F, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
2AE5F58C69193B25B58809FBAC1A11D16E9F1CEA052FB4F6ABD540686827B46B76819FA8FC7257B1403FAE171E7702B56606BEEF76FCA3CE733A5E0E
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00003304...A164At 2023-11-02 08:57:20 UTCAmount 2.50552427 UCO
Previous public key
00016003E37CDCB4F3D2CECEA2F75D744166DAB4F3E1E5F2AB71B2F0F1C0E29F014C
Previous signature
8477BADC901FA79B2C866472B01BEB63B1A42EBB9DB95B7691638DF0016051BC7BF96FA9DCA6CEBFBADF80F55840A51806C63189E23208620BD83D9136A48805
Origin signature
3046022100FC0D4ADABEFB1CF13E18E67EFDEEDD81CB54652F02EBE58861F762AD9DEDA397022100D642B655C13DB94DFCCB0B833BF2CF37D77DD5DBA1E6FD5E2DD61827442D2896
Proof of work
010204B3B2A53580086B9F36919CF40ABC55904729F78BF43673E216FAC1EB2451DD1E521879C6588F0CB09B150A103A39A73E2816B5ADF51F0721348BA3A66C33023B
Proof of integrity
00391770994D93B2984735EAF8DB18080FB8393352CC79F1F4E2F95D41A0100941
Coordinator signature
717F7DBBAB0B7E46178BD82C90577D96873C61EEB6276801A1E6BFD4FB41995F982F481C07AAB0B5C55E031B3DDA533BBFBEEA007CB93BB7425B60CDAB554B03
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
0EFEF494355D5310119636CCA6D9CF85F2B4466A088DE8519A3AF6FDF7BE4E1B1C99B7DE6DF4F4142687CC0166DB21494B6640988C0370B2B130AC74312A010D
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
8B789636C25F68A2154713B17DA3FB8807ADF711925637C89F9CC2F9B246ABB1F8F138072A53EEDCFE10BCE3C617002A7FC433B192BD75C7B5EB7792C72E170F