@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1698081360 do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x0000CB30ACA5320066B4413E9D4190EA13562F3225BB5F49A975ABD91CFFDAFED88D, amount: 0.02, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1698081360 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_token_transfer to: 0x0000CB30ACA5320066B4413E9D4190EA13562F3225BB5F49A975ABD91CFFDAFED88D, amount: 0.02, 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 < 1698081360, content: Crypto.hash(String.to_hex(secret)) == 0xC321C2293E7F68F838AFC21E563858613BE8491D0C330734F466B2821165B47D ] 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: 0.01994, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 6.0e-5, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 0.01994, end_time: 1698081360, secret_hash: 0xC321C2293E7F68F838AFC21E563858613BE8491D0C330734F466B2821165B47D, secret_hash_signature: [ r: 0xECAACA4497955A5630CAD4927CA680C37AF7C825EAB41808216842BCB08D73FB, s: 0x759B7673AF4811C5998690047F3355A70B9E5D8D97AC93E5644B987B2819B90F, v: 28 ] ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
62DB17F0B829D041E2C22DD802D8EBC003D7F523E69FB17A8CC3F45A22E6575947AFF40D13B48C88C112BB78741477D7B6624FA48620A0112F845598
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 00008D37...C42CAt 2023-10-23 15:16:39 UTCAmount 0.62076135 UCO
-
From 00000952...EB9AAt 2023-10-23 15:16:24 UTCAmount 0.02 00003DF6...73B4
Previous public key
0001ADED3372E3B75A206395895AC7F648A505AB988B14076CC38431FA05344B73D8
Previous signature
5E4A929F16E7B6E3DC93D5B697EC8B1497F9347D11D54C293F2F307612E4B0114113A8054A19AE97EC122B56F812909ED14E62F35EE4243DCD8547AC1E343D0C
Origin signature
3046022100CDA80D991F12068DE4E97940EAD28EF9D4DAFE70CC30BA843505AC929CBFDFA0022100B0B891F69EDD43046842C73D3BC31B66E29FC7AC35660E2BF5D6099ED947BE33
Proof of work
010104EB90F7BDD03D5A7FD9B61D9128D7CF24C11F3F7DA96825DA3680C2B6BCC48F1AFCE26E0A5F1A903EDAA4BC9390210A0A4F175847EC2A2BB325BB6D1CE8EC8F90
Proof of integrity
00286698005D7E41CA9D6AC586FB33C054501BC27149CA35A3A6DB952A90BB800D
Coordinator signature
EA678B078128046AD62EB47BAB27F28EE5AD134AA8EB20BD26A8C6706372E83109750C65A296B94A3748B6C7E58431F5689A12BAD7652665AA4048B682A90D00
Validator #1 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #1 signature
B71877E39C16270BD509037ED17F0406AF793CE09E983A6FF5519CB5D8955AE33FA18F3CA9748D07AD11AA0FC79A2BC1AFC9A445742C5DBD90B10642FBF1C003
Validator #2 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #2 signature
F31BFFB51B0506CA6DEBCF425A412A2B2FBDF528464BC6FD1B190E84DFFD4605BDF75E2ECDA1E8ECA42CEA9555CB6D0449C48863DBECCE8EC9A1120DE8CC7F04