@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) == 0x0000072E418B60C6DABD272BC2728B17B352B8104F068D11365D50134F96A4199609 ) ] 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: 1699997220 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 9.95e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1699997220 ] 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: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x5D4A76405605E03BB596C2FA5FD8A78FE54C60899CAB0A5FF1688A97C2B91AC2, 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: 0x00000BC0EBA2DBCE4455B46F5E51AFAABA6EB4C7FBA1D4E2E6DABD55DC70F9A04D6F, amount: 9.9202e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.98e-6, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
0CB0E8088928F0B35BBCCFE499F613ACCCE66A1EA2D60ACC25F8A0C2D402F6092F1720A8EBC1B2CB49C12DB528E0E11BC6B9DC8ACA5B6AF3B9FA3BFC
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00005AEE...8DBCrequest_funds
[ 1699997220, 9.95e-4, "00000bc0eba2dbce4455b46f5e51afaaba6eb4c7fba1d4e2e6dabd55dc70f9a04d6f", "5d4a76405605e03bb596c2fa5fd8a78fe54c60899cab0a5ff1688a97c2b91ac2", "0x57d243385c45448e5856823e80bce8d6369235b4fe68e89ff83ce98b43205e40", "0xa1882c5221117377476087ca0a34ebea115132fd", 80001 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 000030B8...3559At 2023-11-14 19:28:15 UTCAmount 0.30347282 UCO
Previous public key
0001B1D064698697694EC7E95373938CBA2B957FD3C83E72DCEE0E2227E20C7F1150
Previous signature
773A4576F00FC1ECB279BB480F56DD4FDFE4AEA07A5A600C862D2DE251369411652A77152B62B1C8B7F0F455CD688D48D68B01E9FCA98B53EE91CE168FF5690C
Origin signature
304402203E7ED41DFCF8D587DF0BDC9E37A62B072267F9F487DA34C4B3194E3EE1919FAC02205A4DD7506EBF7220428802EB954C5C58891E9A4494DDCC9BC963292D48303056
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00A413D07FBF9CAD9FCC5874C0CC15DED935082004573F039992335AE56A8545F7
Coordinator signature
D685EFA5B30F5E3A08BCB39F91682330749DC82E53637A02EB66CC8DE626B6E55F3021BF7EBD2371CAB49DF8DBA19EBC72BD25C28C55501FEDFBF816C4893A02
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
78B8B5600BD8DFF75E6B1970D6982207BDF3CB95C420A896FF5290E0A2C81B4E9ABD17A73977B54C0D35A4A9B8347ED55B4E111C2B3DBAC6B6F3EF858B843A03
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
15504CD7C7724EC741CEFAC4356C2FC08D9AD94A2E6D94F32A8C77FB7E06207A774E6835FE57297CD3F3FDDDBDBCE9B416F28D42CCC9FD2F463682391BF1F00A