@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: 1698348720 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 9.95e-4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1698348720 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 9.95e-4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x00644C37E6BCA70A74805605E171FB13510C7740ADA88CEEDC6DAA856E30935D, 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: 9.9202e-4 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.98e-6 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
DF0944B0EEAE10BD3AAFAD456C498F69F5C3030C370DFA57B290628FD5494B5B15CEF56BCFF7C5BEF1FA61D4C53872ABF1E9C74A91378FB48968E19B
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 000083B4...FD5Erequest_funds
[ 1698348720, 9.95e-4, "00008dd40cd42287a3c8282065f5bca7259ac7014cd73109b570e946a977687c7bd0", "00644c37e6bca70a74805605e171fb13510c7740ada88ceedc6daa856e30935d", "0xc452e704459c425c9a93317d4f29eab69dc3ce0125f60d958b072ddf9951f4a4", "0x1e5f1a65a15fa2f6db8ef58f8631fa9f5d3424e9", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00001970...4270At 2023-10-26 17:33:07 UTCAmount 0.33584555 UCO
Previous public key
000168AE2C9209C04F905CA7E724A852AF9CF833C2DD70CFCB7EE9F5E77C0104C747
Previous signature
E573564C8B648018AC9C2F7476ADF4DE5749525C94F8EDA84416ED9C64371072F833DA5B30CC2AB46DD622D01316BC52A6CA1C20EF7CB2E425816F08D27F1604
Origin signature
3045022100FBDCF3ACB699CD66C8E30D1224BEA49B3B2C76B4A3EB275E0DC21DE4CDCE257202205245B27535A8E3AF980C9E033C3EC01842751B39917DFFCF6618CC5B096BBDB7
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00E701BB7CA792F3BBEC828A116DC756004183DBCFBC67F87F80F0C4BDE0578CDB
Coordinator signature
68B22660B01A394B3F9783C1D7EE87304A08D42353E1134DCC61445C4AC9688DC83859473C5F9A34406CEEA885126B03AFC14D4FEAE02733BCDAC293F323AA0E
Validator #1 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #1 signature
B8939348E07BCBA24DA9E3F6415F62292B5BB0DC0305790261B0DEF4DA19D8D1132A30038FA1A45D4D44735833A82AB2404E574A7804B192F7D53C279DBD0901
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
A5A61FCD478740CAD6FC9DAE92930A0363BBC8EF799265FAB27F9FE988A5B8750BB8B79E559EA2B087705901F396E2C0DC8D42D6A8912D849738CB3EC21C8D02