@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: 1699906200 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 46.37019029 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1699906200 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 46.37019029 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x29A6D5F70B321CFE2E4D4C15AB23C65562051F32FEC8ABF6710A4F2C5EB2AB64, 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: 0x0000BA28CE06631FF2EF4FE3DC89A34BE13C0D252F8952BBFA3173B03DBEF3C04AFD, amount: 46.23107972 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.13911057 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
FFA51B6283EAD577C5F12B0213D48AB1419FD01660022C7B9DD955837231F5524154814ABF43128EF38475222A99B8AB603B391200A297F93A6DA9A8
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000B4EA...1A33request_funds
[ 1699906200, 46.37019029, "0000ba28ce06631ff2ef4fe3dc89a34be13c0d252f8952bbfa3173b03dbef3c04afd", "29a6d5f70b321cfe2e4d4c15ab23c65562051f32fec8abf6710a4f2c5eb2ab64", "0xd10fdf553414c930fbfeb33ebe7c5d5b05793dd054e6d1d9a8d64c5817a699f3", "0xc6b1b761d8a68b15d8049351f744dd1eb06fadda", 80001 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000F3DD...1877At 2023-11-13 18:10:38 UTCAmount 0.21066537 UCO
Previous public key
0001E20F9E6F04D34EA529AE20BD70032855609389992C67F6590AA2D5FCE2DE7C26
Previous signature
256DF343C090D2726A4C9D5D78EA924B6D466619E1823A02789E5FBE647F679929EA793BDEEF81E9BB0847206AA88934B97943E2EF872C0247DAD4026F878501
Origin signature
304402201A4AD82B0EB469C5FE2ADC335281D85A3DAF7F638F364E306E5DA895E77D6C1F022025E43D282E2693FF26AADB81EC56897023B688C5FDA8536483512B6CD1B8B7C2
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00544AF30BBAC533D055EF011881FC930F42CF8CF285BB54CDA877F1C854E62D28
Coordinator signature
DD15F8C57785FEC52001340806064534503C29ECD24691843C4B4C481040C1EC003069375646DCC41C1BB44B8019C25E2FDA7E6437D5C232B386767E8C4C3E0A
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
664FA817DDFCB7F95B24919942BF8BC5982CA0C27B4014C92B52EF7D4BFC0D5E7D86F3E4215EFB4C71818B5B80B44C1EB5D8F55D6096F2012FDBF96CA049EA0D
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
ECF85D9FD902C10A633C334FF4CB29AD8AFA17C58C91E239918342F11B7832CCA1F874E5A30E069383DEBA16DDC8865B8483F02B29657C220905DC26A4679303