-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove libraries dependencies and use interfaces instead
- Loading branch information
Showing
15 changed files
with
449 additions
and
1,606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import {AuthRequest, AuthType} from "../utils/Structs.sol"; | ||
|
||
interface IAuthRequestBuilder { | ||
error InvalidUserIdAndIsSelectableByUserAuthType(); | ||
error InvalidUserIdAndAuthType(); | ||
|
||
function build( | ||
AuthType authType, | ||
bool isAnon, | ||
uint256 userId, | ||
bool isOptional, | ||
bool isSelectableByUser, | ||
bytes memory extraData | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
bool isAnon, | ||
uint256 userId, | ||
bytes memory extraData | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build(AuthType authType) external pure returns (AuthRequest memory); | ||
|
||
function build(AuthType authType, bool isAnon) external pure returns (AuthRequest memory); | ||
|
||
function build(AuthType authType, uint256 userId) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
bytes memory extraData | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
bool isAnon, | ||
uint256 userId | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
bool isAnon, | ||
bytes memory extraData | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
uint256 userId, | ||
bytes memory extraData | ||
) external pure returns (AuthRequest memory); | ||
|
||
// allow dev to choose for isOptional | ||
// the user is ask to choose isSelectableByUser to avoid the function signature collision | ||
// between build(AuthType authType, bool isOptional) and build(AuthType authType, bool isAnon) | ||
|
||
function build( | ||
AuthType authType, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
bool isOptional, | ||
bool isSelectableByUser, | ||
uint256 userId | ||
) external pure returns (AuthRequest memory); | ||
|
||
// the user is ask to choose isSelectableByUser to avoid the function signature collision | ||
// between build(AuthType authType, bool isAnon, bool isOptional) and build(AuthType authType, bool isOptional, bool isSelectableByUser) | ||
|
||
function build( | ||
AuthType authType, | ||
bool isAnon, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
uint256 userId, | ||
bool isOptional | ||
) external pure returns (AuthRequest memory); | ||
|
||
function build( | ||
AuthType authType, | ||
bool isAnon, | ||
uint256 userId, | ||
bool isOptional | ||
) external pure returns (AuthRequest memory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import {ClaimRequest, ClaimType} from "../utils/Structs.sol"; | ||
|
||
interface IClaimRequestBuilder { | ||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
uint256 value, | ||
ClaimType claimType, | ||
bool isOptional, | ||
bool isSelectableByUser, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
uint256 value, | ||
ClaimType claimType, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build(bytes16 groupId) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build(bytes16 groupId, uint256 value) external pure returns (ClaimRequest memory); | ||
|
||
function build(bytes16 groupId, ClaimType claimType) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
uint256 value | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
ClaimType claimType | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
uint256 value, | ||
ClaimType claimType | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
uint256 value, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
ClaimType claimType, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
uint256 value, | ||
ClaimType claimType | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
uint256 value, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
ClaimType claimType, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
uint256 value, | ||
ClaimType claimType, | ||
bytes memory extraData | ||
) external pure returns (ClaimRequest memory); | ||
|
||
// allow dev to choose for isOptional | ||
// we force to also set isSelectableByUser | ||
// otherwise function signatures would be colliding | ||
// between build(bytes16 groupId, bool isOptional) and build(bytes16 groupId, bool isSelectableByUser) | ||
// we keep this logic for all function signature combinations | ||
|
||
function build( | ||
bytes16 groupId, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
uint256 value, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
ClaimType claimType, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
uint256 value, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
ClaimType claimType, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
uint256 value, | ||
ClaimType claimType, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
|
||
function build( | ||
bytes16 groupId, | ||
bytes16 groupTimestamp, | ||
uint256 value, | ||
ClaimType claimType, | ||
bool isOptional, | ||
bool isSelectableByUser | ||
) external pure returns (ClaimRequest memory); | ||
} |
Oops, something went wrong.