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

Setting up a desktop wallet with a private network on geth

Disclosures: I've never set up a wallet before, and am new to geth. I'm not worried about security right now. My goal is to set up several wallets on my private chain (if possible) in order to learn ...
1
vote
1answer
53 views

Ethereum Error: Provider does not support subscriptions: HDWalletProvider

I am making a flash loan request using web3 , truffle and keep getting the error in an event listener: The current provider doesn't support subscriptions: HDWalletProvider. I am connecting to the ...
0
votes
1answer
88 views

Can't use token variable's method at contract that inherit zeppelin crowdsale?

Calling the method of Crowdsale's "token" on the source that inherited Crowdsale of zeppelin v1.8.0 inevitably causes "out of gas". Error: Error: VM Exception while executing eth_call: out of gas ...
0
votes
1answer
123 views

Transfer contract address from truffle to meteor

I am very new to dApp-Development and therefore frankly i need some basic help. How can i get the address of my deployed contract by truffle in meteor? I hope there is a simple solution.
0
votes
0answers
43 views

Convert from 0.4.17 to 0.6.2

I made a conversion from Solidity 0.4.17 to 0.6.2 of a contract that have a MINT option. The biggest problem here is that I am not sure if this function mint is okay (will return the correct id). Look:...
0
votes
1answer
128 views

Transaction reverted when testing requires/asserts in non void functions

im trying to test the requires of a Smart Contract using just solidity according to this article: http://truffleframework.com/tutorials/testing-for-throws-in-solidity-tests This is the contract, the ...
0
votes
0answers
16 views

want to get address of account from truffle console to one of the function in smart contract and set some values [closed]

i have 3 accounts in private node. i want to get addresses of two accounts from truffle console to set values in 1 of the function in my smart contract. when i copy paste account address in truffle ...
0
votes
1answer
114 views

passing variables between different contract by solidity (0.5.0+ version)

I writed ERC20 contract and ICO contract for a test , but I meet a lot problem with compile problem. My ERC20 contract have own constructor but,I also need a ICO contract(a control)for passing ...
0
votes
2answers
182 views

Intracting with dapp using frontend truffle petbox

App = { web3Provider: null, contracts: {}, account: '0x0', init: function() { // Load pets. return App.initWeb3(); }, initWeb3: function() { if (typeof web3 !== 'undefined') {...
0
votes
0answers
29 views

Truffle console: Exception instead of transaction

I am running the tutorial at: Medium Just Dev pragma solidity ^0.5.0; import './Victim.sol'; contract Attacker{ Victim public v; uint public count; event LogFallback(uint c, uint ...
0
votes
1answer
31 views

Sending ETH from contract to EOA

OK, I'm baffled guys. maybe it's the amount of gas the function is using up that is causing this not to work. when I call the function: I get the following in response but no movement of Eth from my ...
0
votes
1answer
109 views

Truffle testing not reading contract

Here's my solidity: contract Oracle { mapping(uint => uint) oracle_values; modifier onlyOwner { require(msg.sender == owner); _; } function Oracle() public { owner = msg....
2
votes
1answer
308 views

Passing one contract instance as an argument to the constructor of another contract

I need to use the functions of the ERC20 contract in another contract. The ERC20 contract is from the openZeppelin contract library. I found the following code on a website: import "../../...
0
votes
1answer
45 views

Function stopped working? No check is being done now on transfer function

I created a function to deposit and transfer ether and it was working great until i tried to deploy again and now the transfer function is not working anymore No errors are being thrown, the transfer ...
0
votes
1answer
301 views

Truffle migrate code with library, interface and contract

Suppose that I have a token contract as follow. How can i write the new migration.js file in truffle to deploy the contract? TestCoin.sol import "openzeppelin-solidity/contracts/math/SafeMath.sol"; ...
0
votes
1answer
21 views

Truffle Migrate

What happens when there is a minor change in the smart contract and I run truffle migrate command. Example: //before contract test{ function display() public returns (string){ return "...
0
votes
1answer
438 views

Truffle Migrate Error: Could not find built Migrations contract: Unexpected token in JSON at position 0

Running truffle migrate with valid contract code started causing this error for me: Writing artifacts to ./build/contracts Using network 'development'. Error: Could not find built Migrations ...
0
votes
1answer
51 views

Getting stuck in truffle testing

I am trying to run a test and I am getting the following message; I have tried the following; npm install scrypt npm install web3 as to solve the yellow message and when running truffle test ...
0
votes
0answers
38 views

How to create an instance of the deployed contract in Truffle Console?

I am trying to learn Truffle tool using the tutorial at: Truffle tutorial I am writing the following command at Truffle console to create an instance of the deployed contract but I am getting the ...
3
votes
1answer
86 views

Non-specific error from truffle debugger

I am testing a contract which is using ecrecover function of solidity. While its testing when i go with a failed test case while debugging, it doesn't go step by step and at the end return the same ...
1
vote
1answer
166 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 ...
0
votes
0answers
12 views

Truffle test stuck when testing with geth endpoint

I tried to test the truffle suite official metacoin example using truffle test. I opened a local private chain using geth with http rpc service open at localhost:8545. My truffle-config.js file is ...
0
votes
1answer
213 views

Vyper: Truffle test read mapping value inside struct

I have the following struct inside my vyper file: races: public({ start: timestamp, end: timestamp, racersBetHash: bytes32[address], racersBetAmount: wei_value[address] }[int128]) Then I ...
0
votes
2answers
50 views

Deploying contract to infura via @truffle/hdwallet-provider is hanging

I created a contract and deployed to Ganache test network successfully but it is not deploying to infura. //this section is clean. worked for Ganache var output = JSON.parse(solc.compile(JSON....
0
votes
0answers
23 views

Truffle + Infura Mainnet deploy. Transactions never get mined, timing out after 750 seconds

The contract deploys on Rinkeby without a hitch, but when it comes to mainnet it is erroring out strangely. Infura's HTTP endpoint was giving me Invalid JSON RPC RESPONSE "", so I decided to ...
0
votes
2answers
66 views

Truffle best practices - unit vs integration tests

Think about having two contracts: MockToken Faucet (which takes token address as constructor parameter) To unit test Faucet I would create two new instances: const token = await MockToken.new() ...
1
vote
1answer
240 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
1answer
31 views

Can't unlock account while deploying contract with truffle

I am trying to set up a private blockchain with geth, using truffle to deploy a smart contract to it. My goal is to get a private blockchain running with several accounts, deploy some contracts to it ...
0
votes
1answer
664 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
0answers
26 views

'VM Exception while processing transaction: revert\n' Error Processing transaction

I have read in various posts that this error occurs when there is a problem with executing function. So I'm asking about this error in regards to the code I have written. Please see below: contract ...
0
votes
1answer
20 views

Truffle Console error : invalid number value. Value must be an integer, while executing commands from a tutorial

I am trying to execute commands from the following tutorial: medium Dev Tutorial I am getting an integer error while executing a command: truffle(ganache)> balanceInEth = address => web3.utils....
7
votes
5answers
4k views

Change truffle develop port

When I run truffle develop it starts a testnet listening at localhost:9545. Is there a way to change the port this testnet is running on? EDIT: I'm not looking for a way to configure which network ...
0
votes
0answers
19 views

Truffle Console: How to suppress unwanted message

I am trying to learn truffle features by going through the following tutorial. Its generating a huge message, please guide me if its wrong or not. If its not wrong please guide me how to suppress the ...
4
votes
1answer
304 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", &...
0
votes
1answer
141 views

Error npm installing consensys diligence takehome bignumber util

``` /sudo npm install Password: Unhandled rejection Error: Command failed: /usr/local/bin/git clone --depth=1 -q -b master https://github.com/debris/bignumber.js.git /Users/quantum/.npm/_cacache/tmp/...
0
votes
1answer
36 views

Error compiling OpenZeppelin 3.0 ERC20 using Truffle

I'm trying to compile this code using the Truffle command truffle compile pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract GLDToken is ERC20 { ...
0
votes
1answer
194 views

Loading truffle library in remix browser IDE

Besides writing smart contracts in the browser, I would also like to write my test in this IDE. Any suggestions how to load the truffle files in http://remix.ethereum.org? I appreciate your help!
2
votes
2answers
148 views

Truffle interaction with my smart contract getting Vm exception

pragma solidity ^0.4.23; contract Hotelbooking { event Transfer( address indexed _from, address indexed _to, uint256 _value ); mapping(address => uint256) public ...
0
votes
1answer
175 views

why i get a lot of errors when i use truffle?

Seems that i have a lot of lost dependencies for example installing sha3 errors: > node-gyp rebuild C:\Windows\system32\node_modules\sha3>if not defined npm_config_node_gyp (node " C:\Program ...
0
votes
0answers
18 views

Error Truffle Console: web3.fromWei is not a function

I am executing commands from a tutorial at: JustDev Tutorial on Medium I am executing the command: > truffle(ganache)> balanceInEth = address => > web3.fromWei(getBalance(address).toString(...
0
votes
0answers
12 views

Garbage Value on Truffle console while executing the commands from a tutorial

I am following the tutorial at: JustDev tutorial on medium When I execute the command: truffle(ganache)> Victim.deployed().then(contract => victim = contract) I am getting a huge output which ...
1
vote
0answers
56 views

Solidity function calls from javascript work locally but fail on ropsten,kovan etc with Error: Returned values aren't valid, did it run Out of Gas?

I have a smart contract whose function calls works fine when called locally using javascript and ganache. But when I deploy to ropsten and others, the calls to its functions fail with Error: Returned ...
1
vote
0answers
38 views

Deploy smart contract to private network

I have been having issues deploing any smart contract to my private network. I'm using geth 1.9.15. Here ALL the steps that I made to get the error: //CustomGenesis.json { "config": { &...
0
votes
2answers
172 views

How is gas price too low corrected (truffle deploy)?

truffle.js module.exports = { networks: { development: { host: "127.0.0.1", port: 8540, network_id: "*", gas: 4600000, gasPrice: 4000000 // Match any network id } ...
1
vote
1answer
302 views

I tried to deploy a contract on Ropsten, but always get the following error

PS D:\nodejs\rff\metacoin> truffle --network ropsten migrate Using network 'ropsten'. Running migration: 1_initial_migration.js Deploying Migrations... Error encountered, bailing. Network state ...
0
votes
1answer
38 views

Nothing happens whe I run truffle test

I am new to solidity. Maybe I am missing something obvious in the setup. But when I run truffle test, I get nothing, the terminal just stays there forever. $ truffle test ... and I don't know why, ...
0
votes
4answers
5k views

Error: Cannot find module 'truffle-hdwallet-provider'

I got the following errors while trying to deploy my smart contract: sers-Air:lottery user$ node deploy.js internal/modules/cjs/loader.js:582 throw err; ^ Error: Cannot find module '...
0
votes
1answer
21 views

My contract is deployed but instance is undefined

I have deployed a contract on the ganache blockchain successfully using truffle. In the truffle console, I can call the contract fine truffle(development)> MyCoin [Function: TruffleContract] { ...
0
votes
1answer
37 views

Invalid address

I deployed my contract in ganache. When I was started to call a function with two arguments I started getting an error. I used an address from ganache. Error: invalid address (arg="user", ...
5
votes
1answer
390 views

Truffle error “Don't set config.from directly”

I have parity running on my mac and I can start it with parity --rpcaddr 0.0.0.0 --rpcport 8547 --port 30305 --rpccorsdomain '*' --rpcapi "eth,net,web3" Once It's all sync'd up I then make a new ...

1
2
3 4 5
44