Postinstall fix for [email protected]
.
The problem and solution are described here: github.com/rkalis/truffle-plugin-verify/issues/181
When using the --via-ir
(viaIR: true
) compiler option,
the plugin cannot verify the smart contract and produces this error:
Fail - Unable to verify. Compiled contract deployment bytecode does NOT match the transaction deployment bytecode.
Automatic file replacement called by postinstall
script.
Copy the files /scripts/fix-truffle-plugin-verify-for-via-ir.js
and /scripts/data/util.js
into your project
and upgrade the package.json
.
...
"scripts": {
"postinstall": "node ./scripts/fix-truffle-plugin-verify-for-via-ir.js",
...
},
...
yarn install
Compiler options are defined in the file /truffle-config.js.
After successful compilation, smart contract appear in /flatten folder, which already include all dependencies in one file.
yarn compile
In a different terminal:
yarn ganache
yarn test
yarn deploy development
Make /.env
file from /.env.example
.
Fill in the environment variable data:
- MNEMONIC - Seed phrase (24 words) for the deployer wallet.
- ENDPOINT_SEPOLIA - See infura.io/ or alchemy.com or any public endpoin.
- ENDPOINT_ETHEREUM - See infura.io/ or alchemy.com or any public endpoin.
- API_ETHERSCAN - etherscan.io/myapikey.
- API_BSCSCAN - bscscan.com/myapikey.
yarn deploy sepolia
yarn verify sepolia Migrations