Skip to content

Commit

Permalink
revert with AlreadyInstalled if already installed
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Oct 18, 2023
1 parent 9288aa1 commit 22481e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/world-modules/src/modules/erc20/ERC20Module.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ contract ERC20Module is Module {
}

function install(bytes memory args) public {
// Require the module to not be installed with these args yet
if (InstalledModules.get(MODULE_NAME, keccak256(args)) != address(0)) {
revert Module_AlreadyInstalled();
}

// Extract args
(bytes14 namespace, MetadataData memory metadata) = abi.decode(args, (bytes14, MetadataData));

Expand Down

0 comments on commit 22481e7

Please sign in to comment.