@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: 1700069640 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 49.75 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700069640 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 49.75 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x5BE70B15BBBFA7F2DA54CD490127568E32D3793FEE90C52288114C0B5F328FDB, 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: 0x000004BE34D15FF077A60B1FCE897083D215A3C392BF49CFF15030A774FA8FDEEBD4, amount: 49.60075 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.14925 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
D8730429C738948913CDD1D60FCC95608C4832CADC29FDFB886E8213E820F114EA22BE57CA6554A8653632CB48A5727BB6D388A49DA48AE7CA9F0DA7
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000B322...7EB9request_funds
[ 1700069640, 49.75, "000004be34d15ff077a60b1fce897083d215a3c392bf49cff15030a774fa8fdeebd4", "5be70b15bbbfa7f2da54cd490127568e32d3793fee90c52288114c0b5f328fdb", "0x19dac2bcbc7c9f0687cc5b2324b4ac59571c51920e50b4b3e2909e7105543f1f", "0xa10f2dc20351c36e080fc53666827ffcc6d2b27d", 80001 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000B830...B2ACAt 2023-11-15 15:35:27 UTCAmount 0.21361431 UCO
Previous public key
000182B5BD5759CE3008A3339736196AD150572CB3CC657BD075D11C87B58878E612
Previous signature
EE268A9935B3550C7E446112F9D1C6683466C9FEAB0D33457620376930D6E897DCA2DD9D6F3B8E04154371E540E1B200065A2CFFE1C96930AC3E63A981C2DF02
Origin signature
304402202F0178953C70DA1DF4EE0FE0B7F8AA63C72AE330BB8C736987F3286CB78F59B80220321367CD0B16E5FDC69A7BF1F1DB868B8C185467E98F1F659AF78298795CE8A6
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00B51F874B76D6DBD596A8D795A3A2841906BCAD664E664EA4E27C64557189AD0D
Coordinator signature
0694F30810913FFB6EF59FE302C14BF9AC09FD2DB3A819394DDAA02251A97DA7170FDB836BB59C24E5E5FF91696B17A54E7B10B16463A8DCF02CD6A91323740A
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
FE10894C004934176A04BC8451F138D1FC03BB6BBA5504409F5E390A0BCC610572C0E6C9CE2F487A1B6B343EA39655E87EB460D48BC7B26BF9A58225D6AA570F
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
5A4DBD2215754113C9EF4678606249051E5AE3555D58E9C09B6D136BB8028F24A55520E6D1C096188D18A1885F4A5379139222585AF8F40A8DCE0C3AE5D4870C