@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: 1700001660 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.398, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700001660 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.398, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x0309DCD3F16C38B1CCB5E375A953102AD675D836FF7FD3358EC46209C49E6894, 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: 0x00001675BECDA24450FAD82114A15B58567979E8E7AEA1CFFC54CE8C1779513EA2AF, amount: 0.396806, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.001194, 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
30A972E700A313A5513B22E3CBF021680E6511985FAFA4998E0D8B86C7BBAC655922B0CF1A26D2F77523AC94FDBC93D2F77BF720D06BE40A77DF9810
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 0000EF93...23EArequest_funds
[ 1700001660, 0.398, "00001675becda24450fad82114a15b58567979e8e7aea1cffc54ce8c1779513ea2af", "0309dcd3f16c38b1ccb5e375a953102ad675d836ff7fd3358ec46209c49e6894", "0x207fd2981030488176b58213869a39852ecd304ee82114e67c9f978af64a23af", "0x5c08747bcb6ab9dcde0e3dc75762ae841e874ff4", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000B290...EBBEAt 2023-11-14 20:42:21 UTCAmount 0.29960107 UCO
Previous public key
0001B731645B518F0AC4282311DDFC485A48310F8AB8E123345CFE307B1292D75BBA
Previous signature
D55B7CE156F4CE69CAEE8A71AB875F5810B7A03700BD69602FCE057ACA7F66A0037D32182354236D52AE5990F03D5C1889D453AEABD228B1A48060B6AB557708
Origin signature
30440220410901833F952F1709489926D451D26980DBF1584F8F949C9BC7CA506FEFED99022064B9EEC7F02621E14BF0611956E604E15C2BEF2406D1A206E1A926775058586C
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
00ED308257E8432D214C430A63B5925A4A9FB5E6C851580DCEAA46FEEA90909153
Coordinator signature
BB166C3EC457B3F58B2D4A5DC2D92C9F7FBAF2C2F2ED16BAD3B6C2E3BB290B0456D07627F9F025B30D19AAC286527E9F559D5F979BA730974E9B49DE20164E0E
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
1A8CFCD62B77674A73909A0FAB26733360BB7FE114127EB3E20C9080F1AAD06A0CCE7D9F1E78E192A07D0155F4378F92928622CB238D721A8526E88BAB3D2A0A
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
417EDCCD0294057EC68A14DE7B4DC2836C13791C1F02B5EBBB6BB979DED4A8D0D04C8C21A3D909D4CA5BC51D940273CD3C25C017DC690062DDA9C8C14AABC308