@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: 1699994040 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.004975, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1699994040 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.004975, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x797F61C80D62C6792E8F6C560964630BD8C3E016065CB2F34E2EB937B97CD5BA, 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: 0x000072181206496222FBB38752FCCED316C8936F3030CAE39BF58D41BFEED0CA6263, amount: 0.00496008, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 1.492e-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
B6A35C44764DFC0B4DE58F08C20D34D9B9A05D672EE81B73C43D565A3FBD6645DB025831700B0978CC20CC7D1BBC6852F4FC2EBA552F0E09D3FB5C8D
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000336A...60CErequest_funds
[ 1699994040, 0.004975, "000072181206496222fbb38752fcced316c8936f3030cae39bf58d41bfeed0ca6263", "797f61c80d62c6792e8f6c560964630bd8c3e016065cb2f34e2eb937b97cd5ba", "0x64a880c10479365be212739a447c041c67626668472dfe659a42717c75283fcd", "0x1c6e10f3a0c46f3900c06b6e8f908e11e268da0d", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 000088AD...B70EAt 2023-11-14 18:35:24 UTCAmount 0.29918945 UCO
Previous public key
0001CCA872EBA7F2EF5A8F2F9B9B03413DA8410851722D417634432076C201DAB4FC
Previous signature
FB800035D94CF46A3E4EBFD907D0B6822CD2AF081D6F29231BA50CBAE35799FB2498140EA4C64742FC8239096BD9E7A2B23CE8AFB2EA82EB1450621EB383C80B
Origin signature
304402206458B64B8E59BA742916E717EBB8D4AB8F2DBA3D61D9B540AE205C79424D44D20220414D263CA9C4FDF21C9D7885E77DCC432CC4BD02F25B47B8C2426327C6C38771
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00DB1F45AE9215398409DCC11A6CC59B6B80A5EEEB02B4C7B413D257875BA40A41
Coordinator signature
E7DF88E93BE37A06E3DF320B831F36004E4747E8FAA3857DFA00EABA6AFB032EF3F37C7F47FED34BA33EA33CB270CA29CDE00E2C6D9B963C6937285AAB48B807
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
1E1C57AF966C65C9151EAD833DC195091B3AFDA45A8946F3D11FA25C220694B3AE218616DC04A2C5D39A8A16FBE5A48C00899C71FAF1DAFA20AAD0F09C102008
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
4BA0B8FF9FA0E31D94F90F09A475FBC3D6E6E016D513D281C49C59C1BDBFE4D557AA1669097DDA91A4B664F65345C60849A3BC0A3855AA986022173E4DF5EC01