Skip to main content

IRouter

Methods

addPlugin

function addPlugin(IPluginMap.Plugin plugin) external nonpayable

Parameters

NameTypeDescription
pluginIPluginMap.Pluginundefined

getAllFunctionsOfPlugin

function getAllFunctionsOfPlugin(address pluginAddress) external view returns (bytes4[])

Returns all functions that are mapped to the given plug-in contract.

Parameters

NameTypeDescription
pluginAddressaddressundefined

Returns

NameTypeDescription
_0bytes4[]undefined

getAllPlugins

function getAllPlugins() external view returns (struct IPluginMap.Plugin[])

Returns all plug-ins known by Map.

Returns

NameTypeDescription
_0IPluginMap.Plugin[]undefined

getPluginForFunction

function getPluginForFunction(bytes4 functionSelector) external view returns (address)

Returns the plug-in contract for a given function.

Parameters

NameTypeDescription
functionSelectorbytes4undefined

Returns

NameTypeDescription
_0addressundefined

removePlugin

function removePlugin(bytes4 functionSelector) external nonpayable

Remove an existing plugin from the contract.

Parameters

NameTypeDescription
functionSelectorbytes4undefined

updatePlugin

function updatePlugin(IPluginMap.Plugin plugin) external nonpayable

Parameters

NameTypeDescription
pluginIPluginMap.Pluginundefined

Events

PluginAdded

event PluginAdded(bytes4 indexed functionSelector, address indexed pluginAddress)

Emitted when a functionality is added, or plugged-in.

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
pluginAddress indexedaddressundefined

PluginRemoved

event PluginRemoved(bytes4 indexed functionSelector, address indexed pluginAddress)

Emitted when a functionality is removed.

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
pluginAddress indexedaddressundefined

PluginSet

event PluginSet(bytes4 indexed functionSelector, string indexed functionSignature, address indexed pluginAddress)

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
functionSignature indexedstringundefined
pluginAddress indexedaddressundefined

PluginUpdated

event PluginUpdated(bytes4 indexed functionSelector, address indexed oldPluginAddress, address indexed newPluginAddress)

Emitted when a functionality is updated or overridden.

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
oldPluginAddress indexedaddressundefined
newPluginAddress indexedaddressundefined