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
4
votes
1 answer

How to configure truffle to connect to RSK Testnet public node?

I'm using the following configuration in truffle module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*" // Match any network id }, rsk_testnet: { host:…
serlokiyo
  • 353
  • 1
  • 9
4
votes
2 answers

Convert BN to number

In truffle console I am executing the following statement, result = token.balanceOf(accounts[1]) This statement returns the following output. As suggested here, I am trying to use toNumber() and toString. But I am getting…
sel
  • 169
  • 5
  • 13
4
votes
1 answer

Deployment Failed: project ID does not have access to archive state

I am trying to deploy my smart contract code in Infura using truffle, but this error has been raised Deploying 'Migrations' ---------------------- Error: *** Deployment Failed *** "Migrations" -- Unknown Error: {"jsonrpc":"2.0","id":6,"error":…
sheemar
  • 467
  • 3
  • 13
4
votes
1 answer

INFURA: sender account not recognized

I am trying to deploy my contract but it returns this error truffle migrate --network ropsten --reset 1_initial_migration.js ====================== Deploying 'Migrations' ---------------------- Error: Error: Error: *** Deployment Failed…
Gelso77
  • 1,763
  • 6
  • 30
  • 47
4
votes
1 answer

"Web3ProviderEngine does not support synchronous requests" when running truffle migrate

I wanted to config my truffle-config.js with provider. When I run command "truffle migrate --network ropsten", it throws this error: Error: Web3ProviderEngine does not support synchronous requests. And the error details told at Object.run…
BruceChar
  • 83
  • 1
  • 5
4
votes
2 answers

Getting Error: TypeError: Cannot read property 'getId' of undefined in React + truffle DApp

My Ganche-GUI and metamask is running. but I am getting following error in console TypeError: Cannot read property 'getId' of undefined at App.componentDidMount (App.js:17) Following is my code in App.js code import React, {Component} from…
urjit on rails
  • 1,763
  • 4
  • 19
  • 36
4
votes
2 answers

Truffle/Ganache: is there a way to set a deployment address?

I'm currently developing a dapp in Solidity and want to frequently test it locally along with the updates - so I don't really want to redeploy it everytime to a test net. However, everytime I deploy it, the address the smart contract is deployed to…
Thanh-Quy Nguyen
  • 2,995
  • 7
  • 30
  • 46
4
votes
3 answers

core.addProviders is not a function

I'm trying to run my deploy.js file which has the code: const HDWalletProvider = require("truffle-hdwallet-provider"); const Web3 = require("web3"); const compiledFactory = require('./build/CampaignFactory.json'); //const web3 = new…
Kartik ganiga
  • 390
  • 4
  • 12
4
votes
0 answers

Reducing webpack bundle size when using ether.js

I am building a simple truffle dapp and was wondering how I can further reduce my bundle size using nuxt. import { ethers } from 'ethers'; Like is there a way to import only the functions I need from the ethers to further reduce bundle…
GrandFleet
  • 809
  • 2
  • 10
  • 25
4
votes
3 answers

One CLI for webpack must be installed - Can't make webpack run

I have been trying to uninstall webpack (as it keeps giving me the text below when I run it), One CLI for webpack must be installed. These are recommended choices, delivered as separate packages: - webpack-cli…
user379888
4
votes
5 answers

How to send wei/eth to contract address? (using truffle javascript test)

I'm trying to send wei/eth to the address of my solidity contract which have an external payable fallback function. My truffle javascript test below doesn't result in the balance of instance.address getting any wei. Is not instance.address the smart…
Adremalin
  • 137
  • 3
  • 9
4
votes
1 answer

Use ganache accounts in web3j

When trying to use https://github.com/web3j/sample-project-gradle I encounter this code: // We then need to load our Ethereum wallet file // FIXME: Generate a new wallet file using the web3j command line tools…
MrKadek750
  • 55
  • 6
4
votes
1 answer

How to initialize a struct from Javascript when testing a Solidity contract?

How can I initialize the Item struct and assign to a variable? contract ArbitrableBlacklist { enum ItemStatus { Absent, Cleared, } struct Item { ItemStatus status; …
Ferit
  • 8,692
  • 8
  • 34
  • 59
4
votes
1 answer

How to query a struct by multiple attributes in Solidity?

Suppose I have the following contract: contract UserContract { struct User { address walletAddress; string organisation; string fName; string lName; string email; uint index; } …
Karim Stekelenburg
  • 633
  • 12
  • 26
4
votes
2 answers

Verify smart contract code deployed with Truffle

I am using Truffle to deploy a smart contract on the Rinkeby network. The smart contract contains an import of a library (Ownable). I am trying to verify the contract on Etherscan but I am not able to :( It seems that Truffle "flatten" the contract…
Mike
  • 391
  • 2
  • 16