@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: 1701391980 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 2.985 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1701391980 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 2.985 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x6F9E1C9AC1441F6A4B537A6FAC0E715F08D75C9DE7DE0C6AEEA8353E2DD89CA4, 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: 0x00009D9C6D9A99C302BD029B471DA2D6FE1B54B88EA9BE44F6AAABD6D0F06CB2B00D, amount: 2.976045 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.008955 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
D36426DDBFC481F5963697E42092C37F92F82726223FBEBDA93899FDEB3500F963CB8A4A71C6AA7286D4A3F9D1FCD7D218F9E6AE2037CF85600E41C4
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00002FDA...BF42request_funds
[ 1701391980, 2.985, "00009d9c6d9a99c302bd029b471da2d6fe1b54b88ea9be44f6aaabd6d0f06cb2b00d", "6f9e1c9ac1441f6a4b537a6fac0e715f08d75c9de7de0c6aeea8353e2dd89ca4", "0xcdbe6f7332442c23d1668c482d41614584fa8e74658e15fd3362e9c862f0f234", "0x93d1a55c60df1c44f357dfb21d0b091d0eebbe2d", 80001 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000399E...C432At 2023-11-30 22:53:51 UTCAmount 0.25071775 UCO
Previous public key
0001F54CFD9004E7E49FA57B8A490544C369DFDFBA3C8D59505D80D3D12DDA54BBDA
Previous signature
B5AE23F9C2BBF8140E3D30A60C6A98A214CC7C4981228EF93A0482EDA94BCA43421A06083968E79FA0843436DA35DE25451E3286D7BCE4932D2BEC1966F44508
Origin signature
3044022021D5E47E579AD492F3E2C97FD694BF720F3C53862B4DBFDCCA5EDFB6B876F40C02206C3E5C440CD9BB3805613FBB020ED6388D747E335D2F7D7F7FB63942C82BC0FB
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
005184CD9A35C99A0D19ED99E42E801BECB150FDA60C5D4555EBD248979FAA661D
Coordinator signature
0CD841C7C4A4A7F1FE9E461995FA3CEBE37AFE48DC4AF8500C71F7C87BEAF85A1BCE714A210F14BD4B41C368FE06112568AD68AD99E538429D4D2CB025376B04
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
AD7C0315AEDFABEB32F33B3BEDFECB09BB78ED465837C2D91C03DF508537635A6556145D1D9C92F66CF8BFBA40407994DAC27C7D72B0F559138C364D3CFD9C05
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
B49E925AFEB53E0AEE915D1EFBC21B595EB207F54C0C0009AB1BCDC2DBDD3149F4047BB5600B1ACD681C88B31EC9CC3ED89B5165C566A8DD997D802744B7E004