Skip to content

Commit

Permalink
Update documentation to notify the user about Proxy functions clashing (
Browse files Browse the repository at this point in the history
#1481)

* Update documentation to notify the user about Proxy functions clashing

* Update README.md
  • Loading branch information
mjlescano committed Mar 1, 2023
1 parent 790342e commit 066e86c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -45,6 +45,8 @@ All projects in this monorepo that involve contracts use a proxy architecture de

See the [Router README](utils/router/README.md) for more details.

⚠️ When using the Router as an implementation of a UUPS [Universal Upgradeable Proxy Standard](https://eips.ethereum.org/EIPS/eip-1822) be aware that any of the public functions defined in the Proxy could clash and override any of the Router modules functions. A malicious proxy owner could use this type of obfuscation to have users run code which they do not want to run. You can imagine scenarios where the function names do not look similar but share a function selector. ⚠️

## Information for Developers

If you intend to develop in this repository, please read the following items.
Expand Down
4 changes: 2 additions & 2 deletions utils/router/README.md
Expand Up @@ -4,7 +4,7 @@ Solidity router generator.

## Description

This hardhat plugin generates a router contract which simply merges multiple contracts (modules) behind a single proxy.
This plugin generates a router contract which simply merges multiple contracts (modules) behind a single proxy.

The router proxy receives incoming calls and forwards them to the appropriate implementation or module, depending on which one contains the incoming function selector.

Expand Down Expand Up @@ -211,7 +211,7 @@ Since the router `DELEGATECALL`s to its modules, they storage will never be used

If the router is used as the implementation of a UUPS [Universal Upgradeable Proxy Standard](https://eips.ethereum.org/EIPS/eip-1822) proxy, and includes an UpgradeModule, it can be used to design complex systems which are upgradeable until the main proxy is upgraded to a router implementation that no longer has an UpgradeModule.

This plugin will deploy a proxy and set its implementation as the router.
⚠️ Make sure that the UUPS contract does not contain public facing functions becuase they could clash with function signatures from the implementation modules. ⚠️

### Plugin configuration

Expand Down

0 comments on commit 066e86c

Please sign in to comment.