Kernel

contract Kernel

is IKernel, KernelStorage, KernelAppIds, KernelNamespaceConstants, Petrifiable, IsContract, VaultRecoverable, AppProxyFactory, ACLSyntaxSugar

Source: contracts/kernel/Kernel.sol

Index

Reference

Modifiers

auth

modifier`` auth(bytes32 _role, uint256[] _params)


Parameters:

  • _role - bytes32

  • _params - uint256[]

Functions

APP_ADDR_NAMESPACE

function`` APP_ADDR_NAMESPACE() external pure returns (bytes32)


Returns:

  • bytes32

APP_BASES_NAMESPACE

function`` APP_BASES_NAMESPACE() external pure returns (bytes32)


Returns:

  • bytes32

CORE_NAMESPACE

function`` CORE_NAMESPACE() external pure returns (bytes32)


Returns:

  • bytes32

DEFAULT_ACL_APP_ID

function`` DEFAULT_ACL_APP_ID() external pure returns (bytes32)


Returns:

  • bytes32

KERNEL_APP_ID

function`` KERNEL_APP_ID() external pure returns (bytes32)


Returns:

  • bytes32

_setApp

function`` _setApp(bytes32 _namespace, bytes32 _appId, address _app) internal


Parameters:

  • _namespace - bytes32

  • _appId - bytes32

  • _app - address

_setAppIfNew

function`` _setAppIfNew(bytes32 _namespace, bytes32 _appId, address _app) internal


Parameters:

  • _namespace - bytes32

  • _appId - bytes32

  • _app - address

acl

function`` acl() public view returns (IACL)


Get the installed ACL app.

Returns:

  • ACL app

fallback

function (bool _shouldPetrify) public


Constructor that allows the deployer to choose if the base instance should be petrified immediately.

Parameters:

  • _shouldPetrify - Immediately petrify this instance so that it can never be initialized

getApp

function`` getApp(bytes32 _namespace, bytes32 _appId) public view returns (address)


Get the address of an app instance or base implementation.

Parameters:

  • _namespace - App namespace to use

  • _appId - Identifier for appReturns:Address of the app

getRecoveryVault

function`` getRecoveryVault() public view returns (address)


Get the address of the recovery Vault instance (to recover funds).

Returns:

  • Address of the Vault

hasPermission

function`` hasPermission(address _who, address _where, bytes32 _what, bytes _how) public view returns (bool)


Function called by apps to check ACL on kernel or to check permission status.

Parameters:

  • _who - Sender of the original call

  • _where - Address of the app

  • _what - Identifier for a group of actions in app

  • _how - Extra data for ACL auth

Returns:

  • Boolean indicating whether the ACL allows the role or not. Always returns false if the kernel hasn't been initialized yet.

initialize

function`` initialize(IACL _baseAcl, address _permissionsCreator) public


Initialize can only be called once. It saves the block number in which it was initialized., Initialize this kernel instance along with its ACL and set `_permissionsCreator` as the entity that can create other permissions.

Modifiers:

Parameters:

  • _baseAcl - Address of base ACL app

  • _permissionsCreator - Entity that will be given permission over createPermission

newAppInstance

function`` newAppInstance(bytes32 _appId, address _appBase) public returns (ERCProxy)


Create a new instance of an app linked to this kernel, Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`.

Modifiers:

Parameters:

  • _appId - Identifier for app

  • _appBase - Address of the app's base implementation

Returns:

  • AppProxy instance

newAppInstance

function`` newAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault) public returns (ERCProxy)


Create a new instance of an app linked to this kernel and set its base implementation if it was not already set, Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`.

Modifiers:

Parameters:

  • _appId - Identifier for app

  • _appBase - Address of the app's base implementation

  • _initializePayload - Payload for call made by the proxy during its construction to initialize

  • _setDefault - Whether the app proxy app is the default one. Useful when the Kernel needs to know of an instance of a particular app, like Vault for escape hatch mechanism.

Returns:

  • AppProxy instance

newPinnedAppInstance

function`` newPinnedAppInstance(bytes32 _appId, address _appBase) public returns (ERCProxy)


Create a new pinned instance of an app linked to this kernel, Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`.

Modifiers:

Parameters:

  • _appId - Identifier for app

  • _appBase - Address of the app's base implementation

Returns:

  • AppProxy instance

newPinnedAppInstance

function`` newPinnedAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault) public returns (ERCProxy)


Create a new pinned instance of an app linked to this kernel and set its base implementation if it was not already set, Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`.

Modifiers:

Parameters:

  • _appId - Identifier for app

  • _appBase - Address of the app's base implementation

  • _initializePayload - Payload for call made by the proxy during its construction to initialize

  • _setDefault - Whether the app proxy app is the default one. Useful when the Kernel needs to know of an instance of a particular app, like Vault for escape hatch mechanism.

Returns:

  • AppProxy instance

setApp

function`` setApp(bytes32 _namespace, bytes32 _appId, address _app) public


Set the resolving address of an app instance or base implementation, Set the resolving address of `_appId` in namespace `_namespace` to `_app`.

Modifiers:

Parameters:

  • _namespace - App namespace to use

  • _appId - Identifier for app

  • _app - Address of the app instance or base implementation

Returns:

  • ID of app

setRecoveryVaultAppId

function`` setRecoveryVaultAppId(bytes32 _recoveryVaultAppId) public


Set the default vault id for the escape hatch mechanism.

Modifiers:

Parameters:

  • _recoveryVaultAppId - Identifier of the recovery vault app

Last updated