@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) == 0x000066706D704329CA8C2A4153991E2DDACC968622CA10217CA14952EB7ABB966C30 ) ] 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: 1700708460 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.00995, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700708460 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.00995, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x9BD63C494DB2810DD5A1991ECB9E2074DCA1628F4CC92ADEF13E52998EF87AAD, 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_token_transfer to: 0x00001675BECDA24450FAD82114A15B58567979E8E7AEA1CFFC54CE8C1779513EA2AF, amount: 0.00992015, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.985e-5, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
76A7A0DF090AF90369F910FE67CA5203A007E3E90474B86FC441B875CAF6A62D60676FA2553497338510B221CC3212C5A3F35610CEDBC400A33ECB52
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 000051EA...2C17request_funds
[ 1700708460, 0.00995, "00001675becda24450fad82114a15b58567979e8e7aea1cffc54ce8c1779513ea2af", "9bd63c494db2810dd5a1991ecb9e2074dca1628f4cc92adef13e52998ef87aad", "0x4e4fb3858ed7d1f24b1090c50e88d576165a1c98baf46cb07511aba79b49bdf4", "0xcf93d25b3f3aaecc0ba365f5a1bdc14c7ab0280a", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00000534...124AAt 2023-11-23 01:01:30 UTCAmount 0.32365835 UCO
Previous public key
00015D325DD252F9F6EA80AD628160FF3E65FAA49D514B7129FF81FB0359C4BB0C7D
Previous signature
A32EF8F7E3CE59001BA56094DDE98F9450716DB7F1B096BF2DD98BA61E1633DAB191034F2A65725EE5372243B431B0D063E2BDAC9F504BA63467A26F370CD005
Origin signature
30450221008730091115F904E276F883A2B0EC7A4AEF7854E55959DF720F9EE855FEA669D102202F8C7B8B9658BC069D7D6F400EFEECFDF6D8064A08878AB153D13B55EA71EC0D
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00E08FBD44B75BE8FD6E7CA2775CBAAFC70488313F26E15769236308B8D856DF56
Coordinator signature
78B63EDA24EE57CD6ED7ED6D8272F77D93C880A1CAA09B0249F5E164470049850CC7D95DB15E79E077F7C2DAFF7EE8D14A68084D45B15A3087857325A00BBE08
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
CDA0D3643902D9471EF2521F2B1E051E4EDE80B0847E0CA2000A51B29F67E04A7893C6F58FBFE6B3C69D72F6FE5A2200D1802284DF17E96987B372C80D83F907
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
797F0236310175247F78D51E9761E39788B4242779EFE46C87E001CF0AF3C69A745C597F981884F3BD51BFFE47E9E24DF2A3D342353510D4C7455BF5A8885408