Commit 3e5fe501 authored by Alina's avatar Alina Committed by GitHub

Audit/tob4 potential overflow 200 (#115)

* safemathwrapper

* use openzeppelin's safemath

* rm dangling lib import
parent 608e5cad
......@@ -13,6 +13,7 @@ import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.s
import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
import '@openzeppelin/contracts/math/SafeMath.sol';
/**
* @title OVM_StateCommitmentChain
......@@ -240,8 +241,7 @@ contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, iRingBufferOverw
timestamp != 0,
"Batch header timestamp cannot be zero"
);
return timestamp + FRAUD_PROOF_WINDOW > block.timestamp;
return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment