Skip to content

Commit

Permalink
simplify types
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Dec 28, 2022
1 parent 534db13 commit e923d1a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions contracts/helpers/PredicateHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,39 +87,39 @@ contract PredicateHelper is NonceManager {
}

function _selfStaticCall(bytes calldata data) internal view returns(bool, uint256) {
uint256 selector = uint32(data.decodeSelector());
bytes4 selector = data.decodeSelector();
uint256 arg = data.decodeUint256(4);

// special case for the most often used predicate
if (selector == uint32(this.timestampBelowAndNonceEquals.selector)) { // 0x2cc2878d
if (selector == this.timestampBelowAndNonceEquals.selector) { // 0x2cc2878d
return (true, timestampBelowAndNonceEquals(arg) ? 1 : 0);
}

if (selector < uint32(this.arbitraryStaticCall.selector)) { // 0xbf15fcd8
if (selector < uint32(this.eq.selector)) { // 0x6fe7b0ba
if (selector == uint32(this.gt.selector)) { // 0x4f38e2b8
if (selector < this.arbitraryStaticCall.selector) { // 0xbf15fcd8
if (selector < this.eq.selector) { // 0x6fe7b0ba
if (selector == this.gt.selector) { // 0x4f38e2b8
return (true, gt(arg, data.decodeTailCalldata(100)) ? 1 : 0);
} else if (selector == uint32(this.timestampBelow.selector)) { // 0x63592c2b
} else if (selector == this.timestampBelow.selector) { // 0x63592c2b
return (true, timestampBelow(arg) ? 1 : 0);
}
} else {
if (selector == uint32(this.eq.selector)) { // 0x6fe7b0ba
if (selector == this.eq.selector) { // 0x6fe7b0ba
return (true, eq(arg, data.decodeTailCalldata(100)) ? 1 : 0);
} else if (selector == uint32(this.or.selector)) { // 0x74261145
} else if (selector == this.or.selector) { // 0x74261145
return (true, or(arg, data.decodeTailCalldata(100)) ? 1 : 0);
}
}
} else {
if (selector < uint32(this.lt.selector)) { // 0xca4ece22
if (selector == uint32(this.arbitraryStaticCall.selector)) { // 0xbf15fcd8
if (selector < this.lt.selector) { // 0xca4ece22
if (selector == this.arbitraryStaticCall.selector) { // 0xbf15fcd8
return (true, arbitraryStaticCall(address(uint160(arg)), data.decodeTailCalldata(100)));
} else if (selector == uint32(this.and.selector)) { // 0xbfa75143
} else if (selector == this.and.selector) { // 0xbfa75143
return (true, and(arg, data.decodeTailCalldata(100)) ? 1 : 0);
}
} else {
if (selector == uint32(this.lt.selector)) { // 0xca4ece22
if (selector == this.lt.selector) { // 0xca4ece22
return (true, lt(arg, data.decodeTailCalldata(100)) ? 1 : 0);
} else if (selector == uint32(this.nonceEquals.selector)) { // 0xcf6fc6e3
} else if (selector == this.nonceEquals.selector) { // 0xcf6fc6e3
return (true, nonceEquals(address(uint160(arg)), data.decodeUint256(0x24)) ? 1 : 0);
}
}
Expand Down

0 comments on commit e923d1a

Please sign in to comment.