Questions tagged [truffle]

Development environment, testing framework and asset pipeline for Ethereum

Truffle is a development environment, testing framework and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier. With Truffle, you get:

  • Built-in smart contract compilation, linking, deployment and binary management.
  • Automated contract testing with Mocha and Chai.
  • Configurable build pipeline with support for custom build processes.
  • Scriptable deployment & migrations framework.
  • Network management for deploying to many public & private networks.
  • Interactive console for direct contract communication.
  • Instant rebuilding of assets during development.
  • External script runner that executes scripts within a Truffle environment.

Github Repository

Official Website

1088 questions
3
votes
2 answers

NPM cannot install "truffle" on Windows

I am trying to install "truffle" with npm, but I am not familiar with NodeJS and cant figure out why npm wont install it. I try npm install -g truffle in Powershell with Admin rights and after a few lines of output I get this block of error…
Max Binnewies
  • 183
  • 1
  • 10
2
votes
0 answers

Get code coverage in truffle test smart contracts

I am working on a blockchain project and have several smart contracts to be tested. For that, I use the Truffle test suite and write JavaScript tests. I want to know, is there any way to get the code coverage for smart contracts in the Truffle…
2
votes
1 answer

Solidity change data location from memory to storage

Hi I have this code and the error is : UnimplementedFeatureError: Copying of type struct spu_university.all_courses memory[] memory to storage not yet supported. How I can solve this ?? // SPDX-License-Identifier: MIT pragma solidity >=0.4.22…
MorGa
  • 23
  • 3
2
votes
2 answers

what is the best way to configure solidity contract with react?

I am learning solidity from last 3 months but now I am confused how to connect your contract with frontend (with react or next). Every developer has their own way of applying it as i am, i want to with the best way like with hardhat or truffle
Syed Hadi
  • 17
  • 3
2
votes
0 answers

consensys solidity supply chain exercise

i'm currently passing 22 of 23 @openzeppelin/test-helpers when i run $ truffle test on my clone of the consensys supply-chain-exercise why am i getting the following error and does it relate to the code below? Wrong kind of exception received +…
2
votes
1 answer

Truffle still using old solc compiler even after updating truffle-config.js

I am having a problem where truffle is still using old solidity compiler (- solc: 0.5.16+commit.9c3226ce.Emscripten.clang) even though i specified in my truffle-config.js to use version: '0.8.4'. compilers: { solc: { version: '0.8.4', …
2
votes
0 answers

How to transfer ERC20 to deployed contract with truffle?

I'm using truffle to deploy a set of smart contracts. These contracts need to be funded with an ERC20 token (LINK). The account that is deploying the contracts has LINK and should transfer an amount to the contract. const DemoNFT =…
Arnold Daniels
  • 16,516
  • 4
  • 53
  • 82
2
votes
0 answers

Truffle test command failing with no description of error

I have a Campaign.sol smart contract with the following constructor - constructor ( string memory _name, string memory _imageURL, string memory _description, string memory _descriptionURL, uint256…
adzo261
  • 538
  • 3
  • 13
2
votes
1 answer

View functions error : Returned values aren't valid, did it run Out of Gas?

I'm calling the methods in the deployed smart contracts in Ganache. Other methods are working fine, but the view functions returns an error. Here's the view function in Solidity: mapping (address => Count) private counts; function getCounts…
fabricdev
  • 61
  • 3
2
votes
1 answer

How to call Openzeppelin safeTransferFrom() function with Royalty to avoid error, ERC721: owner query for nonexistent token?

I am creating a smart contract using Openzeppelin NFT standard and code copied from Tatum, where the safeTransferFrom function looks like this, function safeTransferFrom( address from, address to, uint256 tokenId, …
2
votes
1 answer

bash: /usr/local/bin/truffle: Permission denied | truffle | macos

I tried to install truffle, and got many videos/solutions but older than a year on youtube or other webpages post searching. Helpfully I got few videos on youtube post filtering "this year" in May 2022, but the solution what they were suggesting was…
ArifMustafa
  • 4,617
  • 5
  • 40
  • 48
2
votes
1 answer

Cannot find module 'babel-runtime/core-js/object/entries'

when i try to test truffle test file then i got this error (using command truffle test) Using network 'development'. Error: Cannot find module 'babel-runtime/core-js/object/entries' Require…
2
votes
1 answer

`babel-runtime/core-js/object/entries` happens when `truffle test`

Can anyone help me with this issue for truffle test? This is my environment: Truffle v5.5.12 (core: 5.5.12) Ganache v^7.1.0 Solidity - 0.8.13 (solc-js) Node v17.9.0 Web3.js v1.5.3 This error Cannot find module 'babel-runtime/core-js/object/entries'…
Jiu hong
  • 139
  • 2
  • 8
2
votes
1 answer

How to pass an Interface object in a constructor parameter?

I don't know how to deploy this contract whit HARDHAT because there is an Interface object in the constructor. Please can someone explain to me how to initialize IUniswapV2Pair _pair IUniswapV2Pair is a Uniswap Library written in Solidity. const…
2
votes
1 answer

Truffle migrate --network bsc error: header not found

When trying to run truffle migrate --network bsc, truffle usually (not always) manages to deploy the migrations contract, then fails with an error: header not found. Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not…
Nate F
  • 23
  • 3