@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1698422340 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 >= 1698422340 ] 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)) == 0xBAF9FDA9635E60827A220608251EA8932682B5A04AF9EF29C42C5EF3A318AE33, address: ( valid? = false abi_data = Evm.abi_encode("status()") tx = [to: "0x7567aa539ca05f14e1e5a10b5ed1f4ad96af49e9", 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("https://sepolia.infura.io/v3/3a7a2dbdbec046a4961550ddf8c7d78a", "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
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
D1ADE44AE0EB7626CE6575ED6D51AC7BA182C3DF0400ADAB40B766C30575626C31608F57879D68408ED86571AB5FD67C3A2F1944F6C2E061704E9A69
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00008041...4354At 2023-10-27 14:21:48 UTCAmount 0.36752111 UCO
Previous public key
000164547EE413B5A0EFBCCF1B3B3D917125312C8F0F13F64EB705B7250385EA8371
Previous signature
C82A82239CADC97BFC8743E92F051EAEA032E0910B4F0F560EA906A7D5E1A138834E39AD236FE01772F0FA0443BDDD93A31DAF0CE9CEC058101DCF3C0DFEB30C
Origin signature
3046022100F4101E20C99701E264990B5F167C7C426DCCBFCE04F5C414794E5812C8ADEA2F0221009390AFB52F163793114AF6E4F4BF9CDD9F148BC83A851CA1FAFD068D424C10B3
Proof of work
010104AB672F1E69B064D192819F1797C1926F158DBA8F3924AC732B4C4D70D0C8EA0A0D6506E5896C9C2524D2BE26CB5016287E1816A597C408008BA36FCB154A7765
Proof of integrity
005FDFA6654ECBA0919C457215C7D330FC732BB2E5B255F8B236A199747EDD19A4
Coordinator signature
341FEFB0A1ACDDA26B944AC26C1A21756B4BB5B922B8B551A281EDA880C282D38F1AAFB141A03676ED2F9F59EFE44E06B5C37152157966063B2937301D8B6D08
Validator #1 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #1 signature
5E57DE482EF73F745C4DD08B1CD49FE82B7B8A75F81A86695A3DA6F2D8F2C57B3C27FD48A167083142FCC056C5956B3971844FD120335FA2C3ADF6D971C64D04
Validator #2 public key
00011ED0B570D680BE5ECD58D2D121689DA73C46DCB38A01C6E10D06286040ADE30A
Validator #2 signature
DBBBF5A46E9C395A2E821B71729C99A241BC182DD0C3F8E06163E250E90680A1A04DE18AB887ADACBEE9FF9B740A1C0C409D76A0F891BC9CBA13A099CA957806