truffle单元测试的使用
引入@openzeppelin/test-helpers
const { ether, BN, expectRevert, expectEvent, constants, time, balance, send } = require('@openzeppelin/test-helpers');
引入@openzeppelin/test-helpers
const { ether, BN, expectRevert, expectEvent, constants, time, balance, send } = require('@openzeppelin/test-helpers');
npm install -g truffle-flattener
because some new features in solidity 0.8.x might go wrong by [email protected], so after installed, run code below again:
inpm nstall -g https://github.com/jplew/truffle-flattener
usage:
truffle-flattener ./contracts/MyContract.sol > ./flatten/MyContractFlatten.sol
and then put faltten code as single solidity file to bscscan