@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: 1697977020 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 1.99e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1697977020 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 1.99e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0xDE2EA1B9B0125E9A40E7598FDF4D8F75D9FCD6623BD2A292CF30C55390B35E36, 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: 0x00007D1163F2AEA7B80362450AB96D837F5A698980E2FCC0ABE1CDB01D9B7F0D2273, amount: 1.9841e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 5.9e-7, 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
13BBC679BD7BB721E486141D35BB62F412E6B255DAAD8212D8FB6FE624D015ED62316437D5CF69A6462773F41C0D5F654254703FDAA90FA9F5CAB81F
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000D857...A9F8request_funds
[ 1697977020, 1.99e-4, "00007d1163f2aea7b80362450ab96d837f5a698980e2fcc0abe1cdb01d9b7f0d2273", "de2ea1b9b0125e9a40e7598fdf4d8f75d9fcd6623bd2a292cf30c55390b35e36", "0x94d01600b1899fa84194d8ad8027ed3470761fea7265eee1af9132c3e5c64278", "0x1908c549937b7b8f89401249f4aa68c0d852ad9c", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000595C...1DDEAt 2023-10-22 10:17:31 UTCAmount 0.4541326 UCO
Previous public key
0001FBC4D8A55C3558D1BBC9A8A0B96D941EC505A2C1D8EA7F03CCC5E02405E9C113
Previous signature
CF5A9B22232476773E0E6BA302E339A15E00EE1B40AF2A043035B71B6C7CF8F3A86B89B6E050F2A708896A530F27A0260218718F7E3D2E5090F355B03110EA01
Origin signature
304402202C9E80BC82C7D484ADC7C25107B2E22224B11A8E5BE472D01F8EE865418D40BF022007DE8F9C750008EAFDC2632A2B291C0AC967900E9D179F6799FB494C84EEDCF1
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
003EA8E2FD6818B8C3925F4052F6AB8DAF35A6C4BCD56CE5C662B0806019840E3F
Coordinator signature
E2D501D2B4320D58EF5AFC9BAB1EEB5547C88ABBD4CF40511132417E6B232FC9429DEAB7B88D5221C9F8C0C45AEAFA743981F604EE429B41818269F2DB0F3D04
Validator #1 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #1 signature
30294535B11DC8657DD399DD298FB25ABA1B844A936CA268C59E6E26378C5BB255188E02E44FA8E5E128EC64968C9417002E1DEB75B228B0172F6568E0D46605
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
3309CF1B938ACC42C98881100B04E7ADB788AE28E7C4AA245A6BFDE0A8B3845CD5D35A47D5604745509107959C9BF5EFC097917B6C1417FC8C6F99984BDF0108