Spaces:
Runtime error
Runtime error
Download testRegex.cjs from TALP-Project/multi-agent-smart-contracts: direct link, hf CLI and curl.
- Browser
- Download file 553 Bytes
-
https://huggingface.co/spaces/TALP-Project/multi-agent-smart-contracts/resolve/main/testRegex.cjs
- Command line
-
hf download hf://spaces/TALP-Project/multi-agent-smart-contracts/testRegex.cjs
-
curl -L -o testRegex.cjs https://huggingface.co/spaces/TALP-Project/multi-agent-smart-contracts/resolve/main/testRegex.cjs
553 Bytes
| const fs = require('fs'); | |
| const trimmedCode = fs.readFileSync('/home/tales/Mestrado/IA/projeto-talp1/temp_vuln_run/001/test/Exploit.t.sol', 'utf8'); | |
| const hasIllegalComments = trimmedCode.split('\n').some(line => { | |
| const isComment = line.includes('//') || line.includes('/*'); | |
| const isAllowed = line.includes('SPDX-License-Identifier') || line.includes('INJECT_HACK'); | |
| if (isComment && !isAllowed) { | |
| console.log("ILLEGAL COMMENT LINE: ", line); | |
| } | |
| return isComment && !isAllowed; | |
| }); | |
| console.log("hasIllegalComments:", hasIllegalComments); | |