@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: 1698685080 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 >= 1698685080 ] 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)) == 0x02C849118D1E53181A6192B442804EAD6552D1210965FC2AFFA5A98B8D30D10A, 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
4B34A839578B52935E671D15479F25EE29576BA56FC48DB76BBB122B25B56D50FA597FF1366D50BEE9CBC2FA3A14CEA14BEC762998DE622D3FF38F65
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 000096B5...0FA6request_funds
[ 1698685080, 9.95e-4, "00008dd40cd42287a3c8282065f5bca7259ac7014cd73109b570e946a977687c7bd0", "02c849118d1e53181a6192b442804ead6552d1210965fc2affa5a98b8d30d10a", "0x81aff0b98ff21cbe107558298c5b1095c62f67b3f8864f4ed3cad903123e6239", "0x43e863895059312951ebe97c77f82d6746cb57d3", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000E658...7A3BAt 2023-10-30 14:59:56 UTCAmount 0.32127263 UCO
Previous public key
0001CA93C1B8CC2569AC76AFD8A69BA3F800B82A1E28DA4B529058DE059F768FF94F
Previous signature
5FF16DF524FFC66AA689E1064FDE1543BB8D7BFF6756F651A2CEE8E4A26BE739F4B0EE158AA568ED02BF5D946E595B29F46E7DB116988269BF5F3F1986A1810C
Origin signature
3045022100E6D9C5CFDAB8827953778ED0C21D148970358846369B59728EAC34E7B803887902202691589B5CCCDFDFE9401E8546B1F4F2A4ECA7401A49E7031FD6F61B74DF6423
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00E7F1305B99AFF5FD27B46A6010D460D997DD202FD136B7BCFC0F318AD249E558
Coordinator signature
661D076AA771C82C006340B63D3FDE503E2774F960966F55FD59EA886E03977DE9BC4747D4998CDA928CD69606676673BF26BD95CC9DE1336FA5449742D54B0E
Validator #1 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #1 signature
39DE7581B797ECDC1B4B13B2EA2A8EA51A4924E81E2F1680CEE32917416AFB4BAC4A834ED08375B58AC422A241BDCCAD39D914220AD5217D7ED6D101D7948D00
Validator #2 public key
00011ED0B570D680BE5ECD58D2D121689DA73C46DCB38A01C6E10D06286040ADE30A
Validator #2 signature
855F8B2D8D9DCFEF4655A5A12CBDBFBDE8E5DAC73ACCC93A0591D840E0AC2BE43D0EF8171F771ED464143301DE82B07FF7A05F6692C1D4FB885BA98C2536D806