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
7 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
863 views

Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: VM Exception while processing transaction: revert

Googled around and nothing could solve this error. truffle migrate --network development Using network 'development'. Running migration: 2_deploy_contracts.js 1520374082 1522102082 1000 '...
0
votes
1answer
20 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
2answers
69 views

Having trouble figuring out Truffle testing with Javascript

I've started unit testing my contracts with Truffle (using Javascript). I'm fairly new to Truffle and Mocha both, and while I've tried to follow the tutorials, I'm struggling to follow exactly what's ...
0
votes
2answers
65 views

(Truffle) how to call finalize() function after finishing crowdsale

I would like to call token.transferOwnership(msg.sender) after finishing timed crowdsale. So, I inherited FinalizableCrowdsale contract, then override finalization() function to call transferOwnership ...
0
votes
1answer
439 views

Pass address[] array to Truffle deployer (MultisigWallet)

I am trying to deploy the MultisigWallet contract on testrpc. However, I can't figure out how to provide the address[] _owners constructor parameter in the deployment command. I've tried several ...
6
votes
4answers
3k views

Truffle Box at URL https://github.com/truffle-box/bare-box.git doesn't exist

I'm trying to initialize a directory with truffle init, but I'm getting the following error: Error: Truffle Box at URL https://github.com/truffle-box/bare-box.git doesn't exist. If you believe this ...
0
votes
1answer
21 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"; } }
2
votes
1answer
508 views

Truffle Bytecode Different from Etherscan Bytecode

I am having difficulty verifying my contract code on Etherscan using the code generated by Truffle. Using Etherscan VerifyContract V1: https://rinkeby.etherscan.io/verifyContract Truffle produced ...
1
vote
1answer
21 views

Upgradability Proxy ADMIN_SLOT assembly sstore does not update

I'm currently playing around with Proxy Upgradability, and noticed the use of assembly in terms of the new upgraded contract and the slot assigned. Real implementation can be seen here. I have ...
0
votes
1answer
566 views

How to deploy a contract to parity using truffle?

I get this when trying to deploy to parity - Writing artifacts to ./build/contracts Invalid JSON RPC response: "Provided Host header is not whitelisted.\n" I am new to using truffle with ...
0
votes
1answer
24 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 ...
6
votes
3answers
6k views

Difference between Ganache and Truffle

What is the difference between this two? I understand that Ganache is like a fake blockchain, but Truffle has that too ? What are the limitations of each and under which circumstance we use either ...
0
votes
0answers
11 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: [ { ...
2
votes
2answers
490 views

Cannot read property 'getBlock' of undefined

I'm having an issue with running truffle test on a Javascript test. I get the error TypeError: Cannot read property 'getBlock' of undefined. I am trying to get the time of the latest block by using a ...
0
votes
1answer
57 views

Failed to install Truffle on MacOS Mojave

I am currently really struggling in getting Truffle up and running. I am running MacOS Mojave and have Node (v.10.16.0) and NPM (6.9.0) and have tried npm install -g truffle and have gotten: ...
4
votes
1answer
368 views

How long does it take to “save artifacts” to Ropsten?

Migrating contracts with Truffle I get stuck at Saving artifacts... Sometimes for 10 minutes or more. I also get: Error: Transaction 0x123...123 wasn't processed in 240 seconds! Is it normal that ...
0
votes
1answer
21 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&...
1
vote
2answers
2k views

Out of gas when executing contract via web3 js

I am having a trouble invoking contract via web 3 js in browser. I am using truffle develop and have migrated and run tests successfully. I am also getting the info when I console.log the contract....
0
votes
3answers
185 views

Truffle compile command stuck at “Compiling your contracts…”

I developed a dapp using my PC (OS: Pop_OS!) and it was running fine. Then I had to format PC and installed new OS (Ubuntu 18.04 LTS), due to some issues in compatibility and performance.After that, I ...
2
votes
2answers
57 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
958 views

rinkeby balance says 0 after syncing even though transaction shows ether was sent

I'm using truffle to deploy a contract on the rinkeby testnet Here is transaction info saying that my address received ether however as shown below, the balance still shows as 0. truffle(rinkeby)...
1
vote
1answer
943 views

truffle migrate hanging on Deploying Migrations

I am deploying a contract on Ropsten Network,These are my settings 2_deploy_contracts.js var SafeMath = artifacts.require("./SafeMath.sol"); var TahaCoin = artifacts.require("./TahaCoin.sol"); var ...
4
votes
1answer
306 views

How do I get configuration variables (such as gasPrice) in a truffle test?

I learned from this answer that truffle configures gasPrice in truffle.js, defaulting to 100000000000. I'd like to use gasPrice in a test, without hardcoding the raw number. Is there any way to ...
1
vote
1answer
542 views

call function from truffle console (newbie)

This should be fairly simple, but I'm still trying to wrap my mind around a lot of things. What is the easiest way of testing by hand the function addEntity? What command do I type into the truffle ...
0
votes
1answer
138 views

Truffle tries deploy from unknown account

I am trying to deploy a contract to Ropsten using Infura with the config file truffle.js below. The deploy fails because the account listed in the error message has insufficient funds – however I do ...
0
votes
1answer
36 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
2answers
23 views

Truffle error missmatch artifact

What does this means?network/artifact mismatch Contract has not been deployed to detected network but when i write truffle network i can see mine.
6
votes
2answers
2k views

getData() is not working

I want to call a function of the contract, something like this - module.exports.transfer = function(to,value,){ return token.methods.transfer.getData(to, value); } But I am facing the error ...
2
votes
1answer
268 views

How can I use solc solidity compiler on truffle webpack?

When I try to import solc, it raises an error which says: ERROR in ./~/require-from-string/index.js Module not found: Error: Can't resolve 'module' in 'C:\users\bisrat\Desktop\webpacksample\...
5
votes
2answers
2k views

Accessing struct fields in Web3 returned by a promise in Truffle

I'm using web3js (via Truffle) to make a call to a contract, to access a struct in a mapping. mapping (bytes32 => entry) public entries; struct entry { Mode status; Deed deed; uint ...
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
1answer
403 views

Running A Smart Contract With Two Nodes on Truffle

We have installed truffle to two nodes and we initialize our private blockchain with: $geth --datadir node init genesis.json Then we run geth on both nodes with: $geth --datadir node --nodiscover -...
0
votes
1answer
27 views

Issue with Serverless deploy of smart contract-Dependency mismatch -Package.json,Package-lock.json error

I'm trying to deploy my smart contract serverless(AWS lambda) and I'm using Truffle framework. The code is getting deployed in an earlier system(earlier it was deployed here). Now I have updated the ...
0
votes
0answers
11 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?
0
votes
1answer
2k views

invalid address error on running code - solidity

Here is my code : var Web3 = require('web3'); var fs = require("fs"); var Artifactor = require("truffle-artifactor"); var provider = new Web3.providers.HttpProvider("http://localhost:8545"); var ...
0
votes
1answer
22 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 ...
1
vote
1answer
36 views

truffle migrate --network kovan issue

When I run truffle migrate --network kovan in the terminal the contract deployment doesn't run. Just: Compiling your contracts...==================== >Eveything is up to date, there is nothing to ...
1
vote
2answers
39 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
2answers
176 views

Truffle test, how to get address(0)?

This is going to be short question and may be silly, but I'm literally stuck with a problem, where I need to pass address(0) to function in Truffle Test in JS and don't really know how to do it. In ...
0
votes
1answer
37 views

Is it necessary to fetch the history from toBlock to fromBlock by giving the non zero block number?

I have one event inside my solidity smart contract and in web application I am fetching the values using "contractInstance.Transferred({}, {fromBlock: 0, toBlock: 'latest'}).get". When I changes the ...
1
vote
3answers
78 views

A single exception in Truffle test causes every other test cases to fail

I'm making test script for my contract and it looks likes contract('...', async () => { let token = null; before('deploy', async () => { token = await MyContract.new(...); })...
0
votes
1answer
15 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
20 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 ...
8
votes
1answer
524 views

Configure Truffle Compiler: Default Import Folder

I want to use an external library. I guess it is good to load the library in production from a CDN because this requires less space and should be faster. import "github.com/Arachnid/solidity-...
0
votes
2answers
75 views

Solidity: uint parameter not being set properly

Testing my contract locally with truffle. I have a function with the signature: function purchase(address buyer, address seller, bytes16 bookId, uint tokens) public onlyOwner returns(bool success) ...
8
votes
1answer
564 views

Filtering on events of the entire blockchain not possible in testrpc via truffle

A contract I wrote has an event in its constructor. Since I want to find it back in the logs it doesn't seem possible to start listening to the latest block. Because the event is already 'fired' ...
6
votes
1answer
684 views

Problem with start() in web3-provider-engine

While trying to connect to a provider(infura) I get the above error below is the full stack trace: bundle.js:54318 Uncaught TypeError: this.provider.sendAsync is not a function at Web3Subprovider....
0
votes
2answers
94 views

After compiling contract, there is no build directory inside project directory?

After writing 'truffle compile' in terminal , it just give the message i.e. compiling your contracts...and exit, no build directory is formed in Project directory. What is the issue?
0
votes
1answer
38 views

Problem watching events without invoke functions in the Smart Contract

I have an event which is sent each time when a contract is deployed. It is launched in the constructor. I have a Dapp where I want to watch this event to send a tx each time that a smart contract is ...