Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
1
vote
3answers
441 views

When creating a new contract I receive a “contract code couldn't be stored” error but the contract is still created

Sale.new({ from: state.account, value: value, gas: 4000000 }).then((instance) => { // do something with instance }).catch((err) => { alert(err) }) When the above code runs I sometimes ...
1
vote
1answer
458 views

Truffle Tutorial pet-shop with test-rpc adopt button doesn't work

I have followed the tutorial exactly like they showed in their page: http://truffleframework.com/tutorials/pet-shop except the following changes because they use "ganache" (currently bugged and ...
1
vote
1answer
370 views

Setting up a truffle project

I'm reading truffles's docs and am trying to build a custom project with a contract and a few test cases (written in a js file). I need to do this because testrpc is (considerably) faster than geth. ...
1
vote
1answer
432 views

Account balance does not decrease after send ether

For example here is my example function in smart contract: function adoptCreeptomas(uint256 beastQuantity, address referrer ) public payable whenNotPaused { msg.sender.transfer(50); } And then I ...
0
votes
2answers
768 views

truffle/web3 event listeners returns nothing

We have an event being triggered in a contract and our listeners on the client cant receive the return value. https://gist.github.com/stupeters187/9529b54fe0d48ee606ad06ced6b16031 Update: metamask ...
0
votes
1answer
74 views

truffle migrate --network kovan >> ProviderError: VM Exception while processing transaction: revert

I am a beginner. I can deploy to a private network but I can not deploy to a public network. I need a Deploy to the kovan test network. please help me. >truffle init >npm install truffle-...
0
votes
0answers
67 views

Truffle test including mainnet contract - Error: Cannot create instance of Whitelist; no code at address

Problem with the error Error: Cannot create instance of Whitelist; no code at address 0x6198149b79AFE8114dc07b46A01d94a6af304ED9 How do I have to setup truffle so that I can run a test which includes ...
0
votes
1answer
61 views

Swap ether to tokens on Uniswap V2 Router 02 fails

I am trying to buy DAI tokens from my smart contract using IUniswapV2Router02 contract BuyExample{ IUniswapV2Router02 usi = IUniswapV2Router02(...
0
votes
0answers
30 views

Cant call solidity function from app.js while sending transaction

Solidity function As i want to call function so that oraclize can send query function betOnTeam(uint team) payable public { update(); emit LogInfo("Oraclize query was NOT sent, ...
0
votes
2answers
63 views

Measuring deployment time of a group of transactions in a heavy load testing

I am currently trying to perform heavy load testing on a ERC20 token. My plan is to use truffle to test stuff like how long it would take for 500 transfer transactions to be deployed (on a private ...
0
votes
1answer
634 views

Error: VM Exception while processing transaction: out of gas - Truffle

I'm facing some issue with test cases, I wrote some simple function in my smart contract as following: function Create ( bytes32 _a, address _b, string _c, address[] _d, uint256[]...
0
votes
1answer
269 views

Export a JS package from Truffle?

Truffle has this whole build process for deploying fronted code that is kinda mediocre. Does anyone know if I can just have Truffle output a single javascript file that will work in a web3 enabled ...
0
votes
1answer
132 views

Truffle: how to setup some smart contract's attributes before writing test

For example I have a smart contract with 2 attributes: contract SimpleSmartContract { uint256 currentPrices; mapping(uint8 => uint256) public priceIncrements; } When I write test, I want ...
0
votes
1answer
558 views

Cannot connect to testrpc

I have a testrpc running on a virtual machine (Ubuntu 16.04) and it works properly when I interact with it using the truffle console. My only goal is to call a smart contract that simply sends ether ...
0
votes
1answer
163 views

truffle-contract: cannot test method before real consume ether method

I am using truffle-contract for connecting between frontend and smart contract. Currently, I can call method on smart contract and can consume ether successfully. const result = await instance....
0
votes
2answers
677 views

using abi generated by truffle in DApp

I use truffle to deploy contract to ganache network. I like to use the json file generated by the truffle in the DApp rather writing messy ABI into it. I tried the below piece of code and it gives ...
0
votes
1answer
492 views

Upgrading to solidity version 0.5.0 getting deployment failed error with same smartcontract perfectly deployed on 0.4.24

The same smart contract is running smoothly in solidity version 0.4.24 but now when I update the solidity version and solving a lot of bugs inside my smart contract I intended to deploy that in ...
0
votes
1answer
445 views

“instance.at(addr) is not a function” in truffle console (access to non-migrated contracts)

I have a setup with one contract that is a singleton and is migrated to e.g. a testnet through the truffle console. This contract "creates" new contracts, which I want to access in the truffle console....
0
votes
1answer
190 views

Getting error in the contract code “please check your gas amount”

I am getting this error: Error: The contract code couldn't be stored, please check your gas amount. This is when I am importing one extra contract with the name of TimedCrowdsale from ...
0
votes
1answer
542 views

Truffle Exec Gets Stuck [closed]

I want to exec a script in the truffle console. script const artifacts = require('./build/contracts/Message.json') const contract = require('truffle-contract') const Message = contract(artifacts); ...
0
votes
0answers
60 views

command line brings up code instead of running commands [duplicate]

I am trying to run truffle commands on commandline but it brings up the code file instead like this
0
votes
0answers
211 views

Truffle Drizzle: Passing String address results in Invalid Number of Parameters

I have a view function in my contract that takes an address as a parameter and returns a uint: function getNumber(address _address) public view returns (uint) { require(_address != 0x0); ...

1 2 3 4
5