# Snapshot report for `src/zip-hardhat-polkadot.test.ts`
The actual snapshot is saved in `zip-hardhat-polkadot.test.ts.snap`.
Generated by [AVA](https://avajs.dev).
## erc20 full
> Snapshot 1
[
`contracts/MyToken.sol:␊
// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.5.0␊
pragma solidity ^0.8.27;␊
␊
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";␊
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";␊
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";␊
import {ERC20FlashMint} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20FlashMint.sol";␊
import {ERC20Pausable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol";␊
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";␊
import {ERC20Votes} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";␊
import {Nonces} from "@openzeppelin/contracts/utils/Nonces.sol";␊
␊
contract MyToken is ERC20, ERC20Burnable, ERC20Pausable, AccessControl, ERC20Permit, ERC20Votes, ERC20FlashMint {␊
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");␊
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");␊
␊
constructor(address recipient, address defaultAdmin, address pauser, address minter)␊
ERC20("My Token", "MTK")␊
ERC20Permit("My Token")␊
{␊
_mint(recipient, 2000 * 10 ** decimals());␊
_grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin);␊
_grantRole(PAUSER_ROLE, pauser);␊
_grantRole(MINTER_ROLE, minter);␊
}␊
␊
function pause() public onlyRole(PAUSER_ROLE) {␊
_pause();␊
}␊
␊
function unpause() public onlyRole(PAUSER_ROLE) {␊
_unpause();␊
}␊
␊
function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {␊
_mint(to, amount);␊
}␊
␊
// The following functions are overrides required by Solidity.␊
␊
function _update(address from, address to, uint256 value)␊
internal␊
override(ERC20, ERC20Pausable, ERC20Votes)␊
{␊
super._update(from, to, value);␊
}␊
␊
function nonces(address owner)␊
public␊
view␊
override(ERC20Permit, Nonces)␊
returns (uint256)␊
{␊
return super.nonces(owner);␊
}␊
}␊
`,
`hardhat.config.ts:␊
import { HardhatUserConfig } from "hardhat/config";␊
import "@nomicfoundation/hardhat-toolbox";␊
import "@parity/hardhat-polkadot";␊
␊
␊
const config: HardhatUserConfig = {␊
solidity: {␊
version: "0.8.27",␊
settings: {␊
evmVersion: 'cancun',␊
optimizer: {␊
enabled: true,␊
},␊
},␊
},␊
resolc: {␊
compilerSource: 'npm',␊
},␊
networks: {␊
hardhat: {␊
polkavm: true,␊
nodeConfig: {␊
nodeBinaryPath: 'INSERT_PATH_TO_REVIVE_DEV_NODE',␊
rpcPort: 8000,␊
dev: true,␊
},␊
adapterConfig: {␊
adapterBinaryPath: 'INSERT_PATH_TO_ETH_RPC_ADAPTER',␊
dev: true,␊
},␊
},␊
},␊
};␊
␊
export default config;␊
`,
`package.json:␊
{␊
"name": "hardhat-sample",␊
"version": "0.0.1",␊
"description": "",␊
"main": "index.js",␊
"scripts": {␊
"test": "hardhat test"␊
},␊
"author": "",␊
"license": "MIT",␊
"devDependencies": {␊
"@openzeppelin/contracts": "^5.5.0",␊
"@parity/hardhat-polkadot": "^0.2.7",␊
"@nomicfoundation/hardhat-toolbox": "^6.1.0",␊
"hardhat": "^2.22.0"␊
}␊
}`,
`ignition/modules/MyToken.ts:␊
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";␊
␊
export default buildModule("MyTokenModule", (m) => {␊
␊
// TODO: Set values for the constructor arguments below␊
const myToken = m.contract("MyToken", [recipient, defaultAdmin, pauser, minter]);␊
␊
return { myToken };␊
});␊
`,
`test/test.ts:␊
import { expect } from "chai";␊
import { ethers } from "hardhat";␊
␊
describe("MyToken", function () {␊
it("Test contract", async function () {␊
const ContractFactory = await ethers.getContractFactory("MyToken");␊
␊
const recipient = (await ethers.getSigners())[0].address;␊
const defaultAdmin = (await ethers.getSigners())[1].address;␊
const pauser = (await ethers.getSigners())[2].address;␊
const minter = (await ethers.getSigners())[3].address;␊
␊
const instance = await ContractFactory.deploy(recipient, defaultAdmin, pauser, minter);␊
await instance.waitForDeployment();␊
␊
expect(await instance.name()).to.equal("My Token");␊
});␊
});␊
`,
`README.md:␊
# Sample Hardhat Project␊
␊
This project demonstrates a basic Hardhat use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, and a Hardhat Ignition module that deploys that contract.␊
␊
## Prerequisites␊
␊
Ensure you have the following installed:␊
- [Node.js 22.5+](https://nodejs.org/en/download/)␊
- npm 10.9.0+␊
␊
## Installing dependencies␊
␊
\`\`\`␊
npm install␊
\`\`\`␊
␊
## Setting up a testing environment␊
␊
Follow the steps in [Polkadot's documentation](https://docs.polkadot.com/smart-contracts/dev-environments/local-dev-node/) to set up a local development node and replace the placeholder values \`INSERT_PATH_TO_REVIVE_DEV_NODE\` and \`INSERT_PATH_TO_ETH_RPC_ADAPTER\` in \`hardhat.config.ts\`.␊
␊
## Testing the contract␊
␊
\`\`\`␊
npm test␊
\`\`\`␊
␊
## Deploying the contract␊
␊
You can target any network from your Hardhat config using:␊
␊
\`\`\`␊
npx hardhat ignition deploy ignition/modules/MyToken.ts --network <network-name>␊
\`\`\`␊
`,
`.gitignore:␊
node_modules␊
.env␊
coverage␊
coverage.json␊
typechain␊
typechain-types␊
␊
# Hardhat files␊
cache␊
artifacts␊
␊
# Hardhat Ignition default folder for deployments against a local Polkadot Revive Dev node␊
ignition/deployments/chain-420420420␊
`,
]
## erc721 basic
> Snapshot 1
[
`contracts/MyToken.sol:␊
// SPDX-License-Identifier: MIT␊
// Compatible with OpenZeppelin Contracts ^5.5.0␊
pragma solidity ^0.8.27;␊
␊
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";␊
␊
contract MyToken is ERC721 {␊
constructor() ERC721("My Token", "MTK") {}␊
}␊
`,
`hardhat.config.ts:␊
import { HardhatUserConfig } from "hardhat/config";␊
import "@nomicfoundation/hardhat-toolbox";␊
import "@parity/hardhat-polkadot";␊
␊
␊
const config: HardhatUserConfig = {␊
solidity: {␊
version: "0.8.27",␊
settings: {␊
evmVersion: 'cancun',␊
optimizer: {␊
enabled: true,␊
},␊
},␊
},␊
resolc: {␊
compilerSource: 'npm',␊
},␊
networks: {␊
hardhat: {␊
polkavm: true,␊
nodeConfig: {␊
nodeBinaryPath: 'INSERT_PATH_TO_REVIVE_DEV_NODE',␊
rpcPort: 8000,␊
dev: true,␊
},␊
adapterConfig: {␊
adapterBinaryPath: 'INSERT_PATH_TO_ETH_RPC_ADAPTER',␊
dev: true,␊
},␊
},␊
},␊
};␊
␊
export default config;␊
`,
`package.json:␊
{␊
"name": "hardhat-sample",␊
"version": "0.0.1",␊
"description": "",␊
"main": "index.js",␊
"scripts": {␊
"test": "hardhat test"␊
},␊
"author": "",␊
"license": "MIT",␊
"devDependencies": {␊
"@openzeppelin/contracts": "^5.5.0",␊
"@parity/hardhat-polkadot": "^0.2.7",␊
"@nomicfoundation/hardhat-toolbox": "^6.1.0",␊
"hardhat": "^2.22.0"␊
}␊
}`,
`ignition/modules/MyToken.ts:␊
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";␊
␊
export default buildModule("MyTokenModule", (m) => {␊
␊
␊
const myToken = m.contract("MyToken", []);␊
␊
return { myToken };␊
});␊
`,
`test/test.ts:␊
import { expect } from "chai";␊
import { ethers } from "hardhat";␊
␊
describe("MyToken", function () {␊
it("Test contract", async function () {␊
const ContractFactory = await ethers.getContractFactory("MyToken");␊
␊
const instance = await ContractFactory.deploy();␊
await instance.waitForDeployment();␊
␊
expect(await instance.name()).to.equal("My Token");␊
});␊
});␊
`,
`README.md:␊
# Sample Hardhat Project␊
␊
This project demonstrates a basic Hardhat use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, and a Hardhat Ignition module that deploys that contract.␊
␊
## Prerequisites␊
␊
Ensure you have the following installed:␊
- [Node.js 22.5+](https://nodejs.org/en/download/)␊
- npm 10.9.0+␊
␊
## Installing dependencies␊
␊
\`\`\`␊
npm install␊
\`\`\`␊
␊
## Setting up a testing environment␊
␊
Follow the steps in [Polkadot's documentation](https://docs.polkadot.com/smart-contracts/dev-environments/local-dev-node/) to set up a local development node and replace the placeholder values \`INSERT_PATH_TO_REVIVE_DEV_NODE\` and \`INSERT_PATH_TO_ETH_RPC_ADAPTER\` in \`hardhat.config.ts\`.␊
␊
## Testing the contract␊
␊
\`\`\`␊
npm test␊
\`\`\`␊
␊
## Deploying the contract␊
␊
You can target any network from your Hardhat config using:␊
␊
\`\`\`␊
npx hardhat ignition deploy ignition/modules/MyToken.ts --network <network-name>␊
\`\`\`␊
`,
`.gitignore:␊
node_modules␊
.env␊
coverage␊
coverage.json␊
typechain␊
typechain-types␊
␊
# Hardhat files␊
cache␊
artifacts␊
␊
# Hardhat Ignition default folder for deployments against a local Polkadot Revive Dev node␊
ignition/deployments/chain-420420420␊
`,
]