Skip to content

Commit d56fe0f

Browse files
committed
Added state mutability check in AccessControlIncompletenessChecker
1 parent 585c52b commit d56fe0f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/it/unipr/crosschain/checker/AccessControlIncompletenessChecker.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class AccessControlIncompletenessChecker implements
3939
private Set<Statement> taintedJumpi = new HashSet<>();
4040
private Map<Statement, Set<Integer>> jumpiProgramPoints = new HashMap<>();
4141
private SmartContract contract;
42+
private final Set<String> stateMutabilityForbidden = Set.of("view", "pure");
4243

4344
/**
4445
* Builds the checker for the given contract.
@@ -256,6 +257,8 @@ private void reportVulnerability(CheckToolWithAnalysisResults<
256257
Signature signature = contract.getFunctionSignatureByString(functionSignatureByStatement);
257258
if (signature == null)
258259
return;
260+
if (stateMutabilityForbidden.contains(signature.getStateMutability()))
261+
return;
259262

260263
if (signature.isProtected()) {
261264
log.warn(

0 commit comments

Comments
 (0)