@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700074200 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x00000BC0EBA2DBCE4455B46F5E51AFAABA6EB4C7FBA1D4E2E6DABD55DC70F9A04D6F, amount: 0.001, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700074200 ] 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.001, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 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) == 0x0000072E418B60C6DABD272BC2728B17B352B8104F068D11365D50134F96A4199609 ), timestamp: transaction.timestamp < 1700074200, content: Crypto.hash(String.to_hex(secret)) == 0x4DA8195ED055068BDB862285E6C7F369AF72E7AD1B58F1291CD57F54ED628B70 ] 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: 9.97e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 3.0e-6, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 9.97e-4, end_time: 1700074200, secret_hash: 0x4DA8195ED055068BDB862285E6C7F369AF72E7AD1B58F1291CD57F54ED628B70, secret_hash_signature: [ r: 0x3869CB60AF5E45E76CCD36067D452310D049BD334BDCB255F9609BE510FF90AD, s: 0x0B74A124694F8CCEE358D54BC3B809C50D29B973D3D9767276DF168A54BF5F42, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
683E1AD0D1DF3E94C7661ED17D43F677002E078E398ECB1B567852BC557F9B1DDDC89B63AD9D9769F502DDF8B9091F982F5DA4DF657738190DA4C422
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 0000AB65...8D01At 2023-11-15 16:50:40 UTCAmount 0.34221852 UCO
-
From 0000C576...89ABAt 2023-11-15 16:50:31 UTCAmount 0.001 00001A4A...01F1
Previous public key
0001FCB3D857CA49F49CACF884D37C19F9B57EC00CC4D0D8CD84AD67D35619FCEA9F
Previous signature
F654BC3042784EAD2BFE0BCFFE20B49B1220DEFB4680CD4F6CB99661A6BF97E824468B5C9CB3AE5BAEF665EBA3A994E07814AE6A9C1D1F76A83BA54AEB297903
Origin signature
30460221008E83255F73FD8CC22FBF41DBBA28A443457138726C9ACEB6CA259AD6D3EA42CE022100FA6159079D7FED11126E08D8272892DA40B8BD5E66298DA8476D5AE65D75E0F9
Proof of work
010204892A04DBE05192BCB662689E7E19700F3F7202028EF0A9F20635C4948436ED85A43BA3017281EE97781342DD8F24ED6F583B5FE542830FDB5191A11843A72A61
Proof of integrity
00C778834900FB713912E5F349E86C6015B33E49B630434EC05EEF1B6C417987B1
Coordinator signature
9FDBDD600EE22C363A3CD9CC7EA4187918E6BDF086F45461B9E1F1600664C30282358650BB66BB1194EE2B099A8F6DC77968557E7A7FE28DEC4462999A2FA307
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
31F6A19D93A49C99ACC07B68385453E969AC3BBE0943DA865FCE19EDDD89671D270BD865C33C9957B4A6968C893B1868B62EB38563969F3168E4CB50C4BECE0D
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
47BA31E470F7C2C5CBCFBA4511FE3683FA40E2A8E837BA6838AF2B72CAF7B40FA2F541CC74C79EB0C9A248D5448201A4DCBD8176CC8938DC81DFEB1179DC6B0B