@version 1 condition triggered_by: transaction, on: provision(_evm_contract, _endpoints, _signature, _evm_pool), 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) == 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D ) ] actions triggered_by: transaction, on: provision(evm_contract, endpoints, signature, evm_pool) do endpoints = Json.to_string(endpoints) Contract.set_code """ @version 1 condition triggered_by: transaction, on: refund(), as: [ content: ( 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) evm_responses = query_evm_apis(#{endpoints}, "POST", headers, body) for res in evm_responses do if !valid? && 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) # Refund status is 2 valid? = List.at(decoded_abi, 0) == 2 end end end valid? ) ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D, amount: 6374.08037365 Contract.set_code \""" @version 1 export fun info() do [ evm_contract: #{evm_contract}, evm_pool: #{evm_pool}, ae_pool: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D, status: 2 # REFUNDED ] end \""" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0xEB2B47C477F4CC2FD0D4807FBAFB489F5ED31C1C2C57FE39EBB53A18E1A41B87, 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) responses = query_evm_apis(#{endpoints}, "POST", headers, body) for res in responses do if !valid? && 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 end valid? ) ] actions triggered_by: transaction, on: reveal_secret(secret) do Contract.set_type "transfer" Contract.add_uco_transfer to: 0x0000ED839B2DC57CA10043AD7C9BBC518BA47ED6CBDEB226844A060232474BAC262C, amount: 6374.08037365 Contract.set_code \""" @version 1 export fun info() do [ evm_contract: #{evm_contract}, evm_pool: #{evm_pool}, ae_pool: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D, status: 1 # WITHDRAWN ] end \""" end fun query_evm_apis(endpoints, method, headers, body) do requests = [] for endpoint in endpoints do requests = List.append(requests, url: endpoint, method: method, headers: headers, body: body) end Http.request_many(requests, false) end export fun get_provision_signature() do [ r: 0x#{signature.r}, s: 0x#{signature.s}, v: #{signature.v} ] end export fun info() do [ evm_contract: #{evm_contract}, evm_pool: #{evm_pool}, ae_pool: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D, status: 0 # PENDING ] end """ end export fun info() do [ ae_pool: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D, status: 0 # PENDING ] end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
AC96CCF11BF237E93143A800BF0A0DF9F55D7CCF8033DAD4D9F644677A95D49721AC0AC7EE2C73AE4BB4F3030E38EE40133AAC328DEFBB77FA9AD0C7
Authorized keys
- 000122A6CD9ED07E46835D6E88E5BD0BEE84C3F5E5DBF8E916AD9B2EC912C44AFEC2
-
Resolved 00002075...AF5Drequest_funds
[ 1731153360, 6374.08037365, "0000ed839b2dc57ca10043ad7c9bbc518ba47ed6cbdeb226844a060232474bac262c", "eb2b47c477f4cc2fd0d4807fbafb489f5ed31c1c2c57fe39ebb53a18e1a41b87", "0xbd7f0e919242184596a6fea51401f61e75ae79e145fb1e2a6ee8da6f9131088b", "0xB0e91BE1c5586C7348E692886cc8bd0058499eBB", 56 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00003F26...8B34At 2024-11-09 09:57:38 UTCAmount 0.79168238 UCO
Previous public key
00017F6C9327C3221E13DC85C9913619F7AE014D4A0227CD7DB7821F15659F8F6761
Previous signature
5093EB22A63DCC65E051C6C6843D707A4803378C7B71CCE7EC07B3C1C4BA02481ECB8F7B50A2BD842FBB777B5D2B07AA8A51964A243F95A14F03385F5BE7B70D
Origin signature
30440220452B389679EEFA5210D7E9C1CF5F7E4AC1A62B05448FFCB811DFFCF21D6CF0CD02202C89458858AE6628584686A1C188F55A8B29BDCE5198EB7BEC90DCB845583DFC
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
000BB5351451220DC4BB47211C8271CE041ECA1569647F0E643A032C9730356D64
Coordinator signature
0E85F52C76C7389760948A262DEB8296070EB02EFDE99ABC8B9E804E08EB278875E3A76B573F929633574938B78A5F5CF640A097F17BF53C36B1D9748F6E2904
Validator #1 public key
00018106B590A190EC5E85CF8FB99F7967CB4D24FFB1FD5A903BF101E9D668C2ABB1
Validator #1 signature
C93617E09157389A9A07061099163CD65ACF386C44522B45FB622FA7A2CEB603383C79D0138C00F6BEE4DB58FA5AF315EA3EC32C17E60EA1BFC853E1B2323D0C
Validator #2 public key
00018A13A9C85FE66CE097EE273C6F1E612289BFB0B630C34AF60957E8DE880633E2
Validator #2 signature
AFE9B09F303DFBB63C100F89C9898BA9DE10B24422F5EF43BFCCB15FB341BB8D3B60AF53BE077C790098C7B5D68F78C5945B36DF66498D9B2C78BB9C68A78C02