@version 1 condition triggered_by: transaction, on: provision(_evm_contract, _url), 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: provision(evm_contract, url) do next_code = """ @version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1698692160 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 1.99 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1698692160 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 1.99 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x69B292E0B262BC15E6D03494B97436E133B50EC7339F95EC73BE38AC29110B94, address: ( valid? = false abi_data = Evm.abi_encode("status()") tx = [to: "#{evm_contract}", data: "0x\#{abi_data}"] request = [jsonrpc: "2.0", id: "1", method: "eth_call", params: [tx, "latest"]] headers = ["Content-Type": "application/json"] body = Json.to_string(request) res = Http.request("#{url}", "POST", headers, body) if res.status == 200 && Json.is_valid?(res.body) do response = Json.parse(res.body) result = Map.get(response, "result") if result != nil do decoded_abi = Evm.abi_decode("(uint)", result) # Withdrawn status is 1 valid? = List.at(decoded_abi, 0) == 1 end end valid? ) ] actions triggered_by: transaction, on: reveal_secret(secret) do Contract.set_type "transfer" Contract.add_uco_transfer to: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, amount: 1.98403 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.00597 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
8C1EE0489B899848AA36D6421D4CE13F58C2117FD54736D92AE7FCD7BD8F74DB32B4D586D88A00504EEEE41F84522B6615CD34E47E55B7C3EA4C30FA
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00001D63...943Frequest_funds
[ 1698692160, 1.99, "00008dd40cd42287a3c8282065f5bca7259ac7014cd73109b570e946a977687c7bd0", "69b292e0b262bc15e6d03494b97436e133b50ec7339f95ec73be38ac29110b94", "0x1b2ef733f66f2f78501b8a4497d1763ed2642f9f19f91425636e917546bb8705", "0xb481dec0e708a67f3c335fee8e2c65b3c402cb4e", 80001 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 000057D7...9391At 2023-10-30 17:09:36 UTCAmount 0.32675608 UCO
Previous public key
000181FF882AEC009E0443F71ACE5FE867E81BC7C4ADB0F9022B7ACFD6B08504C383
Previous signature
89E22B182D9A2E9AB40E1162346E9C24F7EE1AF2F0F6E1C44B67A157509F59FA3E924D00666532A2709C5B98EAE6470052E2A1F9237106FBA49F3136B7720703
Origin signature
304402206BF03D160D199FC6D2B8B4F4A0A0ED8C47B98EB6A5C1D4D7D889DFC130E654A9022075DB410DDDCDE4782C2FB45811F16F0D8FA1670B40E547B12F96E1B48B768511
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
0015AE4DE0CCCA11F0B6B0ABBE6D2057B184706E0649A12337F55C4E097AC12277
Coordinator signature
787D06E3701BEC1EC0BB476A1BC5392F1A853A8468D5F638C6EF855B146B8222CF378620061DB341E36E695B597F109995253678E727E83CCB8CAF61B31A6407
Validator #1 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #1 signature
0F2A978C94E9A297942A502EFB40B1773783FF25BC77D3D07A916F683B5880D1953FDDA5C0DD7590C83076A64EA8BD5FF5988173034A3AE880A1233974719106
Validator #2 public key
00011ED0B570D680BE5ECD58D2D121689DA73C46DCB38A01C6E10D06286040ADE30A
Validator #2 signature
E5ECC26582BAE839B7041BBDEE04A14DBF36CF425B514D7E79906AF3F4BB6C6C3A71ABB6AC40E37B42360F88E95C66F64250BABF8BB1D404F79F4629E7AC5E0C