Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
81 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
2answers
138 views

Fetch the last state of particular asset for particular date

I have one smart contract, in which I am doing mapping of machine id and user id mentioned as below: mapping(bytes32 => uint256) public machineAllocs; machineAllocs[machineId] = userId; Now, I am ...
0
votes
0answers
31 views

Error: Contract not deployed after cloning private geth network from one server to another

Steps to reproduce: Private geth network is running on server1. Deploy contract using truffle and make a few transactions. Stop geth n/w of server1 and copy its entire directory (accounts.txt, boot....
0
votes
1answer
48 views

Deployed contract address in Truffle does not match Ganache

I have truffle set up with Ganache. I am running tests on my solidity contract that involve sending ether to the contract and withdrawing it from the contract. Funny thing is my tests are PASSING, but ...
1
vote
1answer
80 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
0answers
8 views

how to verify a contract using truffle-plugin-verify

I'm trying to verify a simple contract. The contract is already deployed on the Ropsten network. import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/...
4
votes
2answers
331 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", &...
1
vote
1answer
23 views

Truffle Test: Simply comparing BigNumber to String works, but WHY?

Reading from this post, one should not use toNumber() when working with uint256, so when writting the below test, I was expecting it to crash, but it does not, instead it runs to success! why ? it(&...
0
votes
1answer
59 views

Compiled solidity contract run out of gas on deployment

I have a solidity contract that compiles ok (0.5.1 compiler version), but it runs out of gas if I deploy the whole of it. If I comment some of the external methods of the contract, it compiles and ...
0
votes
0answers
22 views

Truffle returns no code at address after contract update

etherjs (5.0) is used to deployed a smart contract Hello.sol. Here is the js code (truffle 5.1.52/ganache CLI 6.12.1): import { ContractFactory, ethers } from "ethers"; let privateKey = ...
2
votes
1answer
395 views

openzeppelin,VM Exception while processing transaction: revert

using openzeppelin-solidity to create crowdsale. Then I use this statement to Buy Token: MyCrowdsaleInstance.sendTransaction({ from: purchaser[1], value: web3.utils.toWei("0.5", "ether"), ...
1
vote
2answers
1k views

Contract should be marked as abstract

I'm getting the error: Contract "StarNotary" should be marked as abstract. pragma solidity >=0.4.24; import "../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract ...
1
vote
1answer
22 views

Truffle ganache fork

Suppose I have access to a full archive Node and I want to fork from a specific block using Ganache. Using ganache-cli, I can specify where to fork using the --fork parameter by passing it the Node ...
0
votes
1answer
71 views

ParserError: Expected ',' but got ';'

I`m trying compilate this code and getting Parse error pragma solidity ^0.6.0; contract ZooFactory { event NewZoo(uint zooId, string name, uint dna); uint dnaDigits = 24; uint ...
0
votes
0answers
18 views

Not Able to create 1 ERC 20 tokens with 18 decimals of my own using code provided from open zeppelin truffle

I am trying to create my own ERC 20 token but I ran some issue with openzepelin code. Here is the code var SampleToken = artifacts.require("SampleToken"); module.exports = function(deployer)...
1
vote
0answers
12 views

Deploy contracts without deploying Migrations

I would like to deploy my contracts to mainnet using truffle. I figure it's the easiest and safest way to do it since I already deploy to testnet using truffle. The problem is I don't want to deploy ...
0
votes
0answers
18 views

Slither Error: Invalid compilation: Solidity version not found ['']

I work with Truffle Fluidity to get an analysis on my contract. My contract is in contracts file that Truffle determines that. I preformed all steps that Truffle mentioned in document. I work with ...
1
vote
1answer
508 views

UnimplementedFeatureError: Encoding type “struct BiddingContract.Bidder memory” not yet implemented

The code is broken with the new upgrade v0.5, using Truffle v5.0.1 (core: 5.0.1) struct Bidder { address bidders_address; uint productId; uint bidValue; } struct Product { uint ...
2
votes
1answer
1k views

token transfer fails in crowdsale contract

I have a token contract and a crowdsale contract. When I try to send ether to the crowdsale contract from accounts[3] (or any other really), I get an opcode error: Error: VM Exception while ...
0
votes
2answers
25 views

Resolve solidity compiler error

I am trying to create a smart contract and I am using ganache, visual studio code and truffle for that purpose. The versions installed in my windows system are: Truffle v5.1.49, Solidity v0.5.16 (solc-...
1
vote
1answer
178 views

Unable to read contract instance variable from deployed contract with truffle test

I am attempting to write some unit tests as I'm working on the development of some smart contracts, but I've run into an issue that's preventing me from continuing. I'm attempting to check the address ...
0
votes
1answer
17 views

Truffle doesn't see the smart contract deployed on ganache

etherjs (5.0) is used to deployed a smart contract Hello.sol. Here is the js code (truffle 5.1.52/ganache CLI 6.12.1): import { ContractFactory, ethers } from "ethers"; let privateKey = ...
1
vote
1answer
94 views

Not able to send Ether to contract

I am trying to send Ethers to a contract deployed on Ganache but I am getting VM Exception while processing transaction: revert, the same logic is able to transfer Ethers to other account. Following ...
1
vote
1answer
12 views

truffle command line version older than it is in package.json

After installing Truffle with yarn add truffle, the following line shows up in package.json: "truffle": "^5.1.52" In the root directory of the project, the truffle version ...
1
vote
1answer
12 views

What is the easiest way to interact with your contract in a development environment?

Is there some form of toolkit which generates a console similar to the one on etherscan, where you can call functions that are defined in your contracts ABI? It seems quite painful having to write the ...
0
votes
1answer
252 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 ...
0
votes
1answer
86 views

How to get block size and block mining time while using ganache and truffle

I am using truffle framework and Ganache (GUI) as emulator. I want to know the size of the generated block. Also I want to know the time required to mine/generate/create a block after the command. I ...
0
votes
0answers
23 views

uncaughtException : RangeError: Maximum call stack size exceeded

Facing an issue while working multi-http-provider. When I write var Web3 = require('web3'); require('multi-http-provider'); It throws an error uncaughtException : RangeError: Maximum call stack size ...
0
votes
2answers
39 views

Does Truffle Test consume gas?

When I run the $truffle test command in the terminal does it consume any gas from my local blockchain(say Ganache)?
0
votes
0answers
15 views

Error parsing @openzeppelin/upgrades/contracts/upgradeability/ProxyFactory.sol

The @openZeppelin's ProxyFactory.sol("@openzeppelin/upgrades": "^2.8.0",/"truffle": "^5.1.51") is used in development of proxy contract: pragma solidity ^0.7.0; ...
0
votes
1answer
34 views

Can we take input of an address and pass it on the function to send ether using truffle and web3?

Actually i am trying to create a betting application so when i get the result that Home team has won Before this i will be taking both address as input (betting do two address whoever wins gets the ...
0
votes
0answers
13 views

truffle does not find emitted event when it includes a string parameter [closed]

I am finding some weirdness with the Truffle test suite where it recognizes an event if it takes only an address argument, but if it takes an address and a string truffle does not pick it up in the ...
0
votes
0answers
19 views

Solidity - Setting the length of an EnumerableSet UintSet

Is it possible to pre-set the length of the set of an EnumerableSet.UintSet type? For instance, if I declare this mapping: mapping (address => EnumerableSet.UintSet) private agentTickets; and then ...
2
votes
1answer
5k views

truffle test fails with ReferenceError: A is not defined

I am not sure what is missing. I keep getting "Reference error". Please find the details below Step 1 : Ubuntu# truffle compile Step 2: Ubuntu# truffle migrate --reset Using network 'development'....
0
votes
1answer
148 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 ...
1
vote
1answer
245 views

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error?

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error in solidity while compiling through truffle ? How to fix it ? Using solidity compiler version - 0.5.9
1
vote
1answer
114 views

ERC721 Transfer Event issue

Looking at the open-zeppelin ERC721 Contract's code, I see that the very last thing that its mint function is doing is call emit on the contract's pre-defined Transfer event. My question is: how do ...
2
votes
1answer
168 views

Branch a Truffle test into various Ganache blockchain states

I am currently testing a contract that can evolve in different ways, depending on the interaction between parties. But all these possible scenarios share the same initialization. So, the question I ...
0
votes
1answer
81 views

Quorum 7nodes example unable to finish simplestorage migration using privateFor

I'm following this example: truffle quorum example I created a cluster using docker-compose and all the nodes are up and running but when I run the truffle migrate command the migration doesn't end ...
2
votes
1answer
71 views

Transaction execution and interacting with truffle

pragma solidity ^0.4.23; contract Hotelbooking{ address receiver; function deposit(uint256 _amount) payable public { require(msg.value == _amount); // nothing else to do! ...
1
vote
1answer
79 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 ...
2
votes
1answer
100 views

How to trace the line where a tx failed in truffle tests?

I know about 0x's sol-compiler and sol-trace. I used them before and they do exactly what I'm looking for, but these modules bring significant overhead when used with truffle. Check out this file to ...
0
votes
2answers
92 views

How to specify custom test directory path in truffle-config.js

How do I specify a custom test directory path in truffle-config.js? My test directory is not present at the same level as truffle-config.js, it is residing in a different directory. Truffle has ...
1
vote
3answers
134 views

Can the mapping storage change after contract deployment?

I am beginner in mapping.I work on Truffle and Ganache. I deploy the following contract: pragma solidity ^0.5.12; contract customerFinder{ mapping(uint256 => address payable) public ...
1
vote
1answer
76 views

Which one of methods should I choose for deployment of smart contract geth or a wallet if I have to build API for smart contracts in nodejs?

I'm having trouble to understand which method would be better for deployment geth or a wallet if I'm building API in nodejs using web3. Where exactly is the contract stored?? Is the contract ...
0
votes
2answers
3k views

Cannot read property 'deployed' of undefined issue

I am trying to launch an Election-Dapp. I have these dependencies installed: - Nodejs v9.11.1 - npm v5.8.0 - Truffle v4.1.3 - web3js v0.2 - ganache-cli Below is my solidity contract pragma ...
2
votes
1answer
381 views

Calling function from another contract reverts

I've been developing a dApp that needs ERC721 tokens. I have three contracts, a base contract, the one to mint tokens and another one for auctions. The inheritance looks like Base > Token > Auctions. ...
1
vote
1answer
142 views

Why does triggering a send on a contract method work, while call doesn't?

I'm still somewhat new to web development and solidity, so do correct any of my misunderstandings. I've been working with web3 on the front end, but now I'm trying to set up a server side web3 ...
0
votes
1answer
219 views

SOLVED - truffle develop command doesn't return anything

I updated my node and nvm version. Then I ran truffle develop command on my project folder, this command doesn't return anything.. why? it just stays... local blockchain dosen't start. Versions: ...

1
2
3 4 5
46