Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
18 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
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: [ { ...
0
votes
1answer
23 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
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&...
2
votes
2answers
51 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
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
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
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 ...
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 ...
0
votes
2answers
19 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
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
0answers
17 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
20 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
33 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
13 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
27 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
29 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
12 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
31 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{ ...
0
votes
0answers
32 views

Saving a function in a variable in Solidity

I am very new to solidity and stack exchange as well. I am trying to use the date time api from https://github.com/pipermerriam/ethereum-datetime/tree/master/contracts. What getYear(date) does is ...
0
votes
1answer
11 views

How to get an instance for a previously migrated contract with truffle?

Scenario: Token contract migration file Dapp contract migration file I want to interact with the already deployed token contract in the dapp contract migration file.
0
votes
0answers
7 views

truffle exec scripts/seed-exchange.js --network kovan

I've been running into an error when I attempt to seed my exchange/contracts on the kovan test network. Any help would be appreciated. Using network 'kovan'. Token fetched ...
2
votes
1answer
30 views

How to trace the line where a tx failed in truffle tests?

I know about 0x's sol-compiler and sol-trace. I used them before and they do exactly what I'm looking for, but these modules bring significant overhead when used with truffle. Check out this file to ...
0
votes
1answer
24 views

truffle deploy --network ropsten issues

I am having an issue deploying to ropsten. I am receiving an insufficient funds error but I believe my address to have ether on ropsten. This command: truffle migrations --network ropsten Also ...
0
votes
1answer
49 views

Confusion around Truffle, Ganache and Meta Mask

I am building a simple contract. In truffle when I give 'truffle develop' command, I get following information: On the Ganache, I have this: And finally on Meta Mask, I see this: here, Shikhar is ...
0
votes
0answers
14 views

Ganache does not show the transferred amount.but it shows theme in account section

as shown in the picture the amount of value which is transferred to contract is shown in the transaction section of Ganache. I mean it shows the amount which is transacted to the address. in the my ...
2
votes
1answer
19 views

Truffle configuration, server.js instead of lite-server

As it seems lite-server is only good for development. I decided to use server.js for production but I have no idea how to configure it for truffle?
0
votes
1answer
54 views

html:82 Uncaught ReferenceError: App is not defined at HTMLButtonElement.onclick (html:82)

It's showing me uncaught reference error in my index.html file <div id="candidate-box"></div> <button class="btn btn-primary" onclick="App.vote()">Vote</button> ...
0
votes
1answer
40 views

Deploy smart contract on Ropsten with Truffle without truffle-hdwallet-provider

Here is my truffle-config.js networks: { ropsten: { network_id: 3, host: '127.0.0.1', port: 8545, gas: 4000000, from: "address_in_metamask" }, I ran a geth node using the command: geth --...
0
votes
2answers
32 views

Deploy contract dynamically based on user request

Inspired by this blog: https://medium.com/coinmonks/escrow-service-as-a-smart-contract-the-business-logic-5b678ebe1955 I want to deploy contract once a buyer want to purchase a service. However, I ...
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 ...
1
vote
1answer
181 views

I am getting error while installing truffle in Ubuntu 16.04 LTS. How to resolve this issue? [closed]

When i enter this command: sudo npm install -g truffle I get the following error: > truffle@5.0.27 postinstall /usr/lib/node_modules/truffle > node ./scripts/postinstall.js Error: EACCES: ...
0
votes
1answer
27 views

How does a transaction verified with Truffle test?

I'm a new to Ethereum and Solidity, and I don't understand how Truffle executes transaction calls. From what I learned and understood, if I try to use a contract method which changes the contract's ...
0
votes
0answers
18 views

Smart-contracts referencing each other [duplicate]

How would one retrieve these three addresses in the "Knot" smart-contract? I am very new to this, and would like to know whether this is even possible. The "Knot" contract should be able to reference ...
2
votes
1answer
53 views

Kaleido private network transaction exited with an error (status 0) after consuming all gas

I've created a private PoA network with two geth nodes using Kaleido (release 1.0.13) and am trying to deploy some smart contracts to it using the drizzle-kaleido-box boilerplate from truffle. The ...
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 ...
0
votes
0answers
58 views

Error when testing the contract

ApprovalContract.sol pragma solidity ^0.5.1; contract ApprovalContract{ address public sender; address payable public reciever; address public constant approver=...
0
votes
0answers
32 views

uncaught error:invalid address

Uncaught (in promise) Error: invalid address at inputAddressFormatter (formatters.js:271) at inputTransactionFormatter (formatters.js:97) at method.js:89 at Array.map (<anonymous>...
0
votes
1answer
26 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 ...
1
vote
0answers
43 views

Cannot read property 'type' of undefined - abi-coder

I'm creating a simple voting contract. It is deployed with truffle and infura. This is the contract code: pragma solidity >=0.4.21 <0.6.0; contract Voter { struct OptionPos { uint ...
0
votes
1answer
53 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: ...
0
votes
2answers
180 views

File import callback not supported import “./IERC20.sol”;

when I try to compile my contract I see errors like this : DemirelToken.sol https://eksiup.com/p/4z49413damc3 here's the code : pragma solidity ^0.5.0; import "node_modules/openzeppelin-...
1
vote
0answers
20 views

estimateGas works on Truffle, but fails on geth

I'm trying to estimate the gas required for deploying a smart contract. It works fine in Truffle, but fails in Geth for some weird reason: truffle(develop)> await web3.eth.estimateGas({ data: '...
1
vote
0answers
20 views

“truffle init” not working after installing

After I install truffle with: $ npm install -g truffle And get: /usr/local/Cellar/node/12.5.0/bin/truffle -> /usr/local/Cellar/node/12.5.0/lib/node_modules/truffle/build/cli.bundled.js ...
0
votes
1answer
29 views
0
votes
0answers
33 views

Hosting pet-shop DApp on IPFS - JSON Files problem

I am trying to host DApp "pet-shop" which one of the truffle boxes on IPFS. rsyncing of src, build/contracts and ipfs add files went very well and there are plenty of peers as seeders on the network ...
0
votes
2answers
47 views

Unused function parameter. Remove or comment out the variable name to silence this warning

I have a smart contact which have 2 owner address and 3 functions. my set functions is set a users with msg.sender and my getUser functions is returns name,surname and age and I want to add a admin ...
0
votes
0answers
58 views

Truffle Contract deployment >> Error: Returned values aren't valid, did it run Out of Gas?

I have a rpc enabled running private ethereum blockchain node with mining enabled. I have connected to it using metamask and have performed some contract interactions (deployment, calling functions,...