@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700605140 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x00000BC0EBA2DBCE4455B46F5E51AFAABA6EB4C7FBA1D4E2E6DABD55DC70F9A04D6F, amount: 0.0002, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700605140 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x00000BC0EBA2DBCE4455B46F5E51AFAABA6EB4C7FBA1D4E2E6DABD55DC70F9A04D6F, amount: 0.0002, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 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) == 0x000066706D704329CA8C2A4153991E2DDACC968622CA10217CA14952EB7ABB966C30 ), timestamp: transaction.timestamp < 1700605140, content: Crypto.hash(String.to_hex(secret)) == 0x4682F899AF08DC7679AC42ECD9F263D06E866281A671B686964EB1E8AC114079 ] 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_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 1.994e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 6.0e-7, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 1.994e-4, end_time: 1700605140, secret_hash: 0x4682F899AF08DC7679AC42ECD9F263D06E866281A671B686964EB1E8AC114079, secret_hash_signature: [ r: 0x1BC72FDB33C17A54D0949BB8FF179BBA774D29119090CABDBEDFE170FB984125, s: 0x14E79AF21DB0D4FB0DB104A20248655256DA63DC2F3673AF80F844D60D7CB96B, v: 27 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
72B0929A12E77BB6466DED092AD8FBB43E7E3131B9967A73A54B523D1F00CC98ACFC0450CD7DC13E78B29A4FD0610C640F3552C72A8D0505DC44E66D
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 0000556F...785BAt 2023-11-21 20:19:43 UTCAmount 0.38536124 UCO
-
From 00000B54...A5ABAt 2023-11-21 20:19:33 UTCAmount 0.0002 00003DF6...73B4
Previous public key
000122C7358193E18431676C9453FE90C509DE379241A56D5EFB096C30D392188559
Previous signature
7FB30CA9BF3F37161117285C90C20950F294431054CD3B9BDADE4A060A29F4369152D60EAFA57119028B9816708298A8C8F5AEBBECF2B43CEFB91FFA5521FD03
Origin signature
304402205FD50851B1F6A7DE21E16135357E8A7CC301E755C73B05DD034F8BF5E81FB6C20220353DFD1AC2DFD196B45AFA54E9163F54DB6BE0C8A93859F87600104F5D0F1E7B
Proof of work
010104EB90F7BDD03D5A7FD9B61D9128D7CF24C11F3F7DA96825DA3680C2B6BCC48F1AFCE26E0A5F1A903EDAA4BC9390210A0A4F175847EC2A2BB325BB6D1CE8EC8F90
Proof of integrity
0013903F3846253E3229D004398FC051E4F234EA161C22076EE3EB78D9F7B58330
Coordinator signature
7D3F6F6AFC47FDBC0827596C83AC85BEBF6950D20CDDA1F65C54D740C0221335374BE0EBB917A3083B9140854B6F802B429E753F2130D615A8BD1F9CB3720400
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
89A65867E1E4CB6F8E4EACED16E4572A7557152CEA16D36ABAB810C963DC554907D72EFD70708F1FB1AE161A0E926DAE5144DE1F1C2EB81AE7BEADBDDF60B903
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
57B5144A90AFAC6423B925ED4C704A6C317EE279B32AEC006425DE4010ABF4BCD8C9D645C0035F11FA620B928D6B4406A1AAC7DF53D87972B854F9DA06BA630B