@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: 1701171420 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 1.0945, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1701171420 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 1.0945, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x5CF667FE340102A2D277EF9CEEC59BA25E6F465C7C61716F49464F2FC06CEEDC, 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: 0x0000E3E9B897C1EE0DC7FE004AD18B4B23361B00861F0C4DC6FC85FEC6A762FF235C, amount: 1.0912165, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.0032835, 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
3285CB3549BB9A8476D1364C4E5F408C0793E74DB8F23034A5B53105107AF257F5205A094E24CABD822A6DC4A313DCC4AFB0DC5E9218FD30C4BA393F
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000195C...452Erequest_funds
[ 1701171420, 1.0945, "0000e3e9b897c1ee0dc7fe004ad18b4b23361b00861f0c4dc6fc85fec6a762ff235c", "5cf667fe340102a2d277ef9ceec59ba25e6f465c7c61716f49464f2fc06ceedc", "0xe651bec4ceb5cc1599246b828276e016576e51acde0838583e435a5ea68a49c0", "0x8f849cb518fb464d4b626dee05f8d1076ca4e416", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000CF97...B943At 2023-11-28 09:37:48 UTCAmount 0.35963976 UCO
Previous public key
0001960D0F6EAF35D03C4F59CA3A92F7731D16EC3B495717A928A7B21444E65C98CB
Previous signature
7C3FFFBE1F212D379029E426CB180F99B0002BF1A29A4F2F4A9FBDF3A1612B7FE0EF2DE61B51AE08B8D0860C5BEE7217B07BE7208814ADE02697F9EDBB34810D
Origin signature
304402207A4D0C9FCB36A533547D3D10168AE0DA03084265E0503F00BBE411C65CC139B502204AE8D95234007FE8A45A3796E520A352A33249406605ADD87D589902520F27A0
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
001499FFEC17650850B383FA7F2FECFA9D79B4360710211D17B93E8CE84AF05665
Coordinator signature
C004599C0E85BA2C3E216F1019E572F1B0AE423C3D2AB49E286FD0CB6B9F8F50F29CD76FD2104C5A35AEF9A9FBEF0BCF16D522503A67AFC940E09EC8B9D63B0C
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
B0F149FE0330D9869C26E2704D088E077A0A9C906E94B0BA4744C6193E2239F5DE48B1F7948BF3C42027D77D76ACD23225BD66988BBA68DF98C963636FFFF702
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
44D94EAC144EA2D4D9C7A8ABFC7042DF7B0A565843720EF97DFB1FA2B5DAD732264604B605F9A557BE5C219BD6601A8A546B6C1CD3A2B3B2D0B2BBC9D3337E0F