Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
184 views

Can't debug transactions that fail during the Web3.js estimateGas() call? No Tx Hash

NOTE: I am doing my work with the Ganache v1.2.2 GUI client on a Linux Ubuntu 18.04 station. There are many revert errors that happen during the estimateGas() call that precedes the actual Web3.js ...
4
votes
0answers
304 views

How to get Truffle to generate artifacts for contracts outside of project?

Say I have a contract MyToken.sol which has already been deployed to a public Ethereum network. Its source is maintained in an external repository and is included in my package.json file so that it ...
4
votes
0answers
336 views

Running a geth light client, how do I resolve the error: “No trusted canonical hash trie”?

I've been running a geth light client to deploy smart contracts through Truffle Migrations to mainnet. I'm getting: "Error: No trusted canonical hash trie". Any help in what this entails and how to ...
4
votes
1answer
284 views

Truffle hangs forever with parity with PoA

I'm trying to create a private chain using parity (PoA) and truffle but when I do truffle migrate it hangs forever with the following output: > [ > { > "jsonrpc": "2.0", &...
4
votes
1answer
371 views

Truffle test fails to call the base function, wants the override

I have an extended ERC20 contract with ERC827 functions, which are overrides of ERC20 with an extra callback parameter. I have these two pairs of base/override functions: Base: function ...
4
votes
2answers
696 views

Run truffle test without recompile every time?

Is there a way to run truffle test and not recompile the solidity code each time? It takes a lot of time if i just want to play around with the javascript tests... Thanks!
4
votes
0answers
687 views

Truffle migrate Error Invalid number of arguments to Solidity function

Truffle 4.0.1 I've got a contract declared "is Pausable" (OpenZeppelin framework) and I want to pause it as part of the deployment logic. I'm getting an error, however, when invoking pause() Error: ...
4
votes
0answers
522 views

How can I retrieve transaction hashes using web3 batch requests?

When I send a transaction using Truffle's contract wrappers - or using plain web3 sendTransaction() - I get a tx hash back that I can use to confirm the tx has completed. While using batch requests (...
4
votes
1answer
384 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 ...
4
votes
0answers
225 views

how to get revert at the previous timestamp of evm in testrpc

I am testing my contracts so at some point i need to increase the timestamp of evm that i achieve through evm_timeIncrease but now i want to execute some functions on the basis of current timestamp ...
4
votes
1answer
316 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 ...
4
votes
0answers
293 views

Storing a truffle contract interface in version control

What I'm doing When I compile and deploy a contract using Truffle, I get a .json build artifact that contains information about where the contract is deployed on the network (its address). So far I ...
4
votes
1answer
596 views

Out of gas exception: error when using GUI/JS but not within truffle

I'm trying something with Ethereum and my current testing environment is Truffle. In the smart contract I have a struct with 5 fields (bytes32, bytes32, bytes32, address, bool). If a call a function (...
4
votes
0answers
426 views

Deploying contracts on geth returns {“jsonrpc”:“2.0”,“error”:{“code”:-32600,“message”:“EOF”}}

I'm trying to connect geth with truffle to deploy my contracts to my testrpc. When I run truffle deploy it's running but when I do http://localhost:8545/ it's throwing {"jsonrpc":"2.0","error":{"...
4
votes
1answer
621 views

How to use IPFS with truffle framework [duplicate]

How to use IPFS to get the hash of the document and store it on private blockchain (using go-ethereum )? consider truffle framework and solidity as contract oriented language.
3
votes
1answer
2k views

Truffle Smart Contract Testing does not reset state

I have the following javascript test for a simple ERC 20 token. Which on the call return token.balanceOf.call(accounts[2]); will fetch some old data and fail from a previous test transaction writting ...
3
votes
2answers
1k views

Truffle test, logs do not include an emitted event

I am calling a contract function which emits an event in a transaction. This transaction should include the event and is typically visible via: const receipt = await contractInstance.someFunction() ...
3
votes
2answers
3k views

What should be the gas and gasPrice for Ropsten Network in Truffle Config?

I just want to test my smart contract to be deployed in the Ropsten network, and I'm still puzzled on what should I put for the gas and gasPrice in the Truffle config. Thoughts about this? ropsten: { ...
3
votes
2answers
341 views

Zeppelin OS: revert Cannot call fallback function from the proxy admin

I have been attempting to create a simple upgradable contract using Zeppelin OS: Following the tutorial I have been able to: - Create a new contract - Deploy it using zos push - Create the proxy ...
3
votes
1answer
820 views

Inheritance of constructor [duplicate]

Why does warning appear with inheritance of constructor? contract MyToken is ERC721Token{ function MyToken(string _name, string _symbol) ERC721Token(_name, _symbol) public { } The content of the ...
3
votes
2answers
3k views

Get the abi of contract

In my contact have multiple imports and successfully deployed my contract. This is my contract address 0xc2d4d839001f9d985618a22b89155ea8d6550ae6 How can get the abi of my contracts : pragma ...
3
votes
2answers
3k views

How do you get the Contract JSON Interface from Truffle?

I'm developing smart contracts using Truffle. I got the contract's bytecode through truffle compile. This produced a large json file and it wasn't too ahrd to find the bytecode. Now, how can I find ...
3
votes
2answers
886 views

Function call returns 0

Hey can someone help me figure out why this function returns 0, when I call it? The function doesn't throw any errors when I send a transaction to it, but the Ether isn't sent and the variables aren't ...
3
votes
2answers
541 views

ERC20 transfer reverts when called from one smart contract

I have an ERC20 token MyToken which seems to be working fine. I have another smart contract AirDrop, that is supposed to distribute MyToken. The sendTokens() method takes an array of addresses, and an ...
3
votes
1answer
488 views

Quorum privateFor not working with truffle-hd-wallet-provider

I'm trying to deploy a contract private to one node in the Quourm 7-nodes example. The migrate works as expected when deployed normally with truffle, but ignores the privateFor part and deploys a ...
3
votes
1answer
1k views

Contract has not been deployed to detected network

I ran truffle compile and truffle migrate to deploy my contract: admin@admin-PC ~/Desktop/Coding Projects/truffleTestProject (master) $ truffle migrate Using network 'development'. Running ...
3
votes
3answers
1k views

Return a struct from a mapping in test truffle

I want the information stored in each struct inside the mapping. This is my struct: struct BurnApply { address applicant; uint amount; string btcAddress; uint8 flag; uint ...
3
votes
2answers
1k views

Is there ERC20 token test library?

I have a custom ERC20 token project and I would like to cover the token behaviour with tests. As the ERC20 interface is standardized I wonder whether there are some libraries to test ERC20 ...
3
votes
1answer
2k views

Can't retrieve Event logs with MetaMask Web3

I have no problem retrieving events with this code: contract.MyEvent({}, { fromBlock: 0 }).get((err, data) => console.log(data)) But when I use the exact same code in a browser that is using ...
3
votes
2answers
917 views

Unit Testing Date Time Values

I have a function that makes use of the current time (now). The Contract as a whole is a Crowdfunding token and the cost of tokens differ depending on the date and time that tokens are purchased. ...
3
votes
1answer
1k views

Truffle SWARM and IPFS Integration

I am now able to use truffle to deploy my contracts in my private blockchain. Now I want to understand how to integrate truffle with SWARM and IPFS for web app deployment. It will be helpful if you ...
3
votes
2answers
2k views

Truffle test - Timeout during out-of-the-box metacoin.js test

Been trying to get the standard init tests to work for a couple of hours, but no joy. Would be grateful for any assistance. Steps taken so far truffle init Fine. So far, so good. truffle ...
3
votes
2answers
862 views

Contract deployment workflow with truffle/ether-pudding

I've managed to deploy a contract on geth by unlocking the account of the node. (How this would work in production I have no idea, as I think it would pose a security risk) Now I connect with my ...
3
votes
2answers
263 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 ...
3
votes
2answers
590 views

simple dapp with React “issues with solidity”

i am trying to build a simple app (will improve once i get the simple one to work)I created a new Reactapp, added both the contracts and migrations directories and i use ganache and metamaks. I have ...
3
votes
1answer
376 views

I'm getting an error when i have more than 3 indexed arg for an event

I want to add all the arguments for my event to be indexed event TokenPurchase( address indexed purchaser, address indexed beneficiary, uint256 indexed value, uint256 indexed amount, ...
3
votes
1answer
2k views

How to convert BigNumber returned by Truffle Console [duplicate]

I have a simple contract Foo which is deployed to a Ganache network. pragma solidity ^0.4.18; contract Foo { uint storageData; function set(uint x) public { storageData = x; } ...
3
votes
1answer
48 views

Why does truffle require 4 authorizations for 1 contract + 1 migration?

Ok looking at this I see the Migrations.sol is setup by truffle to help you migrate versions of your contract? I'm still getting prompted to unlock my wallet 2x per contract (2x per migration, 2x for ...
3
votes
1answer
1k views

Truffle sendTransaction sending eth to contract address returns revert

I have a contract address not a deployed contract instance in which i want to send ETH to but it fails giving Error: VM Exception while processing transaction: revert MyContract.deployed() .then(...
3
votes
1answer
5k views

How to pass argument/parameter to a payable function of a contract that has been already deployed, via web3 / javascript / truffle?

I'm wondering how to pass argument to a payable function of a contract that has already been deployed, via web3 / javascript / truffle. For instance, I see the following piece of code at: http://...
3
votes
1answer
190 views

Can't migrate a project more than once

I'm running a local geth node, and I have a truffle project that was already migrated once, but I'm having issues migrating additional contracts, or even updating past contracts. I create a new ...
3
votes
3answers
1k views

Deploying from Truffle to Infura.io

I'm trying to use the Infura or any other public provider to compile and migrate a simple test contract. I don't get any errors when I run truffle compile --network test but it seems to hang and ...
3
votes
1answer
885 views

Truffle compile pragma 4.10

In my contracts i'm using ether transfers which requires Solidity compiler 4.10. With newly updated truffle and solcjs version 4.10. I still get the following error using Truffle to compile the ...
3
votes
1answer
552 views

Can Truffle deployer send ether on construction?

If a contract has a payable constructor and needs to be filled on construction, is this possible with the truffle migration workflow?
3
votes
1answer
3k views

How to find out the value using call() method in truffle and testrpc?

pragma solidity ^0.4.2; contract Transfer { address public owner; mapping (address => uint) balances; // constructor ...
3
votes
3answers
472 views

Contract inheritance? Need some help to understand certain things

I'm using testrpc, and truffle. I created a simple token as seen in many tutorials which shall be used to buy or enable certain actions when clicking a button on an UI. contract MyToken { mapping ...
3
votes
1answer
279 views

Truffle Dapp Communication

In truffle, a dapp is deployed using the port of running geth node (in testnet). Then how will another machine node will communicate to that dapp because it is impossible to run a node on same port ...
3
votes
2answers
137 views

How to test events that were sent by inner transaction / delegate call?

Usually, using truffle I can check for events like this: let { logs } = await myContract.doSomethingImportant( xxx ); // 1500 tokens are expected to get expectEvent.inLogs(logs, '...
3
votes
1answer
73 views

Embedding ETH Wallet Address into Webpage

Hey is there a quick way to embed an Ethereum wallet address and a button into my existing website so as to allow people to send in their ETH donations to me? Or do I need to go through the whole npm ...
3
votes
1answer
461 views

Weird error 'The method eth_accounts does not exist/is not available'

I am trying to use truffle to migrate with the following command truffle migrate --network ropsten and I face the following error The method eth_accounts does not exist/is not available I tried to ...

1 4 5 6 7 8 41