Skip to content

Commit

Permalink
fix: fetch the creation time from oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Nov 6, 2023
1 parent 01ab78b commit 0607e9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The Bonded Response Module is a contract that allows users to propose a response

### Key Methods

- `decodeRequestData(bytes32 _requestId)`: Returns the decoded data for a request.
- `decodeRequestData(bytes calldata _data)`: Returns the decoded data for a request.
- `propose(bytes32 _requestId, address _proposer, bytes calldata _responseData)`: Proposes a response for a request, bonding the proposer's tokens.
- `deleteResponse(bytes32 _requestId, bytes32 _responseId, address _proposer)`: Allows a user to delete an undisputed response they proposed before the deadline, releasing the bond.
- `finalizeRequest(bytes32 _requestId, address _finalizer)`: Finalizes the request.
Expand Down
6 changes: 4 additions & 2 deletions solidity/contracts/modules/response/BondedResponseModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ contract BondedResponseModule is Module, IBondedResponseModule {
revert BondedResponseModule_TooEarlyToFinalize();
}

if (ORACLE.createdAt[_getId(_response)] != 0) {
if (!_isModule && block.timestamp < _response.createdAt + _params.disputeWindow) {
uint256 _responseCreatedAt = ORACLE.createdAt(_getId(_response));

if (_responseCreatedAt != 0) {
if (!_isModule && block.timestamp < _responseCreatedAt + _params.disputeWindow) {
revert BondedResponseModule_TooEarlyToFinalize();
}

Expand Down

0 comments on commit 0607e9b

Please sign in to comment.