@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: 1698310020 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 >= 1698310020 ] 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)) == 0xBFD1B4F1C8895681F23BEDC294933075D2CF19395B714261C01304432301A6BE, 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: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, 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
A2E773A78658B56C61BAE710C9B89005B2DFAFA22BF9A928483E3309AD47C3F5D4D7EC060F3F15AB07179817E69FF54EAF723EEC25675CC513F7CF0E
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00001554...2787request_funds
[ 1698310020, 9.95e-4, "00008dd40cd42287a3c8282065f5bca7259ac7014cd73109b570e946a977687c7bd0", "bfd1b4f1c8895681f23bedc294933075d2cf19395b714261c01304432301a6be", "0xc03427d23ec9dd300750dd1668e77d16e30bdde5bf514ac9d5c8a51698c608c4", "0x8d17ea22b400289a63b94f1f793b9fe2f8918967", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000BCB1...D8EFAt 2023-10-26 06:48:13 UTCAmount 0.33813959 UCO
Previous public key
0001F1B175CD7261F8B1119C2E7CF0807B614B817648FA0816323A060E64A67D8F32
Previous signature
CE2DAB637B55D0CC2BDE6805D5E139C987A033EA0EE3CB2BCC5C6C397637DB2AEDE3630B984F0ACB257E67BB3C08765751AAA0A1122F0536846DF5EF7D55BB04
Origin signature
3045022100F88782D4D1DA531730FE9E05A3EAE3BFBAE0801E90B0069EAADCDE884264C5A602207DDE049C1FD2E3A1B3EC83361DAF02416B29AAD03C1338F3059AA37BD25365E0
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00F74C3EC3EC7AE0DCE38CDACA8975993EC070BC4FE89BE6E0DB830AF500A055C4
Coordinator signature
1D1116EBF28882628B5AFD5D641BEB7B514C99311EEBE2D67F5BC1EE76BDB5D819EE4FE86732BBA047F0975E15A67E61C8C91FA7529D3573AD9B124E5D40F300
Validator #1 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #1 signature
4B1261A7378297EF53D38061F482EB53DA4B4DC8837BC5FBEDF1677A00CED1121580028234A7474A6A814C7E25AB6FE7575D83E8F8FA2F17D8D8C8441EA7EA03
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
366A64D75D9EFC7DC3F8A27EE659B731ACB4E47EAD29DC7D1B50688A2F677123353867A2AE755641772378AB402FF67A372F8DD6FB3BC08834693371BB6EAB0F