relevant tag icon
Euler Dispatcher
copy icon
euler-xyz
• version 1.0.0
Dispatcher
Storage
Finance

Euler Dispatcher

Other than the proxies, contracts/Euler.sol is the only other code that cannot be upgraded. It is the implementation of the main Euler contract. Essentially its only job is to be a placeholder address for the Euler storage, and to delegatecall() to the appropriate modules. When it invokes a module, contracts/Euler.sol:dispatch() appends some extra data onto the end of the msg.data it receives from the proxy: -Its own view of msg.sender, which corresponds to the address of the proxy. -The msgSender passed in from the (trusted) proxy, which corresponds to the original msg.sender that invoked the proxy.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

euler-xyz

Last Publish

1/16/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
moduleIdToImplementation() :
This function is used to look up the address of a module given its module ID. It works by accessing the moduleLookup mapping, which stores the module ID as the key and the address of the module as the value. The function takes in a module ID as an argument and returns the address of the corresponding module. (autogenerated documentation)
moduleIdToProxy() :
This function is used to look up the address of a proxy contract associated with a given module ID. It takes a uint moduleId as an input and returns an address. The function works by accessing the proxyLookup mapping, which stores the moduleId as the key and the address of the associated proxy contract as the value. The function then returns the address associated with the given moduleId. (autogenerated documentation)
dispatch() :
This function is used to dispatch a message to a module implementation. It first checks that the sender is trusted, and then looks up the module implementation address if it is not already known. It then copies the message data into memory, appends the caller address to the end of the data, and calls the module implementation. Finally, it returns the data from the module implementation, or reverts if the call failed. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i euler-dispatcher
copy icon

Last Publish

1/16/2023

Version

1.0.0

Creator

euler-xyz

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.