Skip to main content

Module IMegaAccessControl

Module IMegaAccessControl 

Source
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§

DisabledByParent
@notice Re-enabling was attempted but a parent frame disabled access. Custom error with signature DisabledByParent() and selector 0xd089bae0.
NonZeroTransfer
@notice The call carries non-zero transferred ETH for a view/control method. Custom error with signature NonZeroTransfer() and selector 0xfa37501e.
NotIntercepted
@notice The call was not intercepted by the EVM (called on unsupported network). Custom error with signature NotIntercepted() and selector 0x1894f076.
VolatileDataAccessDisabled
@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 selector 0x09416ebd.
disableVolatileDataAccessCall
@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 signature disableVolatileDataAccess() and selector 0xc62e8daf.
disableVolatileDataAccessReturn
@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 the disableVolatileDataAccess() function.
enableVolatileDataAccessCall
@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 signature enableVolatileDataAccess() and selector 0x143d63fd.
enableVolatileDataAccessReturn
@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 the enableVolatileDataAccess() function.
isVolatileDataAccessDisabledCall
@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 selector 0x15f95280.
isVolatileDataAccessDisabledReturn
@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§

IMegaAccessControlCalls
Container for all the IMegaAccessControl function calls.
IMegaAccessControlErrors
Container for all the IMegaAccessControl custom errors.
VolatileDataAccessType
@notice Enum identifying the type of volatile data that was accessed. @dev Discriminant values match the bit positions in the VolatileDataAccess bitmap.