Hello,
Are there any templates for ERC20, ERC721 tokens testing? I wrote some contracts that will be used in mainnet and they have pretty standard (OpenZeppelin standard) implementation. So I'm wondering is there some Mocha templates I can reuse, instead of writing my tests from nothing?
Nov 3, 2021, 1:42 PM
there are some Solidity templates that include tests but Hardhat has Mocha included (I think?)
here are example tests: https://github.com/randomsounds-wtf/contracts/blob/master/tests/RSNFT.test.ts
here are example tests: https://github.com/randomsounds-wtf/contracts/blob/master/tests/RSNFT.test.ts
Nov 3, 2021, 2:49 PM
Yes, hardhat includes mocha, but there are no templates for testing. Or I'm missing something?
Thanks for the link, will check!
Thanks for the link, will check!
Nov 3, 2021, 2:50 PM
what kinds of templates would you expect?
Nov 3, 2021, 2:51 PM
Tests for basic functions as "transfer", "approve", etc. I just don't want to write same code as are already written by hundreds of developers :) I thought there might be something ready to use
Nov 3, 2021, 2:52 PM
why would you test built-in ERC20 functions?
Nov 3, 2021, 2:52 PM
I created contract using OpenZeppelin wizard, it uses few extensions. So I want to test it just to be sure that everything works as expected
Nov 3, 2021, 2:54 PM
then I don't think there any templates
Nov 3, 2021, 3:05 PM