Smart Contract Debugger: Contract Testing
1.1 Smart Contract Debugger Overview
1.2 Using Hardhat for Contract Testing
Setting Up Hardhat
npm install --save-dev hardhat
npx hardhatHardhat Test Script
// SimpleToken.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract SimpleToken is ERC20 {
constructor(uint256 initialSupply) ERC20("SimpleToken", "STK") {
_mint(msg.sender, initialSupply);
}
}1.3 Using Ganache for Contract Testing
Setting Up Ganache
Connecting Hardhat to Ganache
1.4 Testing
Deploying and Debugging with Ganache
PreviousWeb3 Dev Toolkit: Libraries and FrameworksNextChain Interoperability Tool: Building Cross-Chain Applications
Last updated
