Hi!
I created an ERC777 token and used solidity coverage to test it. Unfortunately,the test shows 0 coverage and after it is done, I get the following error:
> Istanbul reports written to ./coverage/ and ./coverage.json
> solidity-coverage cleaning up, shutting down ganache server
Error: while migrating ERC777Token: Returned error: VM Exception
while processing transaction: revert
at
/Users/Alex./node_modules/truffle/build/webpack:/packages/deployer/src
/deployment.js:365:1
at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.3.5 (core: 5.3.5)
Node v10.24.1
This is my truffle.js and .solcover.js files:
truffle.js
module.exports = {
networks: {
ganache: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
},
},
plugins: ["solidity-coverage"],
// Set default mocha options here, use special reporters etc.
mocha: {
timeout: 100000
},
// Configure your compilers
compilers: {
solc: {
version: "0.8.0", // Fetch exact version from solc-bin (default: truffle's
version)
// docker: true, // Use "0.5.1" you've installed locally with docker
(default: false)
// settings: { // See the solidity docs for advice about optimization and
evmVersion
// optimizer: {
// enabled: false,
// runs: 200
// },
// evmVersion: "byzantium"
// }
}
},
db: {
enabled: false
}
};
.solcover.js:
module.exports = {
port: 8555,
norpc: true,
deepSkip: true,
skipFiles: ['contracts/Migrations.sol']
};
package.json:
"name": "ERC777Token",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha --timeout 20000 -R mocha-multi --reporter-options
nyan=-,json=.results.json",
"coverage": "./node_modules/.bin/solidity-coverage"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@openzeppelin/test-environment": "^0.1.9",
"@truffle/hdwallet-provider": "^1.3.1",
"bn-chai": "^1.0.1",
"bn.js": "^5.2.0",
"chai-as-promised": "^7.1.1",
"dotenv": "^9.0.1",
"ganache-cli": "^6.12.2",
"mocha": "^8.4.0",
"openzeppelin-solidity": "^4.1.0"
},
"devDependencies": {
"@openzeppelin/contracts": "^4.1.0",
"@openzeppelin/test-helpers": "^0.5.11",
"@smartdec/smartcheck": "^2.0.1",
"chai": "^4.3.4",
"coveralls": "^3.1.0",
"solidity-coverage": "^0.8.0-beta.0",
"web3": "^1.3.5"
}
}
I tried with : npx truffle run coverage and npx truffle run coverage --network coverage both giving the same error. Am I missing something? This is my github repo in case you want to check it out https://github.com/faustinaedm/ERC777Test.git . Any help would be appreciated!