-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide mock ERC-20 and ERC-721 contracts #469
Comments
I can work on this, but I don't think it would be a good decision for The only way to make it work is to copy and paste the wdyt? |
Great point @andreivladbrg; let's see what @mds1 and other Forge Std contributors have to say. |
This seems like a good idea. Agreed with the requirement of not adding and dependencies to forge-std. Similar to the interfaces directory, these should not be imported anywhere by default to avoid impacting compilation times, so they can live as standalone contracts in One consideration is the tokens added should support solidity 0.6.2 through 0.8.x. This means we'll have to implement checked math in the token directly, so we likely just can't copy an existing token out of the box. The easiest is probably to copy solmate's because it's a flat file and easy to read, then edit it to add checked math. The file should have comments indicating it's not for use in production, and include a comment with permalink to the original source it was based on. What devex do you think this better here?
I think I'd lean towards (2) to keep the token minimal, as it's always easier to add features if they end up being needed later, as opposed to removing them once users already rely on them. @andreivladbrg I've assigned this to you since you mentioned you can work on it, if that's no longer the case just let me know! |
I think this is the case only for
I agree, we should go for option 2.
Yes, will work on this |
also agree that option (2) is the way to go |
In OpenZeppelin v5, they have made the
ERC20
andERC721
contracts abstract:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/793d92a3331538d126033cbacb1ee5b8a7d95adc/contracts/token/ERC20/ERC20.sol#L34
This means that for testing purposes we all need to define a dummy ERC-20 contract like this:
The same requirement applies to ERC-721.
It would be helpful if Forge Std provided these mocks for users so they don't end up re-implemented all over GitHub.
The text was updated successfully, but these errors were encountered: