@@ -39,7 +39,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
39
39
40
40
if (_dispute.requestId == bytes32 (0 )) revert BondEscalationModule_DisputeDoesNotExist ();
41
41
42
- (,,,, uint256 _bondEscalationDeadline , uint256 _tyingBuffer ) = _decodeRequestData (requestData[ _dispute.requestId] );
42
+ (,,,, uint256 _bondEscalationDeadline , uint256 _tyingBuffer ) = decodeRequestData ( _dispute.requestId);
43
43
44
44
// If the bond escalation deadline is not over, no dispute can be escalated
45
45
if (block .timestamp <= _bondEscalationDeadline) revert BondEscalationModule_BondEscalationNotOver ();
@@ -93,7 +93,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
93
93
uint256 _bondSize ,
94
94
,
95
95
uint256 _bondEscalationDeadline ,
96
- ) = _decodeRequestData (requestData[ _requestId] );
96
+ ) = decodeRequestData ( _requestId);
97
97
98
98
// if the bond escalation is not over and there's an active dispute going through it, revert
99
99
if (block .timestamp <= _bondEscalationDeadline && bondEscalationStatus[_requestId] == BondEscalationStatus.Active) {
@@ -123,7 +123,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
123
123
124
124
function updateDisputeStatus (bytes32 _disputeId , IOracle.Dispute memory _dispute ) external onlyOracle {
125
125
(IBondEscalationAccounting _accountingExtension , IERC20 _bondToken , uint256 _bondSize ,,,) =
126
- _decodeRequestData (requestData[ _dispute.requestId] );
126
+ decodeRequestData ( _dispute.requestId);
127
127
128
128
bool _won = _dispute.status == IOracle.DisputeStatus.Won;
129
129
@@ -198,7 +198,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
198
198
uint256 _maxNumberOfEscalations ,
199
199
uint256 _bondEscalationDeadline ,
200
200
uint256 _tyingBuffer
201
- ) = _decodeRequestData (requestData[ _dispute.requestId] );
201
+ ) = decodeRequestData ( _dispute.requestId);
202
202
203
203
if (_maxNumberOfEscalations == 0 || _bondSize == 0 ) revert BondEscalationModule_ZeroValue ();
204
204
@@ -262,7 +262,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
262
262
uint256 _maxNumberOfEscalations ,
263
263
uint256 _bondEscalationDeadline ,
264
264
uint256 _tyingBuffer
265
- ) = _decodeRequestData (requestData[ _dispute.requestId] );
265
+ ) = decodeRequestData ( _dispute.requestId);
266
266
267
267
if (_maxNumberOfEscalations == 0 || _bondSize == 0 ) revert BondEscalationModule_ZeroValue ();
268
268
@@ -313,7 +313,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
313
313
,
314
314
uint256 _bondEscalationDeadline ,
315
315
uint256 _tyingBuffer
316
- ) = _decodeRequestData (requestData[ _requestId] );
316
+ ) = decodeRequestData ( _requestId);
317
317
318
318
if (block .timestamp <= _bondEscalationDeadline + _tyingBuffer) {
319
319
revert BondEscalationModule_BondEscalationNotOver ();
@@ -370,7 +370,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
370
370
* party to tie if at the end of the initial deadline the pledgess weren't tied.
371
371
*/
372
372
function decodeRequestData (bytes32 _requestId )
373
- external
373
+ public
374
374
view
375
375
returns (
376
376
IBondEscalationAccounting _accountingExtension ,
@@ -382,7 +382,7 @@ contract BondEscalationModule is Module, IBondEscalationModule {
382
382
)
383
383
{
384
384
(_accountingExtension, _bondToken, _bondSize, _maxNumberOfEscalations, _bondEscalationDeadline, _tyingBuffer) =
385
- _decodeRequestData (requestData[_requestId]);
385
+ abi.decode (requestData[_requestId], (IBondEscalationAccounting, IERC20 , uint256 , uint256 , uint256 , uint256 ) );
386
386
}
387
387
388
388
/**
@@ -430,24 +430,4 @@ contract BondEscalationModule is Module, IBondEscalationModule {
430
430
}
431
431
}
432
432
}
433
-
434
- ////////////////////////////////////////////////////////////////////
435
- // Pure Functions
436
- ////////////////////////////////////////////////////////////////////
437
-
438
- function _decodeRequestData (bytes memory _data )
439
- internal
440
- pure
441
- returns (
442
- IBondEscalationAccounting _accountingExtension ,
443
- IERC20 _bondToken ,
444
- uint256 _bondSize ,
445
- uint256 _maxNumberOfEscalations ,
446
- uint256 _bondEscalationDeadline ,
447
- uint256 _tyingBuffer
448
- )
449
- {
450
- (_accountingExtension, _bondToken, _bondSize, _maxNumberOfEscalations, _bondEscalationDeadline, _tyingBuffer) =
451
- abi.decode (_data, (IBondEscalationAccounting, IERC20 , uint256 , uint256 , uint256 , uint256 ));
452
- }
453
433
}
0 commit comments