We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [truffle]

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

552 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
51 views

Initiate transaction from server to smart contract

In my case, i have an API written in PHP which periodically checks the database. If certain condition was met, i need to send an alert message from the API to an account/node in the Ethereum ...
1
vote
1answer
174 views

Truffle Deploy gas limit exhausted

I kept on getting this error. 9/10 of my deployment will fail. But out of the sudden it will be success without any reason. I have checked the transaction receipt and indeed it had reaches the gas ...
1
vote
0answers
68 views

error in WebSocket connection

error : browser-sync-client.js?v=2.26.3:15 WebSocket connection to 'ws://localhost:3000/browser-sync/socket.io/?EIO=3&transport=websocket&sid=mW3 please i need help on this. i was getting ...
1
vote
1answer
133 views

Deploy smart contract on Ropsten using truffle-hdwallet-provider

I have 7 smart contracts to deploy on the Ropsten network. I am using truffle-hdwallet-provider and below is the content of my truffle.js file: module.exports = { solc: { optimizer: { ...
1
vote
0answers
58 views

How to get back the ownership from crowdsale?

When I started crowdsale, I transferred token ownership to the crowdsale contract. When the sale finished, I'd like to send back the ownership to token so that the next crowdsale will start. How can I ...
1
vote
1answer
174 views

Can not deploy to Rinkeby via truffle - cannot read property 'bind'

I am using truffle: "^4.1.14" and ganache-cli version "^6.1.8". When I try to migrate to ganache cli network, it works without a problem. But when I try to migrate to Rinkeby, it always fails. The ...
1
vote
0answers
54 views

is not contract address during truffle test

I have a stupid smart contract like this: pragma solidity ^0.4.24; contract ProdottoFactory { function foo() view returns(string nome){ return "foo"; } } And I want to test it ...
1
vote
0answers
46 views

Read args object from particular block transaction in truffle console.

Hi I have question on how to read args from specific block transaction that are passed when event was called. I have triggered an event, my block is created and i got transaction tx. In the ' Logs: ' ...
1
vote
0answers
19 views

Contract mined but Truffle gives error

Something weird happened, and I can't understand what to do now. While migrating the contract to the MainNet, I received this: $ truffle migrate --network live Using network 'live'. Running ...
1
vote
0answers
221 views

How to specify Truffle contracts directory

I am looking to use Truffle for testing. For JS tests (in test/*.js), Truffle expects (requires?) all my solidity files (mocks, contracts) to be located in contracts/. I would prefer if my mocks ...
1
vote
0answers
127 views

How to get gasPrice from API and use it in truffle.js mainnet network?

I'm fairly new to javascript and I'm trying to automate pulling the gas price from an api and using it into the truffle.js used to execute via truffle. Basically, I can pull the gasprice via the API ...
1
vote
0answers
867 views

Issue in installing truffle-hdwallet-provider

I am trying to install "truffle-hdwallet-provider" using the command "npm i truffle-hdwallet-provider --save". I am getting the beow mentioned error. Please assist me in resolving this. truffle-...
1
vote
0answers
20 views

Wallet files in a Dapp

I am developing an application from the truffle webpack and I have created my own wallet, adding my account to a json file: $.getJSON('../wallet.json', function(data) { var password = "xxx"; ...
1
vote
1answer
427 views

Truffle migrate got stuck

Issue I ran the official example code: truffle migrate,and stuck there for a long long time: truffle migrate Running migration: 1_initial_migration.js Deploying Migrations... Steps to Reproduce I ...
1
vote
0answers
114 views

How can I measure a function execution time based on Truffle?

I'm using truffle to test my smart contract written in solidity language deployed on the Quorum blockchain. I want to measure the execution time of the invocation of a function using truffle. Is ...
1
vote
1answer
57 views

How to process Smart Contracts payable functions in batch?

I am aware that metamask will enable effective security for processing via the web browser a payable function action to a smart contract. What happens in batch? I have an API service which then ...
1
vote
2answers
37 views

What are contract Variables and how are they different from normal varables declaration

pragma solidity ^0.4.2; import DappToken; contract DappTokenSale { address admin; DappToken public tokenContract; function DappTokeSale(DappToken _tokenContract) public { ...
1
vote
1answer
224 views

Error: Web3ProviderEngine does not support synchronous requests

Error: Web3ProviderEngine does not support synchronous requests. I have an error when deploying contract to rinkeby provider const HDWalletProvider = require('truffle-hdwallet-provider') module....
1
vote
1answer
68 views

Truffle config not matching web3 infos

At truffle.js I set the account to the third ganache's account Then I run truffle console and coinbase was set to the first account and defaultAccount to undefined. Not only that, I've tried to ...
1
vote
0answers
170 views

What are the downsides of using vyper and truffle together

Recently I read an article Vyper+Truffle and wanted to build a token deployer using vyper contracts. I was wondering if anyone knew the current downsides of using Vyper and truffle together? Is it ...
1
vote
1answer
201 views

How to stop listening to all events of contract

I am using the JavaScript API in my truffle tests to get the events from the contract: https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-allevents const allEvents = instance....
1
vote
0answers
36 views

Tutorial for ZAP inegration with Oracle

Oracle is a trusted third party API from which smart contract will fetch the data. Zap is a way to monetize the data which smart contract is getting using a token called zap token. Is there any ...
1
vote
0answers
30 views

interact with two different deployed contract trufle

how do I interact with two different contracts? my deployed contracts: ILoan.sol pragma solidity ^0.4.18; contract ILoan { function getBorrowerIDsViaAddress(address _address) view public ...
1
vote
0answers
205 views

Uncaught at initializeDrizzle TypeError: Cannot read property 'apply' of undefined

I am working a Drizzle truffle box project, and this is my first intro to React so I am struggling a little bit. I keep getting this error and I cannot for the life of me seem to fix it. The ...
1
vote
0answers
264 views

WINDOWS - Geth rinkeby account balance 0 when the balance has 9+ Ether

So I've been using geth on windows in order to deploy my truffle project on the rinkeby testnet using an account where I have 9+ ether. To get in sync with the chain I used (I previously added my ...
1
vote
0answers
69 views

Fallback function keeps failing

I'm working on that smart contract : pragma solidity ^0.4.24; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; import 'openzeppelin-solidity/contracts/math/SafeMath.sol'; import './...
1
vote
1answer
157 views

Once i use selfdestruct(owner) then `Attempting to run transaction which calls a contract function, but recipient address is not a contract address`

How do I fix this? I've already tried truffle migrate --reset and/or deleting the .json files.
1
vote
3answers
107 views

Reading the result of a function that change state by using events in Solidity

I would like to get the result of a function by listening its emitted event. These are two pieces of code of my contrats CONTRACT 1: function createTradeableContract() public stopInEmergency ...
1
vote
1answer
72 views

Not able to send Ether to contract

I am trying to send Ethers to a contract deployed on Ganache but I am getting VM Exception while processing transaction: revert, the same logic is able to transfer Ethers to other account. Following ...
1
vote
0answers
121 views

truffle migrate stop at the first contract

When I tried to run "truffle migrate" with geth (private network), the migration process stop at this point: Running migration: 1_initial_migration.js ...
1
vote
1answer
159 views

Unable to read contract instance variable from deployed contract with truffle test

I am attempting to write some unit tests as I'm working on the development of some smart contracts, but I've run into an issue that's preventing me from continuing. I'm attempting to check the address ...
1
vote
0answers
102 views

Gas requirement of contract deployment

I've recently been running into issues with contract deployment (receiving "Error: VM Exception while processing transaction: out of gas" during migration). It's been my understanding that the ...
1
vote
1answer
220 views

Exceeds block gas limit error to call view functions

With solidity view function, you can specific the amount of gas to use. My understand is since it is not a state changing transaction, all the gas cost is not charged for, and the client should be ...
1
vote
0answers
57 views

Not able to access ropsten account

I installed ropsten testnet and created 2 accounts. "eth.accounts" returns the following: ["0x54eb2b021a26c17b83927ad14587a24b0bd16b66", "0x14e6b19304fb3c98a73acea5f80d2c056ee5c09f"] I wanted to ...
1
vote
1answer
261 views

NodeJS with HDWalletProvider

I want to execute signed Ethereum transactions from a NodeJS program. I am creating a web3_provider like this var contract = require("truffle-contract"); var provider = new HDWalletProvider("nemonic"...
1
vote
0answers
41 views

Error when trying to implement Multisig wallet

When we try to send ether transaction execution in multisig got error in signing. Error: Invalid signature value. while calling contract execute function in solidity code Error: invalid address at ...
1
vote
0answers
354 views

Transaction call error, working on remix but fails with truffle

This is the struct for deals I created // custom types struct Deal { uint id; string name; string description; uint256 price; address seller; address buyer; string[] ...
1
vote
0answers
146 views

How to Deploy non-Migratable Contract in Zeppelin OS?

I am using Zeppelin OS to create a migratable contract MyContract, which will be imported into another contract Foo. Foo calls the baz() function of MyContract, so when MyContract is upgraded, Foo ...
1
vote
0answers
135 views

truffle debugger throws error

I run truffle test and see my transaction in ganache: Transaction: 0x2e9aab59f190743cc740b6f4de9963354386fde246287fc383688f1e055e4451 Gas usage: 137228 Block Number: 92 Block Time: Mon Jun ...
1
vote
1answer
142 views

How can I configure node when I run truffle test?

How can I get truffle test to execute node with the --abort-on-uncaught-exception option? I'm guessing that I should probably add something in the Truffle's configuration file (truffle.js), but the ...
1
vote
0answers
67 views

Is it possible to see the event log when using eth_call?

I want to perform a transaction locally (with the call method in web3 which perform a eth_call RPC call). It returns only the return value of the function called and I want to see the event log. I ...
1
vote
1answer
88 views

Transaction cost in a truffle test

I've a contract under test and the method I'm checking is supposed to transfer an amount, and in order to check I need to have the cost of the transaction. I'm using this code: var tx = await ...
1
vote
1answer
634 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 ...
1
vote
0answers
173 views

Truffle TypeError: Member “error” not found or not visible after argument-dependent lookup in type(library Assert)

Trying to test my Solidity contract for errors using Truffle test. TestSafeMath.sol function test_add_10_and_max_should_return_err() { uint256 max = 2**256 - 1; Assert.error(SafeMathExt....
1
vote
0answers
26 views

txList.length returns different value for different Solidity versions

I have RLPReader smart contract, took it from here. And I have a function untouched for a while: function deposit(bytes txBytes) public pure returns (uint) { RLP.RLPItem[] memory txList = ...
1
vote
0answers
514 views

send SignTransaction to contract function using web3 + infura + truffle

contract has an function "addToWhiteList", only owner of the contract can access this function and add user in whitelist. /** * @dev Adds single address to whitelist. * @param trusted Address to be ...
1
vote
0answers
340 views

web3 v 1.0.0-beta.34 contract.methods.myMethod().send hangs

I am using web3 (installed from npm, version 1.0.0-beta.34) to write a nodejs script that should invoke the method update() defined in a contract I deployed with Truffle on my private ethereum ...
1
vote
1answer
61 views

Smart contract - OpenWeatherMap API

I'm wanting to create a smart contract that sends an amount of ether to an address when the weather is above 30 degrees for 3 or more consecutive days, using the OpenWeatherMap API. How can I use ...
1
vote
1answer
255 views

Error: StartCoinCrowdsale contract constructor expected 5 arguments, received 6

This is my contract code. contract StartCoinCrowdsale is TimedCrowdsale, MintedCrowdsale, CappedCrowdsale, FinalizableCrowdsale { //100000000000 uint256 public constant TOTAL_SHARE = 100; ...
1
vote
0answers
301 views

How to pass command line arguments in truffle exec

How to pass command line arguments to <file.js> when using truffle exec? -- truffle exec <file.js> <arg1> <arg2> ...