Skip to content

Commit

Permalink
Create silent-buttons-peel.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs authored Oct 30, 2023
1 parent 9644c7f commit 4fdeced
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .changeset/silent-buttons-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@latticexyz/world-modules": minor
---

Adds the `ERC20Module` to `@latticexyz/world-modules`.
This module allows the registration of `ERC20` tokens in an existing World.

Important note: this module has not been audited yet, so any production use is discouraged for now.

```solidity
import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol";
import { IERC20Mintable } from "@latticexyz/world-modules/src/modules/erc20-puppet/IERC20Mintable.sol";
import { registerERC20 } from "@latticexyz/world-modules/src/modules/erc20-puppet/registerERC20.sol";
// The ERC20 module requires the Puppet module to be installed first
world.installModule(new PuppetModule(), new bytes(0));
// After the Puppet module is installed, new ERC20 tokens can be registered
IERC20Mintable token = registerERC20(world, "myERC20", ERC20MetadataData({ decimals: 18, name: "Token", symbol: "TKN" }));
```

0 comments on commit 4fdeced

Please sign in to comment.