@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: 1698069060 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 >= 1698069060 ] 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)) == 0xACD75C5453B707F880D33321F5144488F1FDB6142E1F2E8D7773D85FB8522AF2, 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: 0x0000CB30ACA5320066B4413E9D4190EA13562F3225BB5F49A975ABD91CFFDAFED88D, 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
47051DC2A7CF94B41122F6ED5E06391573534239B3F0EFA60C2C5597CDD98935DEDB448F723972AAAC9AA495E90E7914C29FE36831F9D617E400E04D
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000F5B1...2129request_funds
[ 1698069060, 1.99, "0000cb30aca5320066b4413e9d4190ea13562f3225bb5f49a975abd91cffdafed88d", "acd75c5453b707f880d33321f5144488f1fdb6142e1f2e8d7773d85fb8522af2", "0x823244ad6e67a809de323362bb5bc1a39ff5044996a8e8811c92950095c88194", "0xf5e38d1cb06b706bfce7834482a32adf6ca0374f", 80001 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 000006C4...B45FAt 2023-10-23 11:51:53 UTCAmount 0.30315697 UCO
Previous public key
0001EA246A008AE0B9D666A63CCC5FA5F2F7DE1F44F1065FB4FA0137B5389246BCE9
Previous signature
CB44A9839B03B46E2C206C4C104926A516A9D1E05938B59883BA82D8A2D55D12C472A8065ED5891F7FF972652C4AABC8255D93364999DDEC7EB90B3B3B33340B
Origin signature
30440220075F11D8E8187123EB26058E742043A8FC08555AEE6352ABB851CF57BF0197F902201CC01D17E87F4ACBABDE32C90FB8471F1C87B23A5E602A6458B170B31507293B
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00B9BE2C6FAE871556B9F73999622F3BB3B854A7C64A4B6FC3C3D0B8BB8E7F927D
Coordinator signature
A724017D25C5EA02E621815486CB2145CBE6FD2B139A2C2BB54E6068838C00D5EE51897A7730748B3D146CCFB9210F0CE7CC562A20DDF936779ECCA56C93CD03
Validator #1 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #1 signature
F769398E4E93FB36A791BB8A26B7F5663E31F4A4F9756F896E7FEB640026985C66F9CB4FD18B0DEE86D953011BBB4517413474B867748934F2A29F862EC3F80D
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
7B07745B580284F41E078276792746620E028651EB5C09877C20217923693600AE73857EEB88FB9F1C5FC7B9A0BA50F1D50BFF1CAB3DAFEDE5E14AAC0216FB08