-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add nat-spec doc comments (#255)
* docs: add nat-spec doc comments * fix: more errors cleanup * chore: extend cspell dict * docs: weird -> unusual * feat: update timestamp asserter locator with mainnet address * chore: update webauthn docs Provide some extra information that's less obvious from reading the code unless you are already familiar with webauthn --------- Co-authored-by: Colin <[email protected]>
- Loading branch information
Showing
14 changed files
with
217 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ testid | |
vueuse | ||
dockerized | ||
ethereum | ||
sepolia | ||
|
||
// examples/bank-demo | ||
ctap | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,9 @@ import { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/Upgradea | |
/// @title SsoBeacon | ||
/// @author Matter Labs | ||
/// @custom:security-contact [email protected] | ||
/// @dev This beacon stores the implementation address of SsoAccount contract, | ||
/// which every SSO account delegates to. This beacon's address is immutably stored | ||
/// in AAFactory contract, as it is required for deploying new SSO accounts. | ||
contract SsoBeacon is UpgradeableBeacon { | ||
constructor(address _implementation) UpgradeableBeacon(_implementation) {} | ||
} |
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 |
---|---|---|
|
@@ -3,16 +3,24 @@ pragma solidity ^0.8.24; | |
|
||
import { ITimestampAsserter } from "../interfaces/ITimestampAsserter.sol"; | ||
|
||
/// @title Timestamp asserter locator | ||
/// @author Matter Labs | ||
/// @custom:security-contact [email protected] | ||
/// @notice This library is used to locate the TimestampAsserter contract on different networks. | ||
/// @dev Might be removed in the future, when TimestampAsserter is deployed via create2 to the same address on all networks. | ||
library TimestampAsserterLocator { | ||
function locate() internal view returns (ITimestampAsserter) { | ||
// anvil-zksync (era-test-node) | ||
if (block.chainid == 260) { | ||
return ITimestampAsserter(address(0x00000000000000000000000000000000808012)); | ||
return ITimestampAsserter(address(0x0000000000000000000000000000000000808012)); | ||
} | ||
// era sepolia testnet | ||
if (block.chainid == 300) { | ||
return ITimestampAsserter(address(0xa64EC71Ee812ac62923c85cf0796aA58573c4Cf3)); | ||
} | ||
// era mainnet | ||
if (block.chainid == 324) { | ||
revert("Timestamp asserter is not deployed on ZKsync mainnet yet"); | ||
return ITimestampAsserter(address(0x958F70e4Fd676c9CeAaFe5c48cB78CDD08b4880d)); | ||
} | ||
revert("Timestamp asserter is not deployed on this network"); | ||
} | ||
|
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
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
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
/// @title Timestamp asserter interface | ||
/// @author Matter Labs | ||
/// @custom:security-contact [email protected] | ||
/// @notice Used to assert that the current timestamp is within a given range in AA validation context. | ||
interface ITimestampAsserter { | ||
function assertTimestampInRange(uint256 start, uint256 end) external view; | ||
} |
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 |
---|---|---|
@@ -1,56 +1,25 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.24; | ||
|
||
/// @title Errors | ||
/// @notice Errors used by ZKsync SSO and its components | ||
/// @author getclave.io | ||
library Errors { | ||
/*////////////////////////////////////////////////////////////// | ||
ACCOUNT | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
// Account errors | ||
error INSUFFICIENT_FUNDS(uint256 required, uint256 available); | ||
error FEE_PAYMENT_FAILED(); | ||
error METHOD_NOT_IMPLEMENTED(); | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
LINKED LIST | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
error INVALID_PREV_BYTES(bytes prevValue, bytes oldValue); | ||
error INVALID_PREV_ADDR(address prevValue, address oldValue); | ||
// Bytes | ||
error INVALID_BYTES(uint256 length); | ||
error BYTES_ALREADY_EXISTS(bytes length); | ||
error BYTES_NOT_EXISTS(bytes lookup); | ||
// Address | ||
error INVALID_ADDRESS(address valid); | ||
error ADDRESS_ALREADY_EXISTS(address exists); | ||
error ADDRESS_NOT_EXISTS(address notExists); | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
VALIDATOR MANAGER | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
// ERC165 module errors | ||
error VALIDATOR_ERC165_FAIL(address validator); | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
HOOK MANAGER | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
error EMPTY_HOOK_ADDRESS(uint256 hookAndDataLength); | ||
error HOOK_ERC165_FAIL(address hookAddress, bool isValidation); | ||
error INVALID_KEY(bytes32 key); | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
AUTH | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
// Auth errors | ||
error NOT_FROM_BOOTLOADER(address notBootloader); | ||
error NOT_FROM_HOOK(address notHook); | ||
error NOT_FROM_SELF(address notSelf); | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
BatchCaller | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
// Batch caller errors | ||
error CALL_FAILED(uint256 batchCallIndex); | ||
error MSG_VALUE_MISMATCH(uint256 actualValue, uint256 expectedValue); | ||
} |
Oops, something went wrong.