Questions tagged [truffle]

Questions regarding the implementation and use of the Truffle development and testing environment.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Developing a dapp using Truffle. Metamask will sometime throw this error when interacting with a simple contract

Trying to setup my development environment to start a personal dapp project. I am starting off the project with the React truffle box. 1) I start by running truffle develop which launches a local ...
1
vote
0answers
28 views

Help hacking this contract

This is a very simple contract that I can't hack and I'm stuck, I need some help to get the concepts right. pragma solidity ^0.4.10; contract SimpleToken { mapping(address => uint) public ...
0
votes
1answer
24 views

Web3 - how to add WEI and ETH values correctly

I'm working on an auction feature in my DApp and having problems correctly adding together two WEI values. The contract stores two important values: 1. A minBidIncrement variable - which I've set to ...
0
votes
0answers
4 views

sender account not recognized error when using “WrestlingInstance.registerAsAnOpponent({from: account1}) ”

I'm following the ethereum walkthrough at: https://hackernoon.com/ethereum-development-walkthrough-part-2-truffle-ganache-geth-and-mist-8d6320e12269 I got stuck at account0 = web3.eth.accounts[0]. ...
0
votes
0answers
21 views

send().catch() doesn't give me the error message anymore

I'm using Truffle/Drizzle/MetaMask and calling methods with send() and using .then() and .catch() and I rely on getting the error message send to .catch() e.g. contract.methods['hello'](arg).send({ ...
0
votes
0answers
19 views

contract not deployed [on hold]

I am getting this error in the browser console and dont what to do please help... ERROR Error: Uncaught (in promise): Error: Contract has not been deployed to detected network (network/artifact ...
0
votes
1answer
41 views

MetaMask - RPC Error: Internal JSON-RPC error

I am getting this error when i trying to use metamask on my local for a simple transaction from one account(say A) to another (say B). code: -32603 data: {originalError: {…}} message: "Internal ...
0
votes
1answer
31 views

truffle migrate --network kovan >> ProviderError: VM Exception while processing transaction: revert

I am a beginner. I can deploy to a private network but I can not deploy to a public network. I need a Deploy to the kovan test network. please help me. >truffle init >npm install truffle-...
0
votes
0answers
18 views

Contract deployed successfully on localhost and mainnet, but gives error on rinkeby and ropsten

I tried to deploy a contract to rinkeby then on ropsten, but getting an error: Network ropsten-fork Minting initial supply of 5000000000 ... Error: Error: Error: invalid address (arg="_to", coderType=...
0
votes
1answer
20 views

BigNumber string error when passed as uint256

I get the following error when passing (new BigNumber('2')).exponentiatedBy(100) big number value as uint256 Error: invalid BigNumber string value (arg="value", value="1....
1
vote
1answer
47 views

Issue with Ganche and Truffle with Metamask. Can't load token balance

I'm testing to create a token in Truffle; it compiles fine, but it won't load the balance of the token in to Metamask. I've set the connection correct: it does load the ETH balances of the Ganache ...
1
vote
1answer
21 views

Could not find __Truffle__NotFound.sol from any sources

This is the file I'm trying to compile. I've been using truffle for a few years and I remember that we used to be able to compile files with different names than the contracts inside. I'm using ...
0
votes
0answers
21 views

gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

I used the command truffle unbox react to build a dapp. It is just the initial step of my dapp development. However, it sucks. It continually pops up gyp ERR! build error gyp ERR! stack Error: `C:\...
0
votes
0answers
25 views

not able to assign address to a public property using web3

while everything is working fine when working on remix ide but on truffle its not updaing value of a property (player2) i am also returning that address value and its returning as it should be. but ...
0
votes
0answers
18 views

Error based on inheritance and dependency between contracts (Using EternalStorage contract)

I have been using EternalStorage contract with my contracts for the storage purpose. Now the structure is some like this: Eternal Storage <- Contract (A) <- Contract (B) <- Contract (C) Now ...
1
vote
0answers
27 views

Solidity Events not firing after interaction in DApp

I have a simple HTML Setup with a button that let's me execute a Solidity function, which works fine. At the end I want to emit a event, which is the only part that doesn't seem to work. Relevant ...
0
votes
1answer
32 views

web3 - web3.utils.toHex zeros length

I'm trying to send 12 integer as bytes to a contract function. If I use web3.utils.toHex(12) the variable will become 0xc The problem is that when contract function parses bytes, it reads uint256, ...
0
votes
2answers
19 views

Truffle migration script does not make transaction

Please look at my simple example below. Is migration script 3 being executed, such that it sets the value on the blockchain -- I think not, because there is no speak about a txHash or cost... How to ...
2
votes
2answers
36 views

Drizzle and Contract Instances

I am currently developing a dApp with Drizzle on top of ReactJS. My project consists of, basically, 8 .sol files. 4 of them are just abstract contracts that include the functions, structs etc. for ...
0
votes
2answers
29 views

truffle migrate fails silently

I'm trying to deploy a truffle project to testnet. When I run truffle migrate --reset --network rinkeby --verbose-rpc, this is output: You can improve web3's peformance when running Node.js versions ...
4
votes
1answer
30 views

couldnt understand implementaion of UpgradeabilityProxyFactory

I want to use UpgradeabilityProxy provided by zeppelin, they have one method createProxyAndCall which they say initialize the new implementation with data parameter we provided which looks like: * ...
0
votes
2answers
52 views

Where web3.eth.accounts.create() creates new account?

I am using ganache which creates an ethereum blockchain with 10 accounts. The blockchain created by ganache is linked with truffle's pet-shop box using web3. I want to add a new account in that ...
0
votes
1answer
41 views

Truffle: 'func.call()' retrieves the return-value of a non-constant function

I've just learned that one can easily obtain the return-value of a non-constant function, by using myContract.func.call() (instead of myContract.func(), which retrieves a response object). Up until ...
0
votes
0answers
43 views

Error: Truffle is currently using solc 0.5.8,

i run migrate in the terminalbut it shows Error: Truffle is currently using solc 0.5.8, but one or more of your contracts specify "pragma solidity ^0.4.27". Please update your truffle config or ...
0
votes
1answer
26 views

I am getting the following wrror while i tried to do node <file name> and also truffle test <file name>

Error: Cannot find module 'web3' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module....
1
vote
0answers
53 views

Error while installing truffle-hdwallet-provider

I am on windows OS and my current python version is 3.6 and node version is v10.12.0 I am trying to install truffle-hdwallet-provider by running following command: npm install --save truffle-...
0
votes
2answers
31 views

ParserError: Expected identifier, got 'LParen' constructor() public {

i don't know why i get this problem, anybody who can helps thanks a lot pragma solidity ^0.4.21; contract MathContract { function mulAtoB(uint a, uint b) pure public returns(uint) { ...
0
votes
0answers
14 views

Error: IPFSInbox has not been deployed to detected network

It's my first time writing smart contract in solidity and using IPFS to develop my dapp. I don't know how to solve it and why it pops up this errorNo web3 instance injected, using Local web3. Error: ...
0
votes
1answer
29 views

“truffle init” problem

What to do to resolve below issue coming in initiating a truffle project? YuweideMacBook-Air:vantoken yuwei$ truffle version Truffle v4.1.4 (core: 4.1.4) Solidity v0.4.21 (solc-js) YuweideMacBook-...
0
votes
1answer
24 views

how to correct this code with pragma solidity^ 0.5.8? thx

pragma solidity ^0.5.8; contract HelloWorld { function test() pure returns (string) { return "HelloWorld"; } }
0
votes
0answers
12 views

Truffle migrations - get deployed contracts list

I have the following problem: migrations no. 7: (deploy proxies) await deployer.deploy(TestProxy); await ExportUtils.addDeployed(await TestProxy.deployed(), true, { privileges: [ { ...
0
votes
1answer
38 views

TypeError: Cannot read property 'nodes' of undefined

I'm new to ethereum, and I'm trying to test the depositToken function of etherdelta on linux, which version is 0.4.9, and the token I use is vixcore which version is 0.4.24, and I got this error when ...
0
votes
1answer
29 views

Cannot Find Module Error for Truffle-contract

Error:- Uncaught Error: Cannot find module './truffle-contract.min.js' at c (web3.min.js:1) at c (web3.min.js:1) at index.html:27 <!DOCTYPE html> <html lang="en"> <head&...
2
votes
2answers
66 views

Ganache GUI installation error

node version v12.8.0,npm version 6.10.2 I followed the below steps to install the ganache GUI but I got the error $mkdir ~/ganache $git clone https://github.com/trufflesuite/ganache.git $npm install ...
1
vote
1answer
10 views

ganache test returns characters instead of numbers

mapping(uint256 => uint256) public amount; function saveAmount(uint256 _id, uint256 _amount) public { amount[_id] = _amount; } I have a function that saves amount in mapping. When I test ...
0
votes
0answers
15 views

Use web3 0.2.x within Truffle V5

It's a pain to have to refactor tests written for TruffleV4 in web3 0.2.x to web3 1.0.x. Is there any way to avoid this situation by using web3 0.2.x instead within Truffle V5?
1
vote
1answer
76 views

Simple Truffle tests timeout “before all” hook: prepare suite

I'm trying to write my first tests for truffle, but I run in a timeout each time I want to execute the tests. Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is ...
0
votes
1answer
26 views

Can't log struct member in truffle test

Contract : mapping (bytes32 => MyStruct) public myMapping; struct MyStruct { uint256 myMember; uint256 someOtherMember; } Test (Truffle) This works: let ...
0
votes
1answer
17 views

Can i use a the msg.sender which is a address to call a function of the contract?

I am trying to mint a ERC721 token using openzeppilin/contracts. It was working correctly, but later had to change the design. So now i am forced to use the msg.sender who is the minter to call the ...
1
vote
2answers
23 views

How do I specify the network ID in the config file when migrating/testing contracts on my local ganache?

So my issue is when I run the compile and then migrate commands everything goes smooth, then I try to test by running the truffle test command and it gives me an error saying 'Error: The network id ...
0
votes
2answers
25 views

Error: HelloWorld has not been deployed to detected network (network/artifact mismatch)

I'm following the steps in this link to create a truffle project. I'm using ganache-cli as the ethereum client. rajkumar@rajkumar: Ethereum$ mkdir helloworld rajkumar@rajkumar: Ethereum$ cd ...
1
vote
2answers
45 views

Understanding ganache timestamps

Sometimes, when I use the ganache specific evm_increaseTime method and advance to the next block, the next timestamp is NOT: current timestamp + advanced time But instead: current timestamp + ...
1
vote
0answers
34 views

What is the easiest way to write truffle tests in typescript?

I read about Typechain, but the configuration is rather verbose and generally feels like a very custom solution: Everytime you change contracts you need to run yarn generate.
0
votes
1answer
25 views

Zepellin Crowsale buyTokens error

I'm trying to use the buyTokens function of the Zepellin Crowsale interface, but this gives me an error, without any log to be able to debug contract TokenA is MintableToken, PausableToken, ...
0
votes
1answer
57 views

Using two solc versions within the same truffle project

I am creating an app that has various imports that require two different versions of solidity. AragonOS(0.4.x) and openzeppelin(0.5.x) Of course, there are breaking changes in 0.5.x so my question is ...
0
votes
0answers
19 views

Windows: command “npm install drizzle” give me an ERR!

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support npm WARN deprecated tar.gz@1.0.7: ⚠️ WARNING ⚠️ `tar.gz module has been deprecated and your application is ...
1
vote
0answers
36 views

Truffle vs. Embark [closed]

Say a programmer developer a web front-end using Truffle/Drizzle. The developer moved on and a new developer, who only knows JavaScript comes along to manage and extend the Dapp. Someone told me that ...
1
vote
1answer
38 views

Windows: “npm install drizzle” command don't work, Why? [closed]

when i try to run the command "npm install drizzle" on my machine it don't work. i install drizzle-react and drizzle-react-components without problem but "npm install drizzle" don't work. Any ideas?
0
votes
0answers
14 views

truffle - toUtf8 on Migrations not working

I'm deploying my contracts via migrations and would like to show some info on the console about them just by getting data from these contracts and displaying it. I'm sending a deployed contract to the ...
0
votes
1answer
46 views

Migration 2_deploy_contracts invalid or does not take any parameters at Object.run()

I am trying to compile my smart contracts using truffle pet-shop. I have the following contract in directory election/contracts/election.sol ; pragma solidity >=0.4.0 <0.6.0; contract Election{ ...