@version 1 condition triggered_by: transaction, on: set_secret_hash(_secret_hash, _secret_hash_signature, _end_time), 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 ) ] actions triggered_by: transaction, on: set_secret_hash(secret_hash, secret_hash_signature, end_time) do next_code = """ @version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: #{end_time} do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00001675BECDA24450FAD82114A15B58567979E8E7AEA1CFFC54CE8C1779513EA2AF, amount: 100 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= #{end_time} ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back the token to the user address Contract.add_uco_transfer to: 0x00001675BECDA24450FAD82114A15B58567979E8E7AEA1CFFC54CE8C1779513EA2AF, amount: 100 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 < #{end_time}, content: Crypto.hash(String.to_hex(secret)) == 0x#{secret_hash} ] 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: 99.7 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.3 Contract.set_code next_code end export fun get_htlc_data() do [ amount: 99.7, end_time: #{end_time}, secret_hash: 0x#{secret_hash}, secret_hash_signature: [ r: 0x#{secret_hash_signature.r}, s: 0x#{secret_hash_signature.s}, v: #{secret_hash_signature.v} ] ] end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
3DC0C52F5B77F6571D047F2CB5D97D7CA9624E7118563DFFDA0CA3B574DE1BB6C865DD2FFB15338E26DF3BB5E6DD12FD0982E46C69E384AD31E212E5
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000AB91...834AAt 2023-11-14 19:52:11 UTCAmount 0.35527464 UCO
Previous public key
000100E94D3D6E80793C62C4E8FBDC1C52D27E47405A3C44A6658C887A8B5CE48D0A
Previous signature
B4C040A5FC9BCE950847574520144FBDBE821701B6AFCBA62A2CB92AC829F199F2A500A6767836EC2095E033C0134B39AD76794E529B76E2B05198B92ABCC50D
Origin signature
304402200F975F325435B35412CCCAC95A0E021BB3D7A5E4F4D3689BC3C3562334377E8F02205F995DADA75038147D20878ABD6A6FEF80B5C39EC966D564D9E47A9055FB42C1
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
003304092B1F916EE1CE2A71350F63C84C47D11089F6533AA8E6CB74EAF15BC9EB
Coordinator signature
39ADB9A44CB55CA0BE3BB751D3BB7578765ADFA49431E5B0C7B84B38F9DFAAF6E163A20CEA06EFD502705320C74AF2F08E5B2FD7C55DBC9CCED2C466AE8E6307
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
63734172FB451B223CDD9B184801B7480948C4EA74CBD82DB2EA021D3512DAF83C49E2561F888E9ADF86745A7833B5840C5AFFB453C335C070E85CF0D8236604
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
10F898837B8B9B27A2A94D5F7B1F67044C26C6DDB76DE3124A456FD32D3CBEA153D1D25AE68D2FD0E2F1B2EABD56B57B6BB72405C3325A26D6208AC3BAD14505