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

How to work with MythX in a Truffle project to analyze a contract?

I work with Truffle and Windows Powershell. I have a smart contract. Now, I want to analyze the contract's security with Mythx. For that, I installed pip3 to install MythX CLI after that. Now, I have ...
1
vote
1answer
132 views

passing defaultBlock “pending” param to a truffle-contract call

I need the pending balance of my contract. As far as I understand I could do it with web3: web3.eth.call(callObject [, defaultBlock] [, callback]) Can I pass defaultBlock to truffle-contract ...
0
votes
1answer
10 views

The network id specified in the truffle config (4447) does not match the one returned by the network (4777)

Please, the error messsage is in this imgur link, how's that even possible? They are the same network, but I still cannot test my smart contract via Truffle. https://i.stack.imgur.com/vykIa.jpg Code ...
1
vote
1answer
241 views

No output when writing data to IPFS and storing its hash through Solidity

So I am using truffle. Following from Creating a form in IPFS for users to enter data [check the code in answer], doing some changes: Contract name - IpfsContract.sol test.js uses the following JSON ...
0
votes
0answers
16 views

When truffle deploy a contract to multiple network, will this contract have a unique address valid on all of them?

I think the question say it all. If I deploy some contracts on multiple network in the same deployment. Will they each have a unique address valid on all network or will they each have different ...
2
votes
2answers
152 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
26 views

I have a truffle version problem. and I've done it but it's not working

I've done npm install -g solc@0.4.16 and it reads solc@0.5.16 when doing the truffle version compilers: { solc: { version: "^0.4.26", // A version or constraint - Ex. "^0.5....
1
vote
1answer
50 views

How to interact with a contract from Truffle console without compiling and deploying?

I am looking for a solution that does not require having the contract solidiity code compiled and deployed. For example, if I want to send approve on WETH on live network from the console, without ...
0
votes
1answer
249 views

Trouble while installing truffle-contract module

When I run the command sudo npm install truffle-contract it gives me this error: npm ERR! code 1 npm ERR! Command failed: /usr/bin/git clone -q https://github.com/debris/bignumber.js.git /home/ubuntu/...
0
votes
0answers
19 views

How to use Mocha reporter in Truffle console?

I work with Truffle and Windows Powershell. I set Mocha in truffle-config.js like: module.exports = { . . . mocha: { reporter: '...
0
votes
1answer
285 views

TypeError: tokenInstance.balanceOf is not a function

It happen when use truffle test, here my contract file: pragma solidity ^0.5.0; import "./DappToken.sol"; contract DappTokenSale { address payable admin; DappToken public tokenContract; ...
1
vote
1answer
660 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 ...
2
votes
1answer
81 views

Simulating the DAO attack using truffle

I'm trying to simulate the DAO attack for a research project I'm working on. I have truffle and testrpc setup on my machine. I use the sample code given in this tutorial. I try calling the BankAttack ...
0
votes
1answer
25 views

Trying to translate proxy deployment script from Truffle to Buidler. Not sure how

I have a custom proxy. Writing a deployment script for Buidler. Know how to do something in Truffle but not sure how to do the equivalent in Buidler. Truffle let testContract = await deployer.deploy(...
0
votes
2answers
197 views

How to deploy truffle project on web server?

I've developed a DApp using truffle suite and now I want to deploy this dapp online so that everyone will be able to access it over the internet. I've used Rinkeby-Testnet for smart contract ...
0
votes
2answers
849 views

Running solidity-coverage with truffle gives error: can not find 'coverageEnv/migrations'

Running solidity-coverage gives the following error: $npm run coverage ... Writing artifacts to ./build/contracts Launched testrpc on port 8555 Running: node --max-old-space-size=4096 ../...
0
votes
1answer
164 views

How to solve eth_getFilterChanges looping when deploying with truffle (parity)?

I am using truffle migrate and I get some kind of loop which just endlessly prints out eth_getFilterChanges. How can this be solved? I have used this truffle.js module.exports = { networks: { ...
0
votes
1answer
372 views

Contract not using Upgraded Proxy Contracts

There's 2 contracts A and B, A imports B, where B is a library that can be upgraded. To achieve this, I tried replacing B with a proxy contract and a delegate contract. We now have contracts Foo, ...
1
vote
1answer
15 views

Running test with multiple contract address on a local Ganache blockchain

I'm developing with Truffle and Ganache I have an standard ERC20 ABI that I import in my test file. it only has 3 optionals functions name, symbol and decimals. const Token = artifacts.require('./...
2
votes
1answer
264 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 ...
0
votes
1answer
112 views

Why I am unable to write to contract in ethereum wallet?

I clicked on the watch contract and entered address and ABI. But I can't see any functions to write to contract. I compiled and deployed contract by using truffle framework ABI: { "...
0
votes
1answer
155 views

Deploying with Truffle

I deployed a contract through remix and then I run the following code MyContract.deployed() .then(instance => { c = instance; return c.getCreator(); }) .then(result => { ...
0
votes
1answer
105 views

web3-core-method.umd.js:1191 Uncaught (in promise) Error: Transaction has been reverted by the EVM:

Keep getting this error and really not sure what's causing it. Smart contract: contract BasaltStore { // struct of how a document will be stored struct documentStore { // unique id of the ...
1
vote
1answer
3k views

gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

I used the command truffle unbox react to build a dapp. It is just the initial step of my dapp development. However, it sucks. It continually pops up gyp ERR! build error gyp ERR! stack Error: `C:\...
1
vote
2answers
91 views

Unable to upgrade Truffle

I am trying to update Truffle on Ubuntu 18.04. I currently have version 5.1.33 of Truffle installed on my system. u/lc2530hz:~$ truffle version You can improve web3's peformance when running Node.js ...
0
votes
1answer
185 views

Why does the transaction stay in queue from more than 240 second

I am running quorum nodes via the Quorum-maker script, and when trying to call functions from my already deployed smart contract, I get this error : Transaction ...
0
votes
1answer
30 views

How to handle Ropsten's smart contracts with Truffle?

I work with Truffle, Metamask, and Windows Powershell. I deployed my smart contract to Ropsten with Truffle by the below command in Powershell: truffle migrate --network ropsten Now, I need to ...
1
vote
1answer
28 views

Solidity - Error: Digest method not supported when calling ripemd160

As part of a large project I am attempting using ripemd160 in solidity. Ive boiled down the issue that im having to the code below, when calling ripemd160 I get the error: Error: Returned error: VM ...
0
votes
1answer
334 views

TypeError: balance.toNumber is not a function

I need check that token has no balance when selfDestruct was called, but shows an error that balance.toNumber is not a function in the test file. DappTokenSale.sol function endSale() public { //...
0
votes
1answer
50 views

Cloning Uiswap: Error: Returned error: VM Exception while processing transaction: revert in truffle migrate

Starting to work with a uniswap simple fork using truffle and ganache, and I am having this: truffle migrate --reset Error: Returned error: VM Exception while processing transaction: revert at ...
0
votes
2answers
239 views

Empty bytes32[] in truffle console

I am trying to get from truffle develop console an array of identifiers using a custom get function but the return array is []. Here is my contract: pragma solidity ^0.4.18; contract MyInfo { ...
0
votes
0answers
44 views

Swap Ether to tokens on Uniswap V2 Router Gas Estimation Error

I am trying to buy DAI tokens from my smart contract using IUniswapV2Router02: contract BuyToken { address internal constant UNISWAP_ROUTER_ADDRESS = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // ...
0
votes
2answers
53 views

Fund my Ropsten account to deploy my contract

I have a full geth node on my machine and I want to deploy my contract on Ropsten using truffle. How I can fund my coinable account with some ether to deploy my smart contract? I have tried fuusent....
0
votes
1answer
44 views

Truffle test does nothing but compile work

I just started seeing solidity and truffle. I created a new project with the truffle init command and try this test code to verify the deployment of a contract. const GreeterContract = artifacts....
0
votes
1answer
13 views

How do i change Truffle default account after contract deployment to interact with it?

I work with Truffle and Ganache along side Windows Powershell. Here, Truffle's default account is account[0]. I deploy my contract with that. After a while, i need to interact with the contract with ...
1
vote
0answers
69 views

UniswapV2 addLiquidityETH() reverting when trying to deploy to ganache locally

I'm trying to locally deploy a contract similar to sushiswap, but I keep getting a revert from addLiquidityETH(), no message other than VM Exception while processing transaction: revert //module....
0
votes
0answers
22 views

how to get public key in ethereum

Error Says Method shh_getPublicKey not Supported. How can i solve this and get public key.
0
votes
1answer
490 views

Error: Cannot find module 'ethereumjs-wallet'

A truffle test needs ethereumjs-wallet const wallet = require('ethereumjs-wallet'); I tried npm install ethereumjs-wallet and even npm uninstall ethereumjs-wallet npm install --save ethereumjs-...
0
votes
1answer
34 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
1answer
325 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"...
0
votes
2answers
293 views

Unknown network “ganache”. See your Truffle configuration file for available networks

I am working windows 10 and have both truffle.js & truffle-config.js I am using command truffle migrate --reset --networks rinkeby Error produced: Unknown network "ganache". See ...
1
vote
1answer
110 views

browser-solidity debug alternative for more automate process (rather than manually type in the function input everytime)

As specified in the title I use truffle to test now, but often times it just returns the error msg "invalid opcode" instead of clearly stating what happened. Any other testing/debugging tips will ...
1
vote
1answer
267 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; ...
0
votes
2answers
131 views

How to use cacheSend of drizzle library when the method needs two parameters

Should it be like the example below(2,2 as two different parametres) Ex: const stackId = drizzle.contracts.SimpleStorage.methods.set.cacheSend(2,2, {from: '0x3f...'})
0
votes
1answer
64 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
344 views

Comparing msg.value using javascript test always fails

So I have this solidity function: function claimGoodTest(uint256 typeId) public payable { if (msg.value < 4000) revert(); } I test it with the following: var result = await contract....
0
votes
1answer
371 views

Can I find constructor arguments from truffle artifact?

I'm in the process of verifying my contract on Etherscan. Etherscan asks for ABI-encoded constructor arguments during the verification process, though I was a bit silly and don't quite know what they ...
0
votes
0answers
36 views

Which ethereum framework to choose Traffle vs Brownie?

I know that the most used frmaework for smart contract testing deployment etc is Traffle. But, since I am not very good at javascript (i am mainly coding in python)- I saw there is an option to use ...
0
votes
0answers
17 views

truffle develop not working in the pc

I am using Windows 10. ** When I run "truffle develop" commend is give me an error:** λ truffle develop user@DESKTOP-V44IVRJ MINGW64 ~ $ truffle develop ExtendableError: Could not find ...
1
vote
1answer
32 views

Pass json of address to Contract

i am wanting to import an array of json data into my contract on construct. I want to pass it an array of address to be saved into an array in my contract. Is this possible? I have seen a few posts ...

1 2 3
4
5
46