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

An error occurred while running C:\Users\path marketplace1\marketplace1\truffle-config.js! Did you forget to `npm install` your project?

I am getting this error when I try to add the truffle-config file to my project in ganache. What to do?
0
votes
1answer
309 views

web3 Uncaught TypeError: Cannot read property 'createBox' of undefined

i'm trying to create simple application by using solidity 5.0.0 , Truffle v5.0.0 and web3 web3@1.0.0-beta.34. but i've gotten Uncaught TypeError: Cannot read property 'createBox' of undefined. ...
0
votes
0answers
8 views

Any idea how to add new contracts into drizzle react app using the address?

I have a react app which creates new contracts. lets say A creates B. I have the addresses of the newly created contracts of B. How do i add the newly created contracts of B using its address to ...
4
votes
1answer
164 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 ...
0
votes
1answer
24 views

In up gradable design pattern how to set the allowed contracts or owner during deployment of smart contracts

Functional Background: Contracts for upgradable design pattern: ProofDB.sol : contract to store the data. Proof.sol : contract that contains the business logic. Registry.sol: contract that ...
20
votes
5answers
18k views

How to listen for contract events in JavaScript tests?

I'm trying to trigger events in my solidity contract to output some debug information in my javascript tests. However the events seem to get never caught. That's the relevant contract code: pragma ...
0
votes
1answer
20 views

Truffle js test a call with arguments

I am trying to testa a smart contract function that receives an arg. I'm using truffle javascript tests, this is the smart contract function, very simple: function addExam(string memory hash) public ...
1
vote
1answer
75 views

Issue with selfdestruct() getting an error

main contract function which calls my secondary contract function gameOver(uint _matchId)public payable onlyOwner returns(bool) { Match my_match = Match(matchTracker[_matchId]); bool success ...
0
votes
1answer
47 views

Gas amount to store a contract?

i'm trying to run truffle migrate and it gives me always this error. Error: The contract code couldn't be stored, please check your gas amount. MBP-de-Alicia-2:smartContracts alicialombarte$ truffle ...
0
votes
1answer
734 views

Specify different solc compiler for different files in truffle?

I am using truffle, and have a number of x.sol files in the contracts directory, different files require different versions of the compiler - how do i deal with that? I think i SHOULD be able to do ...
1
vote
1answer
127 views

Solidity Error:Running Out of Gas / selfdestruct problem

I've been going through 'Building Cryptocurrency and its ICO' by DappUniversity. I know many have questioned this issue and I've been through all the post but couldn't resolve it. The problem is self-...
0
votes
1answer
17 views

How can fix in smart contract written in solidity?

TypeError: Invalid type for argument in function call. Invalid implicit conversion from address to address payable requested. selfdestruct(admin); pragma solidity >=0.4.21 <0.6.0; ...
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 ...
0
votes
1answer
23 views

Uncaught (in promise) Error: Invalid JSON RPC response: “”

How to solve this error that show in the picture of chrome browser below? Bundle.js var contractABI = []; var contractAddress = '0x9B69fA769D70728d14a70A4F10E7078032FF1632'; var web3 = new Web3('...
0
votes
1answer
68 views

Solidity Test - which are the variables and keywords over here

Can anyone help me in understanding what is happening over here? I understand that the contract name is TestAdoption, but after that - what is the first word "Adoption"? The second word "adoption". I ...
0
votes
2answers
79 views

promise chaining in test.js file

it("should throw an exception if you try to buy an article that does not exist", function() { return ChainList.deployed().then(function(instance) { chainListInstance = instance; ...
2
votes
1answer
166 views

How to implement percentage deposit function to smart contract

I need to implement on the deposit function when the ownerAddress is doing a deposit a 10% to be freeze in the smart contract and and if the ownerAddress want's to call the returnDeposit function by ...
11
votes
3answers
7k views

Difference between Ganache and Truffle

What is the difference between this two? I understand that Ganache is like a fake blockchain, but Truffle has that too ? What are the limitations of each and under which circumstance we use either ...
0
votes
1answer
58 views

Windows: command “npm install drizzle” give me an ERR!

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support npm WARN deprecated tar.gz@1.0.7: ⚠️ WARNING ⚠️ `tar.gz module has been deprecated and your application is ...
0
votes
1answer
27 views

Why do I always get “Returned values are not valid, did it run Out of Gas”?

I'm new on Ethereum blockchain and I'm working on deploy and using smart contract using truffle on my private blockchain. I have followed exactly this guide https://www.trufflesuite.com/docs/...
0
votes
1answer
28 views

Metamask TestRPC shows 0 Ether while connecting to Ganache- CLI

I've gone through various Q/A(s) of the problem of ganache-cli and metamask not linking but after trying all the solutions, still doesn't work for me. As soon as I type ganache-cli in windows cmd ...
6
votes
3answers
1k views

How to use bignumbers in truffle tests?

I am testing a smartcontract with Truffle V5. All works well if I do not use all decimals. If I set 18 decimals all explodes. The test code is this (from truffle docs): const MetaCoin = artifacts....
0
votes
1answer
26 views

Truffle. Test .call() args . Error: invalid string value (…) at PromiEvent

I have a js truffle test: it("should add an exam to the exams list", async () => { // This should test the complete functionality let hash_test = "fB03aA5E2E71De1470ae2"; let instance =...
0
votes
1answer
43 views

problem with sequence deployment

I followed this way of deploying contracts using truffle. // Deploy A, then deploy B, passing in A's newly deployed address deployer.deploy(A).then(function() { return deployer.deploy(B, A.address)...
1
vote
1answer
19 views

Solidity. Truffle test not passing “expected { _events: {},…” to equal

I can't get a test to pass, for me it is very clear but I am missing something obvious: This is the smart contract: function getContractOwner() public pure returns (string memory ...
0
votes
1answer
17 views

What are the ways to call a smart contract function during development?

What are the ways to call a smart contract function during development using Truffle simulated VM with a GUI interface (like Remix or EtherScan offer)? I know I could use CLI options like Truffle ...
0
votes
0answers
15 views

Truffle test passing when it should not

I have this test, it clearly shouldn't pass: contract("Exams", function(accounts) { it("should keep the contract owner", function() { // var expectedValue = "...
1
vote
1answer
38 views

During gas-free transaction get an error “No relay responded! 4 attempted, 4 pinged”

I did all modification related to this instruction https://github.com/tabookey/tabookey-gasless However, when I'm trying to write some tests it fails and provides me the following error Error:...
0
votes
1answer
280 views

Unhandled Rejection (Error): invalid string value (arg=“x”, coderType=“string”, value=5)

Using Truffle unbox react to unbox a boilerplate. received the following error from running npm run start Changes: Addition of "memory" parameters in the simpleStorage.sol Changed unit to string in ...
0
votes
1answer
362 views

truffle migrate does not return anything

I am following the tutorial from Truffle to create a "pet shop" contract. I can follow everything until he tells me to truffle migrate. Here is the contract: pragma solidity ^0.5.0; contract ...
0
votes
1answer
15 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, ...
1
vote
2answers
593 views

Issue with Ganche and Truffle with Metamask. Can't load token balance

I'm testing to create a token in Truffle; it compiles fine, but it won't load the balance of the token in to Metamask. I've set the connection correct: it does load the ETH balances of the Ganache ...
2
votes
4answers
3k views

Unable to install Truffle - Command Not Found

I am unable to install Truflle on my Windows 10. I am running latest versions of npm and node. I have tried uninstalling and then reinstalling but it still doesn't work. I have installed Truffle ...
0
votes
1answer
45 views

Difference between the way methods are called in smart contract

What is the difference between instance.totalSupply() vs instance.methods.totalSupply().call() To my knowledge one is for truffle and the other is for web3. But truffle also uses web3 then why can ...
1
vote
1answer
42 views

What are the inputs to the truffle Txn?

I am testing truffle now and I want to know more about what it deploys and how. It seems to use two txns. I have some results - Running migration: 2_deploy_contracts.js Deploying CA12... ... ...
3
votes
2answers
984 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() ...
1
vote
1answer
141 views

Debugging a VM error in solidity

I'm getting the following error while running a test in truffle: Error: Returned error: VM Exception while processing transaction: revert Now, the code is simply to big and complicated to run ...
1
vote
1answer
59 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 ...
0
votes
1answer
365 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
1answer
129 views

truffle deploy live | transaction not mined within 750 seconds

I'm trying to deploy my smart contract to the live ETH network. I've done the same process on rinkeby and it works fine. However during the block mining phase it times out and gives the error: " ...
1
vote
1answer
115 views

How to call variadic function in erc223 contract

There is two transfer function in my contract, And i m trying to call transfer function of erc223 for transfer token to contract address using this function. Token.deployed() .then(function(i) { ...
1
vote
1answer
179 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 ...
0
votes
1answer
11 views

How can I add new contracts generated from a factory to my drizzle-react app?

I have a Factory contract which creates new contracts. How do I get the new contract into my drizzle-react web app? I am using to send the transaction to create a new contract but I don't know how ...
0
votes
0answers
20 views

How can MetaMask alert about transaction errors before they are caused?

The MetaMask extension has this feature to warn about transaction errors before a transaction is being made: ALERT: Transaction Error. Exception thrown in contract code. How is this done? A dry ...
0
votes
2answers
176 views

Truffle error when deploy a contract

Does anybody know how to solve this? I've try to compile and deploy my contract to get the address, why obtained this error Error: 1_initial_migration.js ====================== Deploying '...
0
votes
1answer
18 views

Are there any virtual IoT simulators that facilitate the connection with Ethereum Blockchain?

I already built a smart contract for Ethereum Blockchain by using truffle; Now, I'm looking to connect my smart contract with the IoT environment. So are there any IoT simulators (platform, framework,...
0
votes
0answers
18 views

How to fix transfer in etherum

$ truffle test Using network 'development'. Compiling your contracts... =========================== > Compiling ./contracts/DappToken.sol > compilation warnings encountered: /home/geet/...
1
vote
1answer
67 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 ...
0
votes
1answer
68 views

Truffle console no compile or init options

While using truffle.cmd console I tried to use the compile option, or even init. These options are not available, so I cannot compile using console. truffle(development)> .help .break Sometimes ...
0
votes
1answer
154 views

Solidity: How are multiple return values returned?

Working in truffle with TDD testing and am getting some errors when evaluating the return values of some functions. If a function is returning multiple values in Solidity, how are they presented? Is ...