Skip to content

Commit

Permalink
Resolved requests
Browse files Browse the repository at this point in the history
  • Loading branch information
merendamattia committed May 17, 2024
1 parent 4103bbe commit acba68f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
16 changes: 5 additions & 11 deletions src/main/java/it/unipr/EVMLiSA.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ private MyLogger newAnalysis(String CONTRACT_ADDR) throws Exception {

if (numberOfAPIEtherscanRequest % 5 == 0) {
try {
Thread.sleep(1001); // I can do max 5 API request in 1 sec
// to Etherscan.io
// I can do max 5 API request in 1 sec to Etherscan.io
Thread.sleep(1001);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -338,7 +338,6 @@ private MyLogger newAnalysis(String CONTRACT_ADDR) throws Exception {
}

private void runBenchmark() throws Exception {
// clean();
startOfExecutionTime = System.currentTimeMillis();
Object guardia = new Object();

Expand Down Expand Up @@ -451,11 +450,7 @@ public void run() {
handler.start();

long timeToWait;
// int millisPerSmartContract = 25000 * 10;
// int extra = 120000;
// long blocks = smartContracts.size() / CORES * 20000;
// timeToWait = smartContracts.size() * millisPerSmartContract + extra + blocks;
// timeToWait = timeToWait * 100;

timeToWait = 1000 * 60 * 60 * 24 * 3; // 3 days

// Statistics
Expand Down Expand Up @@ -872,9 +867,8 @@ private void saveSmartContractsFromEtherscan() throws Exception {

if (i % 5 == 0) {
try {
Thread.sleep(1001); // I can do max 5 API
// request in 1 sec to
// Etherscan.io
// I can do max 5 API request in 1 sec to Etherscan.io
Thread.sleep(1001);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/it/unipr/analysis/AbstractStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,6 @@ else if (isTop())
@Override
public String toString() {
return this.stack.toString();
// We use the bottom part for debugging
// String result = "{";
//
// for (int i = STACK_LIMIT - size(); i < STACK_LIMIT; i++) {
// if (stack.get(i).isBottom())
// result += Lattice.bottomRepresentation();
// else if (stack.get(i).isBottom())
// result += Lattice.topRepresentation();
// else
// result += stack.get(i);
//
// if ((i + 1) != STACK_LIMIT)
// result += ", ";
// }
//
// result += "}";
// return result;
}

@Override
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/it/unipr/analysis/EVMAbstractState.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ public EVMAbstractState smallStepSemantics(ValueExpression expression, ProgramPo
KIntegerSet opnd1 = resultStack.pop();
KIntegerSet opnd2 = resultStack.pop();

// resultStack.push(opnd2.equals(KIntegerSet.ZERO) && !opnd1.isTop() ? KIntegerSet.ZERO : opnd1.div(opnd2));
try {
resultStack.push(opnd1.div(opnd2));
} catch (ArithmeticException e) {
Expand All @@ -505,7 +504,6 @@ public EVMAbstractState smallStepSemantics(ValueExpression expression, ProgramPo
KIntegerSet opnd1 = resultStack.pop();
KIntegerSet opnd2 = resultStack.pop();

// resultStack.push(opnd2.equals(KIntegerSet.ZERO) && !opnd1.isTop() ? KIntegerSet.ZERO : opnd1.div(opnd2));
try {
resultStack.push(opnd1.div(opnd2));
} catch (ArithmeticException e) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/it/unipr/analysis/KIntegerSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ else if (isTopNotJumpdest() || other.isTopNotJumpdest())
else
elements.add(i.divide(j));

// elements.add(i.divide(j, RoundingMode.FLOOR));

return new KIntegerSet(elements);
}

Expand Down

0 comments on commit acba68f

Please sign in to comment.