@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: 1700558640 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 >= 1700558640 ] 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)) == 0xCDD6618EA48647C610CF5B3C74B98FB7909761A31109D4424DEC024E39F010AF, 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: 0x00000BC0EBA2DBCE4455B46F5E51AFAABA6EB4C7FBA1D4E2E6DABD55DC70F9A04D6F, 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
C404021CE1E6D1D850A851A5797476A17B26491FFBDBC23A9544D3004DC80838834D68AEA429EF4925CE2100D60D727A29FB23385B9AD06975E6FEB1
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00005C43...349Erequest_funds
[ 1700558640, 9.95e-4, "00000bc0eba2dbce4455b46f5e51afaaba6eb4c7fba1d4e2e6dabd55dc70f9a04d6f", "cdd6618ea48647c610cf5b3c74b98fb7909761a31109d4424dec024e39f010af", "0x9a8a96c066c12e6cc36b2b7d0c42f59f46867bef378d933afecb1fc8ec631c0c", "0x49ae90258c397c4b8c300c418722aa348c4e916d", 97 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00007C5F...3F07At 2023-11-21 07:25:06 UTCAmount 0.23594235 UCO
Previous public key
0001F6943BA43782D809EEE8E02B0CABFF4584571E017FA925B45A900639A5BB8993
Previous signature
7420D2641A6C98D91D4856BB7FF5E025DB05CF609ADDA84A67B7233E4E6F2196B9295EB420672AC841E29D9600E371B20FDE3CB2C21BF3815E659795EA24F30C
Origin signature
304502210093F01D8A984B3CBEDEB3F883A3DF7DBBF6E83DBA519386CAD3B5E197B95CCECD02201001F71F7B1783FFD05ECD784B0DC03277BB2845C14D3E36C07E6F6C883501BF
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
0090FBB2D0BFE401BE65EB315D3CE32116ED47056BEE0FDDF6E054C66A3BAC9ED3
Coordinator signature
461A75249A4086784644F395A9FA29A43258EF7776A6788F27EF7A3E205CC4DD622F19AA7B18C0AE80FC4AF2403B6A63DF0EF52B620B9E83EA73CCFE191ED003
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
8362C56C690FB4AE5ABFB6089E27C3BD5CA89DC684341CD839F068B1A557F620E3A485DE22376CA7B0FB93B98C59A1AFA53DA0D01A7234CE2185B98D1EEF600B
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
E84C5141CEA932C030F1A283E8E06FFDF48C9811908352F9B1D6A70E101442D24234BB0C73CCCF44A7716528E955637DC9AB266F25263376E555582055AAF506