# \#truffle

**URL:** https://forum.openzeppelin.com/tag/truffle/41.md

[Latest](https://forum.openzeppelin.com/latest.md) · [Categories](https://forum.openzeppelin.com/categories.md) · [Tags](https://forum.openzeppelin.com/tags.md)

---

## [How to connect Web3js to Truffle local testnet hosted via Ganache?](https://forum.openzeppelin.com/t/how-to-connect-web3js-to-truffle-local-testnet-hosted-via-ganache/44623)

<div class="topic-metadata">

**Author:** [@Snowpiercer](https://forum.openzeppelin.com/u/Snowpiercer)\
**Replies:** 5\
**Last updated:** [July 27, 2025, 9:49pm UTC](https://forum.openzeppelin.com/t/how-to-connect-web3js-to-truffle-local-testnet-hosted-via-ganache/44623 "2025-07-27T21:49:22Z")

</div>

How do I connect web3JS to my locally hosted truffle session. I use async functions too regularly and I need some help.

---

## [Truffle refuses to work!](https://forum.openzeppelin.com/t/truffle-refuses-to-work/44593)

<div class="topic-metadata">

**Author:** [@Snowpiercer](https://forum.openzeppelin.com/u/Snowpiercer)\
**Replies:** 1\
**Last updated:** [July 22, 2025, 12:12am UTC](https://forum.openzeppelin.com/t/truffle-refuses-to-work/44593 "2025-07-22T00:12:03Z")

</div>

truffle --version /usr/local/lib/node\_modules/truffle/build/9129.bundled.js:80206 return \_this.outputFormatter && res ? \_this.outputFormatter(res, this?.hexFormat) : res; …

---

## [Deployment failed: code hit an invalid opcode while deploying](https://forum.openzeppelin.com/t/deployment-failed-code-hit-an-invalid-opcode-while-deploying/40199)

<div class="topic-metadata">

**Author:** [@Emkiddo](https://forum.openzeppelin.com/u/Emkiddo)\
**Replies:** 0\
**Last updated:** [April 12, 2024, 3:01pm UTC](https://forum.openzeppelin.com/t/deployment-failed-code-hit-an-invalid-opcode-while-deploying/40199 "2024-04-12T15:01:25Z")

</div>

This is a token maker code, so its failing to deploy with the following reason: Deployment Failed "TokenMaker" hit an invalid opcode while deploying. Try: \* Verifying that your constructor params satisfy all assert …

---

## [Fixing "Invalid OpCode" Truffle Error with Openzeppelin Library Installed](https://forum.openzeppelin.com/t/fixing-invalid-opcode-truffle-error-with-openzeppelin-library-installed/39913)

<div class="topic-metadata">

**Author:** [@Minmin](https://forum.openzeppelin.com/u/Minmin)\
**Replies:** 0\
**Last updated:** [March 18, 2024, 1:16pm UTC](https://forum.openzeppelin.com/t/fixing-invalid-opcode-truffle-error-with-openzeppelin-library-installed/39913 "2024-03-18T13:16:33Z")

</div>

Hi. I am new to blockchain development. I am currently using Solidity + Truffle + Ganache on VS Code. I am also using the Openzeppelin Library. So I created this very simple contract that basically is an ERC20 Token (cod…

---

## [My compiler says that the @openzeppelin contracts don't match the compiler!](https://forum.openzeppelin.com/t/my-compiler-says-that-the-openzeppelin-contracts-dont-match-the-compiler/22810)

<div class="topic-metadata">

**Author:** [@ShadowQueen639](https://forum.openzeppelin.com/u/ShadowQueen639)\
**Replies:** 5\
**Last updated:** [November 23, 2023, 1:22pm UTC](https://forum.openzeppelin.com/t/my-compiler-says-that-the-openzeppelin-contracts-dont-match-the-compiler/22810 "2023-11-23T13:22:34Z")

</div>

I'm trying to create my first smart contract. It's for ERC721 and I'm using Visual Studios. I have run into the same problem while trying to use 2 different programs (I tried to change programs when one wouldn't work and…

---

## [Truffle Imports of OpenZeppelin Contracts fail for art NFT (Factory ERC 1155 smart contract)](https://forum.openzeppelin.com/t/truffle-imports-of-openzeppelin-contracts-fail-for-art-nft-factory-erc-1155-smart-contract/38201)

<div class="topic-metadata">

**Author:** [@LG102023](https://forum.openzeppelin.com/u/LG102023)\
**Replies:** 4\
**Last updated:** [October 24, 2023, 4:09pm UTC](https://forum.openzeppelin.com/t/truffle-imports-of-openzeppelin-contracts-fail-for-art-nft-factory-erc-1155-smart-contract/38201 "2023-10-24T16:09:02Z")

</div>

Hello everybody. I am new here ... so I hope its the right place. I am not a professoinal developer with coding skills. Mostly I follow tutorials, e.g. I know how to install Linux (ubuntu) or setup a server for wordpress…

---

## [Hello Community. Would like to start a conversation concerning enclosed DEX clone project, Transwap.us. Anyone looking to be apart of its development? Launch date set for early May. Looking for Full Stack Developers; Solidity, smart contract capable](https://forum.openzeppelin.com/t/hello-community-would-like-to-start-a-conversation-concerning-enclosed-dex-clone-project-transwap-us-anyone-looking-to-be-apart-of-its-development-launch-date-set-for-early-may-looking-for-full-stack-developers-solidity-smart-contract-capable/35818)

<div class="topic-metadata">

**Author:** [@Rousix](https://forum.openzeppelin.com/u/Rousix)\
**Replies:** 0\
**Last updated:** [April 20, 2023, 7:01pm UTC](https://forum.openzeppelin.com/t/hello-community-would-like-to-start-a-conversation-concerning-enclosed-dex-clone-project-transwap-us-anyone-looking-to-be-apart-of-its-development-launch-date-set-for-early-may-looking-for-full-stack-developers-solidity-smart-contract-capable/35818 "2023-04-20T19:01:01Z")

</div>

:1234: Code to reproduce :laptop: Environment

---

## [Clones not verified under OpenZeppelin Contracts 4.2 or Solidity 0.8.6](https://forum.openzeppelin.com/t/clones-not-verified-under-openzeppelin-contracts-4-2-or-solidity-0-8-6/12134)

<div class="topic-metadata">

**Author:** [@Neo](https://forum.openzeppelin.com/u/Neo)\
**Replies:** 6\
**Last updated:** [July 21, 2021, 2:25am UTC](https://forum.openzeppelin.com/t/clones-not-verified-under-openzeppelin-contracts-4-2-or-solidity-0-8-6/12134 "2021-07-21T02:25:41Z")

</div>

Clones (minimal proxies) created where the factory and implementation contracts use OpenZeppelin Contracts 4.2 are not verified on Etherscan. They're only verified under 4.1. And only as long as Solidity 0.8.5 is used (h…

---

## [Uncaught Error: Returned error: VM Exception while processing transaction: revert](https://forum.openzeppelin.com/t/uncaught-error-returned-error-vm-exception-while-processing-transaction-revert/33023)

<div class="topic-metadata">

**Author:** [@Golanger](https://forum.openzeppelin.com/u/Golanger)\
**Replies:** 2\
**Last updated:** [November 17, 2022, 4:27pm UTC](https://forum.openzeppelin.com/t/uncaught-error-returned-error-vm-exception-while-processing-transaction-revert/33023 "2022-11-17T16:27:16Z")

</div>

Hi, i get the above error meesage when i follow each steps highlighted in the OPENZEPPELIN upgrades tutorial here: OpenZeppelin Upgrades: Step by Step Tutorial for Truffle Can you advise me why this is happening? This i…

---

## [How to verify TransparentUpgradeableProxy](https://forum.openzeppelin.com/t/how-to-verify-transparentupgradeableproxy/31961)

<div class="topic-metadata">

**Author:** [@ner0](https://forum.openzeppelin.com/u/ner0)\
**Replies:** 1\
**Last updated:** [September 22, 2022, 1:03pm UTC](https://forum.openzeppelin.com/t/how-to-verify-transparentupgradeableproxy/31961 "2022-09-22T13:03:34Z")

</div>

const nft = await deployProxy(NFT, \["Test"\],{ deployer }); I'm using truffle to deploy and when I'm done deploying there are two contracts deployed: 1. NFT 2. TransparentUpgradeableProxy. and I want to verify Transparen…

---

## [Upgrades + hardhat-truffle5](https://forum.openzeppelin.com/t/upgrades-hardhat-truffle5/30883)

<div class="topic-metadata">

**Author:** [@arthurka.eth](https://forum.openzeppelin.com/u/arthurka.eth)\
**Replies:** 4\
**Last updated:** [August 11, 2022, 10:12pm UTC](https://forum.openzeppelin.com/t/upgrades-hardhat-truffle5/30883 "2022-08-11T22:12:54Z")

</div>

Hi everyone :wave: Hope you're having a great day. TL;DR: is it possible to use OpenZeppelin Upgrades plugin with @nomiclabs/hardhat-truffle5 and not make changes in tests? I'm working with a fork of some protocol. Pro…

---

## [Truffle flattener is not working on a smart contract which has @openzeppelin/contract3.4.0 version imported.](https://forum.openzeppelin.com/t/truffle-flattener-is-not-working-on-a-smart-contract-which-has-openzeppelin-contract3-4-0-version-imported/30179)

<div class="topic-metadata">

**Author:** [@Mazher\_Hussain](https://forum.openzeppelin.com/u/Mazher_Hussain)\
**Replies:** 1\
**Last updated:** [July 8, 2022, 2:37pm UTC](https://forum.openzeppelin.com/t/truffle-flattener-is-not-working-on-a-smart-contract-which-has-openzeppelin-contract3-4-0-version-imported/30179 "2022-07-08T14:37:56Z")

</div>

After running command npx truffle-flattener ./contracts/SimpleCollectible.sol \> ./contracts/FlatSimpleCollectible.sol I am getting an error Error: ENOENT: no such file or directory, open 'c:/Users/Unity%20GG/Desktop/so…

---

## [Error: Global Truffle config not found: Truffle \>=5.1.35 is required](https://forum.openzeppelin.com/t/error-global-truffle-config-not-found-truffle-5-1-35-is-required/4797)

<div class="topic-metadata">

**Author:** [@sarang](https://forum.openzeppelin.com/u/sarang)\
**Replies:** 4\
**Last updated:** [November 30, 2020, 2:04pm UTC](https://forum.openzeppelin.com/t/error-global-truffle-config-not-found-truffle-5-1-35-is-required/4797 "2020-11-30T14:04:45Z")

</div>

:computer: Environment Truffle v5.1.5 (core: 5.1.5) Solidity - 0.6.0 (solc-js) Node v12.18.2 Web3.js v1.2.1 :memo:Details I’m following the Smart Contract Upgrade tutorial from the docs - https://docs.openzeppelin.…

---

## [Can't initialize state variable in proxy contract on deployment in UUPS pattern](https://forum.openzeppelin.com/t/cant-initialize-state-variable-in-proxy-contract-on-deployment-in-uups-pattern/29401)

<div class="topic-metadata">

**Author:** [@amopze](https://forum.openzeppelin.com/u/amopze)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 9:21pm UTC](https://forum.openzeppelin.com/t/cant-initialize-state-variable-in-proxy-contract-on-deployment-in-uups-pattern/29401 "2022-06-08T21:21:15Z")

</div>

I wrote the following proxy contract: contract ExampleContract is Initializable, UUPSUpgradeable, OwnableUpgradeable { uint public counter; function initialize(uint \_counter) public initializer { \_\_Ownable\_init…

---

## [TypeError: Cannot read property 'slice' of undefined](https://forum.openzeppelin.com/t/typeerror-cannot-read-property-slice-of-undefined/8938)

<div class="topic-metadata">

**Author:** [@Ayamt](https://forum.openzeppelin.com/u/Ayamt)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 2:39am UTC](https://forum.openzeppelin.com/t/typeerror-cannot-read-property-slice-of-undefined/8938 "2022-04-21T02:39:00Z")

</div>

Hello, I encountered the same problem with the new version solc compiler. My contract: pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20 { constructor(uint…

---

## [RejectedWith from Chai library is throwing me an error](https://forum.openzeppelin.com/t/rejectedwith-from-chai-library-is-throwing-me-an-error/27754)

<div class="topic-metadata">

**Author:** [@Michouc](https://forum.openzeppelin.com/u/Michouc)\
**Replies:** 0\
**Last updated:** [April 18, 2022, 9:30pm UTC](https://forum.openzeppelin.com/t/rejectedwith-from-chai-library-is-throwing-me-an-error/27754 "2022-04-18T21:30:13Z")

</div>

I'm learning solidity with a course but I'm stuck with an error. My version of Chai : "chai": "^4.3.6", "chai-as-promised": "^7.1.1", "chai-bignumber": "^3.0.0", The way I use it in my code : require('chai').use(requ…

---

## [Import errors from previously working project](https://forum.openzeppelin.com/t/import-errors-from-previously-working-project/12173)

<div class="topic-metadata">

**Author:** [@ThomasEnder](https://forum.openzeppelin.com/u/ThomasEnder)\
**Replies:** 5\
**Last updated:** [March 30, 2022, 9:33pm UTC](https://forum.openzeppelin.com/t/import-errors-from-previously-working-project/12173 "2022-03-30T21:33:46Z")

</div>

Hi everyone, running into this error with a project that was compiling and migrating fine some 6 weeks ago. Now it is broken without me changing anything. ParserError: Source "/C/Users/sound/Desktop/MOTD/meme-repo-copy…

---

## [artifacts.require('./RefundEscrow');](https://forum.openzeppelin.com/t/artifacts-require-refundescrow/6784)

<div class="topic-metadata">

**Author:** [@Ahmed\_Awadallah](https://forum.openzeppelin.com/u/Ahmed_Awadallah)\
**Replies:** 15\
**Last updated:** [March 13, 2022, 5:13am UTC](https://forum.openzeppelin.com/t/artifacts-require-refundescrow/6784 "2022-03-13T05:13:10Z")

</div>

I’m trying to call the below contract in the test file: const RefundEscrow = artifacts.require('./RefundEscrow'); But I get the following error: Error: Could not find artifacts for ./RefundEscrow from any sources Not…

---

## [how to deal with contract versions and test smart contracts for upgrade compatibility](https://forum.openzeppelin.com/t/how-to-deal-with-contract-versions-and-test-smart-contracts-for-upgrade-compatibility/25753)

<div class="topic-metadata">

**Author:** [@marasiali](https://forum.openzeppelin.com/u/marasiali)\
**Replies:** 4\
**Last updated:** [March 9, 2022, 1:49am UTC](https://forum.openzeppelin.com/t/how-to-deal-with-contract-versions-and-test-smart-contracts-for-upgrade-compatibility/25753 "2022-03-09T01:49:10Z")

</div>

I try to use OpenZeppelin SDK to make my contracts upgradeable using the SimpleProxy approach. I need to test my contracts for upgrade compatibility (e.g prevent mistakes about unstructured storage during upgrading the c…

---

## [Truffle compiler error: Requested contract not found](https://forum.openzeppelin.com/t/truffle-compiler-error-requested-contract-not-found/12172)

<div class="topic-metadata">

**Author:** [@ThomasEnder](https://forum.openzeppelin.com/u/ThomasEnder)\
**Replies:** 8\
**Last updated:** [February 25, 2022, 10:05pm UTC](https://forum.openzeppelin.com/t/truffle-compiler-error-requested-contract-not-found/12172 "2022-02-25T22:05:48Z")

</div>

Hi everyone, I am trying to do some really simple compile and deploy with truffle but run into this error: Error: The requested contract was not found. Make sure the source code is available for compilation at getCo…

---

## [Truffle Invalid number of parameters for "safeTransferFrom"](https://forum.openzeppelin.com/t/truffle-invalid-number-of-parameters-for-safetransferfrom/23844)

<div class="topic-metadata">

**Author:** [@RogerStaxx](https://forum.openzeppelin.com/u/RogerStaxx)\
**Replies:** 0\
**Last updated:** [February 2, 2022, 2:43am UTC](https://forum.openzeppelin.com/t/truffle-invalid-number-of-parameters-for-safetransferfrom/23844 "2022-02-02T02:43:53Z")

</div>

I'm trying to use the safeTransferFrom method (with the data argument) in truffle. However, I keep getting this strange error: Error: Invalid number of parameters for "safeTransferFrom". Got 5 expected 3! I can't seem…

---

## [ProxyFactory.sol "update your truffle config or pragma statement" error](https://forum.openzeppelin.com/t/proxyfactory-sol-update-your-truffle-config-or-pragma-statement-error/23812)

<div class="topic-metadata">

**Author:** [@atomniketh](https://forum.openzeppelin.com/u/atomniketh)\
**Replies:** 1\
**Last updated:** [February 1, 2022, 5:43pm UTC](https://forum.openzeppelin.com/t/proxyfactory-sol-update-your-truffle-config-or-pragma-statement-error/23812 "2022-02-01T17:43:46Z")

</div>

\--\> @openzeppelin/upgrades/contracts/upgradeability/ProxyFactory.sol:1:1: | 1 | pragma solidity ^0.5.3; | ^^^^^^^^^^^^^^^^^^^^^^^ Error: Truffle is currently using solc 0.8.11, but one or more of your contracts speci…

---

## [Transfer ownership to gnosis safe](https://forum.openzeppelin.com/t/transfer-ownership-to-gnosis-safe/21171)

<div class="topic-metadata">

**Author:** [@rasimsen](https://forum.openzeppelin.com/u/rasimsen)\
**Replies:** 1\
**Last updated:** [December 18, 2021, 5:54pm UTC](https://forum.openzeppelin.com/t/transfer-ownership-to-gnosis-safe/21171 "2021-12-18T17:54:55Z")

</div>

Hello, I created ERC20 - Upgradable Transparent Proxy Contract. When I try to transfer an ownership to GnosisSafe: to transfer ownership, truffle is used and run the following script: const { admin } = require('@openze…

---

## [StatusError: Transaction: exited with an error (status 0). when upgrading smart contract](https://forum.openzeppelin.com/t/statuserror-transaction-exited-with-an-error-status-0-when-upgrading-smart-contract/20961)

<div class="topic-metadata">

**Author:** [@TZ\_Wong](https://forum.openzeppelin.com/u/TZ_Wong)\
**Replies:** 0\
**Last updated:** [December 14, 2021, 12:48pm UTC](https://forum.openzeppelin.com/t/statuserror-transaction-exited-with-an-error-status-0-when-upgrading-smart-contract/20961 "2021-12-14T12:48:39Z")

</div>

Keep getting transaction error when trying to run the upgradeProxy function from OpenZeppelin, but it works fine when I want to run deployProxy. const { deployProxy, upgradeProxy } = require("@openzeppelin/truffle-upgra…

---

## [Inheriting the OZ ERC-20 token contract - I go to compile and I get a constructor visibility error](https://forum.openzeppelin.com/t/inheriting-the-oz-erc-20-token-contract-i-go-to-compile-and-i-get-a-constructor-visibility-error/20275)

<div class="topic-metadata">

**Author:** [@nslee333](https://forum.openzeppelin.com/u/nslee333)\
**Replies:** 2\
**Last updated:** [December 11, 2021, 4:47am UTC](https://forum.openzeppelin.com/t/inheriting-the-oz-erc-20-token-contract-i-go-to-compile-and-i-get-a-constructor-visibility-error/20275 "2021-12-11T04:47:16Z")

</div>

Hey There! :grinning: I'm working on a tutorial by Dapp University - (https://www.youtube.com/watch?v=xWFba\_9QYmc&list=PLS5SEs8ZftgUNcUVXtn2KXiE1Ui9B5UrY&index=2) In this tutorial we're building an decentralized bank a…

---

## [Error in truffle npm ERR! errno -4058](https://forum.openzeppelin.com/t/error-in-truffle-npm-err-errno-4058/20615)

<div class="topic-metadata">

**Author:** [@Iesac](https://forum.openzeppelin.com/u/Iesac)\
**Replies:** 0\
**Last updated:** [December 8, 2021, 11:10pm UTC](https://forum.openzeppelin.com/t/error-in-truffle-npm-err-errno-4058/20615 "2021-12-08T23:10:29Z")

</div>

Hello, I have a problem installing that truffle section to later export my contracts to the tesnet. Somebody could help me? npm install --save-dev truffle ganache-cli @truffle/hdwallet-provider npm ERR! code ENOENT n…

---

## [Upgrade Contract by adding new parameter to initialize()](https://forum.openzeppelin.com/t/upgrade-contract-by-adding-new-parameter-to-initialize/10737)

<div class="topic-metadata">

**Author:** [@Hao\_Jie\_Pang](https://forum.openzeppelin.com/u/Hao_Jie_Pang)\
**Replies:** 6\
**Last updated:** [December 8, 2021, 5:34pm UTC](https://forum.openzeppelin.com/t/upgrade-contract-by-adding-new-parameter-to-initialize/10737 "2021-12-08T17:34:47Z")

</div>

Hi, I am having an issue upgrading my contract using upgradeProxy when I adding a new parameter. I am using truffle to do migration using upgradeProxy: await upgradeProxy(existing.address, BoxV3, { deployer }); How do…

---

## [Trouble migrating from truffle to openzeppelin's test environment. Doesn't seem to be connecting to ganache](https://forum.openzeppelin.com/t/trouble-migrating-from-truffle-to-openzeppelins-test-environment-doesnt-seem-to-be-connecting-to-ganache/11146)

<div class="topic-metadata">

**Author:** [@TommyG](https://forum.openzeppelin.com/u/TommyG)\
**Replies:** 8\
**Last updated:** [November 16, 2021, 1:22am UTC](https://forum.openzeppelin.com/t/trouble-migrating-from-truffle-to-openzeppelins-test-environment-doesnt-seem-to-be-connecting-to-ganache/11146 "2021-11-16T01:22:37Z")

</div>

Hello. I'm trying to take advantage of test-helpers, but I cannot seem to figure this out. Everything "just worked" with truffle and ganache. It doesn't seem like test-environment is even talking to ganache, it just fail…

---

## [How to import openzepplin specified version in truffle](https://forum.openzeppelin.com/t/how-to-import-openzepplin-specified-version-in-truffle/18895)

<div class="topic-metadata">

**Author:** [@keep](https://forum.openzeppelin.com/u/keep)\
**Replies:** 0\
**Last updated:** [November 14, 2021, 9:24am UTC](https://forum.openzeppelin.com/t/how-to-import-openzepplin-specified-version-in-truffle/18895 "2021-11-14T09:24:27Z")

</div>

use truffle to compile contract with openzepplin contracted imported, the following error appears truffle compile --compile-all \> Warning: possible unsupported (undocumented in help) command line option(s): --compile-a…

---

## [Upgradeable ERC721 OpenZeppelin Defender Setup](https://forum.openzeppelin.com/t/upgradeable-erc721-openzeppelin-defender-setup/18788)

<div class="topic-metadata">

**Author:** [@jmulq](https://forum.openzeppelin.com/u/jmulq)\
**Replies:** 0\
**Last updated:** [November 12, 2021, 6:12pm UTC](https://forum.openzeppelin.com/t/upgradeable-erc721-openzeppelin-defender-setup/18788 "2021-11-12T18:12:27Z")

</div>

Hey there! Have recently developed an ERC721 contract using OpenZeppelin contracts. The contracts my contract inherits from are the following: ERC721Upgradeable AccessControlUpgradeable I am also using the "@openzepp…

[Next page](https://forum.openzeppelin.com/tag/truffle/41.md?match_all_tags=true&page=1&tags%5B%5D=truffle)
