@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: 1698671400 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 9.95e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1698671400 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 9.95e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x22A22E199CDB8ADCA608A22FFDCF6E1D65668F2DEC9357DC568A213A9F33ABD7, 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: 0x00008DD40CD42287A3C8282065F5BCA7259AC7014CD73109B570E946A977687C7BD0, amount: 9.9202e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.98e-6, 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
EA70C005A18D58E6F2E553083126E8A0E6DDA7B043A2002CCE53F88C48769284B6C6BFC6F853E010AF7BC7C40B5A85AF86CC4A184C8E87528CF2B63D
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000FFAA...436Crequest_funds
[ 1698671400, 9.95e-4, "00008dd40cd42287a3c8282065f5bca7259ac7014cd73109b570e946a977687c7bd0", "22a22e199cdb8adca608a22ffdcf6e1d65668f2dec9357dc568a213a9f33abd7", "0x6cfb03d5f57c257f6a79b6f92098692bd46a7d4ad2dad45fe6ed60dda2d15d8d", "0x701d703454438b29bfd29692bfadda1f80164e8b", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000E3D6...C1FCAt 2023-10-30 11:10:50 UTCAmount 0.46802153 UCO
Previous public key
00016FA92E82317E216DD215A49754122554365AB9AD94D2539795F74E102DEC72EF
Previous signature
5A82FB760B28FBCA29D1B182D330C2DF11957FDAA8220C8FA5B77CA9EB71F9553BCA1503C26977DB16685CBC4F692AEDAC0A7B5F6E277FF0976DD120503B800C
Origin signature
3045022100B085EC71E972F775F08CC8664FB0A55C1D748480520B84692A157BDE882B6E4602200A1EB6AAD334B112FE69DC61A1336698BAAED2620EB29699D0BEC937ECF74625
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00D0757CAEEEAE028A5E5ED810DA2389085AEAF7A8CD262D6F3CA111FDE3178055
Coordinator signature
DF269D5B1F43720DC3E8E2B06A69ABD758914DE8FCFE64A635050660ABC11E2048F5F4E65919D5BA967EFDF3539ECB401BD94031FA8DDA0669FE8101A251990C
Validator #1 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #1 signature
CA869C7C12A611E2A2CC8A9C903D6E1682F2559780CF158772948EB21171522F50FA31F032161D555A4DEB5D38295D523BE877EBF17FA6D3AF6DA10C7BC79C0F
Validator #2 public key
00011ED0B570D680BE5ECD58D2D121689DA73C46DCB38A01C6E10D06286040ADE30A
Validator #2 signature
5464547C69748F770CF81D837772F9A4DEB957744E973EE0BC0544F80E78224690273DAA647B8C5187D6C2B917F05A7FDEBDD29CA7E1CB003F128C00003DA207