@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: 1701362040 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 148.80225 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1701362040 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 148.80225 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0xB21725CA727227FC39F2710AE4D41EABB6A5222C207F135A5EEFACEBF449DA98, 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: 0x000052DBB0394202F5E1A0290DC1595870AC160515BE80781452FCB0A205644F801B, amount: 148.35584325 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.44640675 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
3F630C2E008F3B859472E73AFA9A7A998BDBC61B85B828B739BC4BDB391977DED2E9E314009492DAAA7539CF3B41BEF7E8BDD8C0AFA4F937BA8ED557
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000B935...6FA7request_funds
[ 1701362040, 148.80225, "000052dbb0394202f5e1a0290dc1595870ac160515be80781452fcb0a205644f801b", "b21725ca727227fc39f2710ae4d41eabb6a5222c207f135a5eefacebf449da98", "0x30c75cd8e660cee171de29e3143790f9e77c60729d63adfac35f3df99801e2d4", "0xecfac0ec6522cc5fee51aba58881ad11a3f9794f", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 000086BE...F1EFAt 2023-11-30 14:35:46 UTCAmount 0.25771974 UCO
Previous public key
000101F0F2FC82A686EFCBDECECFC93C61A562FA28B1AA0C49FAB1C71F50581BC9DB
Previous signature
BDE3185EE03F423251CFEEA2B319FE7140046014369D3B688F912B090DBB90797F65FB46A06A2636A881711CFC3725858FEB36EE52284E81630231618600C801
Origin signature
304502210084CA13E5424E5A3519E2094C0DA61915378EC90D5C675BAA417B66C852D64D16022020BAD99000A7B579245AF07BDCFC48E46E9576C9AE42F3540172177A1F142C8B
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
0089411B30E3059538DB18E9ACA18E39F2DF28CAA55253A74B01F4BEBAD02FD9EB
Coordinator signature
E2CAD064C0EA98583915C76B06FA2DBE143A67E70549C5130AF6446F158FEABE2AF9F465404681F0CDEFF3994118F39105C8C1D7B9FD2C1272714E122F010805
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
1B8F78C5047BF7E85B394EA114DDA9D6CA5FFC30C0A6C7C979C4B45663F18B21BEF49FF62B6F4F24939E9451B0FFE1E567C5F8B8424647FB917765C9A30E680C
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
12832910126C92446421BC4A137B232CBD9CC5AB4301E641D32F726A04FE3C689270459DF5E7A8540BE3A578A6E1516CA478B496A0E9802578BD2B2E513EE005