@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700013720 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0995, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700013720 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0995, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x53D4F6866D61CF05EC553E94815C9C19CA4D79D627474697AD73B4B935CBCE82, address: ( valid? = false abi_data = Evm.abi_encode("status()") tx = [to: "0x5a15390543228bbd61210701dc2b957ecefb9969", 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("https://polygon-mumbai.infura.io/v3/3a7a2dbdbec046a4961550ddf8c7d78a", "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: 0x00006AFF130BEB6BE9B02B80FFC13DB5EABFB0A7D167BAFC9F2DF8F141D7755FB39F, amount: 0.0992015, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.985e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1 Contract.set_code "" end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
1E0670B490288F89A15996340FC19039878E28272687DD89480703F08EDA133027F0FF097D147ED2D2117124BA15B907A9F35901A9165DED08507BF4
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 00002221...9E4EAt 2023-11-15 00:02:38 UTCAmount 0.30633863 UCO
-
From 0000E676...A512At 2023-11-15 00:02:34 UTCAmount 0.0995 00001A4A...01F1
Previous public key
0001BF6ABDE5D8395697BFE928C9EBF4E363FE551745318F495D62591FEDFD7EE99D
Previous signature
F1FAFA1CABA8E59A3A798F00E14637BB082F9B0E81DC7D3085B65C3A201C4306D5E6F664D1B393C65233877E317FF8FFB823986563ADA3136E35E058DD5D0C0E
Origin signature
304402205CAE465FF0BB6AD7F4CAE8F8DAA5D9D35349592F30268ABBF9D20FDC1CC5B80502201422D1CE00BF58A89438A30A43239C0F9B7ABAAA518E26B88BAF0D2644B46E26
Proof of work
010204B3B2A53580086B9F36919CF40ABC55904729F78BF43673E216FAC1EB2451DD1E521879C6588F0CB09B150A103A39A73E2816B5ADF51F0721348BA3A66C33023B
Proof of integrity
00ECEF354E49FBA0FAEC39A513FAD61F22D400AB2A916465D5B707D5A03D07799C
Coordinator signature
8F1880289C1012A2461163B38793ADF637CA2430C3F8061468072C72BD9FF3CBD1706999EA18DD5959E4F2FC2F1F6E6F820204C82C8BE22C0C29666843CD110C
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
4BA271F48E5257BE92AA2F6F31A62BC0368506EDF8B4CFC8044A6DC89CCF2F128FB7177ACF7385EF7F2F4A04E90F97B01B75B892B8302A9BF9D758043BF5090C
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
F480600F711DA8406152C194B8391EA0E9C2EB5C7CC15D277E7D13820999C4511EBE47186936A1EEA24EE5C81C96B56CB69C392BCA9EDF9E66168D4DD327D60B