Skip to content

faet: added erc20 and erc721 contracts and tests#11

Open
francoperez03 wants to merge 1 commit intomainfrom
feat/MT-9-create-token-template
Open

faet: added erc20 and erc721 contracts and tests#11
francoperez03 wants to merge 1 commit intomainfrom
feat/MT-9-create-token-template

Conversation

@francoperez03
Copy link
Copy Markdown

The following components have been completed:

  • 🧾 ERC20 Contract (erc20.sol)
  • 🧾 ERC721 Contract (erc721.sol)
  • 🚀 Hardhat Ignition Modules for both contracts
    • MyTokenModule.ts
    • MyNFTModule.ts
  • 🧪 Test suites for both contracts

Copy link
Copy Markdown

@chescalante chescalante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple of changes

Comment on lines -19 to +24
# web3
packages/web3/.dist
packages/web3/node_modules
packages/web3/.env
packages/web3/cache
packages/web3/artifacts
# contracts
packages/contracts/.dist
packages/contracts/node_modules
packages/contracts/.env
packages/contracts/cache
packages/contracts/artifacts
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we call the folder hardhat? because it's a bit confusing having contracts/contracts/**

Copy link
Copy Markdown

@luchopcerra luchopcerra Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chescalante @francoperez03 why we're renaming from web3 --> contracts in the first place ?

import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";

contract MyToken is ERC20, ERC20Burnable, Ownable {
constructor(uint256 initialSupply) ERC20("MyToken", "MTK") Ownable(msg.sender) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
constructor(uint256 initialSupply) ERC20("MyToken", "MTK") Ownable(msg.sender) {
constructor(uint256 initialSupply, tokenName, tokenSymbol) ERC20(tokenName, tokenSymbol) Ownable(msg.sender) {

could we make it a generic erc20?

contract MyNFT is ERC721, Ownable {
uint256 private _nextTokenId;

constructor() ERC721("MyNFT", "MNFT") Ownable(msg.sender) {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
constructor() ERC721("MyNFT", "MNFT") Ownable(msg.sender) {}
constructor(tokenName, tokenSymbol) ERC721(tokenName, tokenSymbol) Ownable(msg.sender) {}

could we make it a generic too?

.object({
NETWORK_TESTNET: z.string().transform((x) => x as Address),
NETWORK_MAINNET: z.string().transform((x) => x as Address),
NETWORK_MAINNET: z.string().transform((x) => x as Address).optional(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NETWORK_MAINNET: z.string().transform((x) => x as Address).optional(),
NETWORK_MAINNET: z.string().transform((x) => x as Address).optional(),

this should be required, also we can add a default value pointing to OPTIMISM or BASE. Same for testnet env variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants