@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: 1699446600 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 >= 1699446600 ] 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)) == 0x5156952B7A9A7FDEB816EA52BE7DCF980197DB35E48591917ADA616C154B4A0E, 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: 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
169F1A3A965ACA366D1035D0FB7986E7EAF6376843775FAE0FA3D8B491EF3E2EC10238BF8216982C961B27DED2C5B0C4427236B6098C1C70E977359F
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00008C7A...B926request_funds
[ 1699446600, 0.00995, "00008dd40cd42287a3c8282065f5bca7259ac7014cd73109b570e946a977687c7bd0", "5156952b7a9a7fdeb816ea52be7dcf980197db35e48591917ada616c154b4a0e", "0x57ab2fc637cdc8bcd07e1dabf17f69e66d745f56badd5c9c1cd0770e87e192d0", "0x19419f777efd8bb337cdfa9a044142dfbd9520b9", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00004230...8DCFAt 2023-11-08 10:30:24 UTCAmount 0.3117596 UCO
Previous public key
00010E32C0B123F8FC38F294281EA42FDF60B8ED5C12CEDCFC1842A7A1165046B34E
Previous signature
29D1E79CFAD44F03C1E0BFD40015B5EB7A728EEB4D5BE4071F9062273FAB67053392C465A9E18BA99EC305D439F7E0438D16E62E4BFC51FE65AD8F7E0E8C6700
Origin signature
3045022100CA130F60E54C8910355D09A8CF382C96CDB9CB324639F31C80CCF62543AB6190022042100974B92C97B25F9024F918F64902E4F72CFFA0DAE8EAFD6A7E85AC77956D
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
0082312C4D4F7DAF58305744575E017A19ACD25A625555078C77E38A1B4294F6D3
Coordinator signature
F9A9420AF0BC0DEF04E07108C5BDE7A526C9374F31FFBC70B8EAA7D13AEF595743A18AFABF7368E04FFDE959B2FC58E4A0C878C90495DCC92DF8D88E2212650F
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
C3C200E168D15AF7A887271673CA842742DB7020A5E8A4DFB88570908F06EA324BCE933974CFA02998402F976A4D2F670C8B49AE668D65BD51BAC6A3BFEDE103
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
773CE27AA818B4485E1F18D5876C56A997264D54E9D45AC355EE1CE195C719ABFD81E0AEF351F42A6E8E4ED324AD72A090E9D4E03860D7D49DCD79FAD8B2980E