1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "source": `// SPDX-License-Identifier: MIT
12pragma solidity ^0.8.20;
13
14contract Vault {
15 address public owner;
16 mapping(address => uint256) public bal;
17
18 constructor() { owner = msg.sender; }
19
20 function withdraw(uint256 a) external {
21 require(bal[msg.sender] >= a);
22 (bool ok, ) = msg.sender.call{value: a}("");
23 require(ok);
24 bal[msg.sender] -= a;
25 }
26}`
27};
28
29
30const run = await client.actor("shroud-audit/solidity-security-scanner").call(input);
31
32
33console.log('Results from dataset');
34console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
35const { items } = await client.dataset(run.defaultDatasetId).listItems();
36items.forEach((item) => {
37 console.dir(item);
38});
39
40