@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: 1700828640 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 99.2015 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700828640 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 99.2015 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0xE1AD41699B3814D0CC03C70F8E0255C72A4D96230D4637FF36554AB18E6C3A27, 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: 0x0000D9E7B4300CC29670CA80010FE23292BEE4AE28057328732A0FF4CF11C319D81A, amount: 98.9038955 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.2976045 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
71B80288389CB4913E847E01175A4D3C4236D77C1B0DA2A113F24EC6041F40FB31469096BE9D4CACC3A298804B67D617747FEF9438BDB9221F34B21F
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00003B8D...70EErequest_funds
[ 1700828640, 99.2015, "0000d9e7b4300cc29670ca80010fe23292bee4ae28057328732a0ff4cf11c319d81a", "e1ad41699b3814d0cc03c70f8e0255c72a4d96230d4637ff36554ab18e6c3a27", "0x540284fc7c7a81ee51d3eb9837e5f42b78706b77aa1e47f4741cf0c90525ccdf", "0x34b50f24ce04f6c834a23eb9be40befd52a28082", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000BDE1...49D9At 2023-11-24 10:25:10 UTCAmount 0.23596419 UCO
Previous public key
0001689D4F523FE96F6EBF9A73E99AEE8028225D8F5123E0B8FB808B2B4211080E53
Previous signature
ED886AFEC48B196D1C57A63A18D1B653810DB3C338B685C9F877097F215018E00CDF3DE45C93A36DA8F1398E3BE15D132437863C5789A151D8AA56CC77D7DE01
Origin signature
304402200BB4E63CA012C7B11ADAC61F1B3E7758056AE94F39DD354925326FCA83596327022023834EDCDB3FEA8B8951F2F8B2110A6733C69CAD884316C325D1AE2113F8358D
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00EEE83A03C70B59B042A71707AABC88F02BA9947769383E582B0A843931DF408F
Coordinator signature
CA6F2A235A0A331D2DBB3E47420B02CD746065B04C994F68D982EC8E537F5658AC0A7B39AC4D0FE9CE8DB3AEA95BBE390608A9C6C0345F4BF775185BFF435B0C
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
7260030515F9FAA39F18BFD260AAF9F5C0AF0AFAF5C38DCB7B977CE3642767511B177B889EE36854D98BADF0C8199F0499902E2EC15009EB91EF40CA5A49D503
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
F57CC050A55973F6A9516528D49931D78FC488A6376F17B80E16DCA75EB166EA9F08164026EFC308A66276F1AA33CEFAC66938A8B93690CFF1710401FE67DC06