Skip to content

Commit

Permalink
Initial compressor implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusx1211 committed Jan 12, 2024
1 parent e0c5382 commit 90a50aa
Show file tree
Hide file tree
Showing 6 changed files with 1,498 additions and 7 deletions.
14 changes: 7 additions & 7 deletions contracts/modules/commons/submodules/auth/SequenceBaseSig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import "../../../../utils/LibOptim.sol";
library SequenceBaseSig {
using LibBytesPointer for bytes;

uint256 private constant FLAG_SIGNATURE = 0;
uint256 private constant FLAG_ADDRESS = 1;
uint256 private constant FLAG_DYNAMIC_SIGNATURE = 2;
uint256 private constant FLAG_NODE = 3;
uint256 private constant FLAG_BRANCH = 4;
uint256 private constant FLAG_SUBDIGEST = 5;
uint256 private constant FLAG_NESTED = 6;
uint256 internal constant FLAG_SIGNATURE = 0;
uint256 internal constant FLAG_ADDRESS = 1;
uint256 internal constant FLAG_DYNAMIC_SIGNATURE = 2;
uint256 internal constant FLAG_NODE = 3;
uint256 internal constant FLAG_BRANCH = 4;
uint256 internal constant FLAG_SUBDIGEST = 5;
uint256 internal constant FLAG_NESTED = 6;

error InvalidNestedSignature(bytes32 _hash, address _addr, bytes _signature);
error InvalidSignatureFlag(uint256 _flag);
Expand Down
7 changes: 7 additions & 0 deletions contracts/modules/commons/submodules/nonce/SubModuleNonce.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ library SubModuleNonce {
_nonce = uint256(bytes32(_rawNonce) & NONCE_MASK);
}
}

function encodeNonce(uint256 _space, uint256 _nonce) internal pure returns (uint256) {
unchecked {
// Combine space and nonce
return (_space << NONCE_BITS) | _nonce;
}
}
}
Loading

0 comments on commit 90a50aa

Please sign in to comment.