@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: 1701388380 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 100.495 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1701388380 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 100.495 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0xE2F7C93B3BC569F92E2AD8F0F005CBC72AD40CEABC09FEAFFB58976DF1A6F1C8, 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: 0x00008E0EC52551622C6DE09650E45EAFC50345A32CABE18A7D51D7148085A3DA08A2, amount: 100.193515 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.301485 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
2356CDA1E9A77BC662114570DFE73B3EA4A76EBF14FCE76E4AA2F2064E5ECBE5C3DB1B9E8150CCD426FFE88C66AC06CDEA86DFA07FEAB0F3FA92616F
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00004A4B...55C3request_funds
[ 1701388380, 100.495, "00008e0ec52551622c6de09650e45eafc50345a32cabe18a7d51d7148085a3da08a2", "e2f7c93b3bc569f92e2ad8f0f005cbc72ad40ceabc09feaffb58976df1a6f1c8", "0x43bee6a5145d818dd1de3b2fc8ed218d311ce0103c411af8f3663e8ceb63f4d3", "0x116af893714b58653213d855a4ae7632452d8b2d", 80001 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000ADA5...6718At 2023-11-30 21:54:00 UTCAmount 0.25579449 UCO
Previous public key
00013224A1D3CC832B31E2CD5C9169B2447C293198EF6A5FCDA45B09A2F10AC80449
Previous signature
43B02B506F3FE017C8A2F35A712C8C49B1DF16E0181A748EEBD7627749F94A9851AB1D359A51CE0DC3DB98931AAB2116420D68708C5698495784FC6305A7A108
Origin signature
3044022069E580CC95A585C1EB839A176D0BBAF4ECD75F9658A17405E0631E5D520A735A02205590AEB23328219AB543228AA592EA57645A855FEA461FE72CA4D91B77B4343C
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
009A5FAFDB43C38C4B50CFE53DD4AF4DFB43C90B2C5DB315ECBB58E49DBAE1434D
Coordinator signature
469745CE4FFB75C5DDCF41F4DEDD284012B535BE4B80A2FE005D92A031062960A71C73D82415EDABEFF22E0F692424D706EC14AC6BDECAEB22779AE870AF9F07
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
55B5C7F24C511931CE2DB015B1DA4C228B0B7483EA363B8E147BD857185CDE7949B1F577F9668D98A8D5030562C167D506F8CEC2E06395C75191F5244131300D
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
10020C50DE03EA4CB70DD1F98EDD6F5CD0DA002D1A402ECA5298580705D21C6A8DF2CFF46008CF01FA88914CD29A75C0C07E8961C60125082F5B1BE0BF087A0A