Expand description
@title IMegaAccessControl @notice Interface for the MegaAccessControl system contract. @dev This contract provides functions to control resource limits during EVM execution. Functions are intercepted by the MegaETH EVM and enforced at the execution level.
interface IMegaAccessControl {
enum VolatileDataAccessType { BlockNumber, Timestamp, Coinbase, Difficulty, GasLimit, BaseFee, PrevRandao, BlockHash, BlobBaseFee, BlobHash, Beneficiary, Oracle }
error NotIntercepted();
error NonZeroTransfer();
error VolatileDataAccessDisabled(VolatileDataAccessType accessType);
error DisabledByParent();
function disableVolatileDataAccess() external view;
function enableVolatileDataAccess() external view;
function isVolatileDataAccessDisabled() external view returns (bool disabled);
}Structs§
- Disabled
ByParent - @notice Re-enabling was attempted but a parent frame disabled access.
Custom error with signature
DisabledByParent()and selector0xd089bae0. - NonZero
Transfer - @notice The call carries non-zero transferred ETH for a view/control method.
Custom error with signature
NonZeroTransfer()and selector0xfa37501e. - NotIntercepted
- @notice The call was not intercepted by the EVM (called on unsupported network).
Custom error with signature
NotIntercepted()and selector0x1894f076. - Volatile
Data Access Disabled - @notice Volatile data access was attempted in a frame where it is disabled.
@param accessType The type of volatile data that was accessed.
Custom error with signature
VolatileDataAccessDisabled(uint8)and selector0x09416ebd. - disable
Volatile Data Access Call - @notice Disables volatile data access for the caller’s frame and all inner calls.
@dev When called, the caller’s own frame and any inner
CALL/STATICCALL/DELEGATECALL/CALLCODE that accesses volatile data
(block env fields, beneficiary balance, oracle) will revert with
VolatileDataAccessDisabled(). Available from Rex4 hardfork. Function with signaturedisableVolatileDataAccess()and selector0xc62e8daf. - disable
Volatile Data Access Return - @notice Disables volatile data access for the caller’s frame and all inner calls.
@dev When called, the caller’s own frame and any inner
CALL/STATICCALL/DELEGATECALL/CALLCODE that accesses volatile data
(block env fields, beneficiary balance, oracle) will revert with
VolatileDataAccessDisabled(). Available from Rex4 hardfork. Container type for the return parameters of thedisableVolatileDataAccess()function. - enable
Volatile Data Access Call - @notice Re-enables volatile data access for the caller’s frame and inner calls.
@dev Succeeds if access is not disabled, or the caller (or an ancestor at the
same depth) disabled it. Reverts with
DisabledByParent()if a parent frame disabled access. Available from Rex4 hardfork. Function with signatureenableVolatileDataAccess()and selector0x143d63fd. - enable
Volatile Data Access Return - @notice Re-enables volatile data access for the caller’s frame and inner calls.
@dev Succeeds if access is not disabled, or the caller (or an ancestor at the
same depth) disabled it. Reverts with
DisabledByParent()if a parent frame disabled access. Available from Rex4 hardfork. Container type for the return parameters of theenableVolatileDataAccess()function. - isVolatile
Data Access Disabled Call - @notice Queries whether volatile data access is disabled at the current call depth.
@return disabled True if volatile data access is disabled.
Function with signature
isVolatileDataAccessDisabled()and selector0x15f95280. - isVolatile
Data Access Disabled Return - @notice Queries whether volatile data access is disabled at the current call depth.
@return disabled True if volatile data access is disabled.
Container type for the return parameters of the
isVolatileDataAccessDisabled()function.
Enums§
- IMega
Access Control Calls - Container for all the
IMegaAccessControlfunction calls. - IMega
Access Control Errors - Container for all the
IMegaAccessControlcustom errors. - Volatile
Data Access Type - @notice Enum identifying the type of volatile data that was accessed. @dev Discriminant values match the bit positions in the VolatileDataAccess bitmap.