Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

How to get transaction fees and minus it from balance

I created an auction exchange smart contract using solidity programming language and I am using ganache for testing this is a test file written in JavaScript. seller is the creator of auction and ...
Huzaifa Ahmed's user avatar
0 votes
0 answers
20 views

When sending a transaction using web3 I recive EIP1559FeeMarketTransaction.fillFromResult error

I am using a ganache local blockchain and truffle to test my smart contracts, this problem started to occur all of a sudden, since before I wasn't running into this problem. So when I call the ...
blackopps166's user avatar
0 votes
1 answer
13 views

Metacoin - why does `send` show the contract address in `receipt.to`?

I've recently started learning web3 and am playing with truffle. truffle(develop)> truffle migrate ... Deploying 'MetaCoin' -------------------- > transaction hash: ...
HankCa's user avatar
  • 101
0 votes
0 answers
11 views

How to find issue with a bare bone token bridge

Basically, I want to setup a very simple token bridge try to bridge some custom tokens between BSC testnet & Goerli testnet. For BSC testnet, I created 2 solidity code: TokenBSC.sol & ...
Yong Dong Zhang's user avatar
1 vote
0 answers
7 views

Truffle console: debug not showing me the code line that reverts a transaction

I'm trying to deploy my own swap router on the development network. I've got a transaction hash which reverts. I'm calling truffle console and then, when I press enter I get undefined. I can't reach ...
Radek_pl's user avatar
  • 761
1 vote
1 answer
15 views

VM Exception while processing transaction: revert while buy token

I built a token based on ERC20, when I try to buy tokens I get this error In the truffle console Quinn.deployed().then(function(ins){token=ins}) QuinnSale.deployed().then(function(ins){tokenSale = ins}...
Mizanur Rahman Sohan's user avatar
1 vote
0 answers
7 views

Mainnet fork deployment - Error: *** Deployment Failed *** "Migrations" hit an invalid opcode while deploying

I am trying to deploy contracts on a mainnet fork. I have my fork running with the command ganache --fork https://mainnet.infura.io/v3/$INFURA_API_KEY --wallet.unlockedAccounts=$MY_ACCOUNT --chain....
justinsacco's user avatar
0 votes
1 answer
43 views

Got `invalid opcode` when deploying a contract to Ganache test network from Truffle

I have launched Ganache 2.7.1 in Mac and using truffle 5.11.3. I tried to deploy below contract to Ganache but filed: helloworld.sol // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.18; ...
Joey Yi Zhao's user avatar
1 vote
0 answers
15 views

Can't pass Truffle test with an uint256 array as event property

I have this simple test in truffle: it("should emit the correct Transfer event", async function() { await this.contractNFT.multiSafeMint(accounts[0], "CID/metadata.json", 3, {...
viac92's user avatar
  • 33
1 vote
1 answer
31 views

Problems installing truffle

I've installed truffle multiple times, uninstall and installed again, all I get is command not found npm install -g truffle npm WARN deprecated [email protected]: testrpc has been renamed to ganache-cli, ...
ByteCypher's user avatar
0 votes
0 answers
15 views

Can not delete the address from the struct and array in JavaScript

My other functions are working so I guess other codes are fine. I am just getting this error after clicking the delete key: "Error deleting patient: Error: invalid address at v (web3.min.js:2:...
Jubayer Hossain's user avatar
-1 votes
1 answer
28 views

how can i deploy my Dapp?

what if I have deployed my smart contract on truffle and used ganache to deploy the same and i havn't used any test network, so if I go to deploy it on netlify to demonstrate the same will it work??
kaustubh sharma's user avatar
2 votes
1 answer
14 views

Truffle console: How to print uint array

How to print uint array in Truffle's Java script environment? Hi, I am following the link: Printing uint256 value to console while debugging with Truffle I am working on truffle console environment ...
zak100's user avatar
  • 1,406
0 votes
0 answers
47 views

abortHandshake(this, req, `Unexpected server response: ${res.statusCode}`);

truffle migrate --network sepolia Compiling your contracts... Everything is up to date, there is nothing to compile. /mnt/c/pr0/bootcamp-completed/node_modules/ws/lib/websocket.js:542 abortHandshake(...
Soyaya's user avatar
  • 31
0 votes
0 answers
22 views

How to deploy a smart contract using CREATE2 with truffle?

How can I deploy a new smart contract using CREATE2 upcode (EIP-1014) with truffle?
Ehsan Khodarahmi's user avatar
0 votes
1 answer
66 views

ERC20 transfer amount exceeds balance error in Solidity contract

I'm encountering an error while trying to transfer tokens from one address to another in my Solidity contract. When I attempt to print the balance of msg.sender, it shows a value of ...
Anantashayana Hegde's user avatar
1 vote
0 answers
7 views

In truffle, why are the accounts in testing different from the actual accounts of my mnemonics?

Say, the first account from my mnemonic yields 0x123, how come account[0] from accounts in the Truffle test suite differs from the original? Example: const BatchTransfer = artifacts.require("...
code_learner93's user avatar
0 votes
0 answers
11 views

Truffle not finding any functions (uncaught TypeError) or acknowledging debug commands (uncaught referenceError) on WSL

I'm trying to get started with using Truffle but I keep running into issues with the SimpleStorage contract and getting Truffle to work. I'm able to deploy the basic SimpleStorage contract and do x = ...
birdbamboo's user avatar
0 votes
1 answer
204 views

Cannot read properties of undefined (reading 'address') when trying to use 'truffle run verify'

I have successfully deployed my contracts to the goerli testnet but for some reason, I am not able to verify my contracts using "truffle-plugin-verify". I have added the following keys to ...
ohShoes's user avatar
  • 53
0 votes
0 answers
20 views

Getting this error while deploying contract on truffle

I am using command {truffle migrate --network 'Network Name'} to deploy on truffle. I don't know where this error is comming from. Someone who has worked on truffle, kindly help.
Manav Notnani's user avatar
0 votes
0 answers
19 views

Are accounts on Ganache Blockchain considered Nodes?

I wanted to ask a question: the accounts on Ganache are nodes, for example I mean, if I am in the project, I let the account send the transaction to another account This process considers that you are ...
Ghada AbdulWahab's user avatar
1 vote
1 answer
245 views

"Migrations" hit an invalid opcode while deploying [duplicate]

I do not understand why this is happening, I have tried many solutions, but still without effect. Updating the truffle version did not help. truffle migrate --reset 1_initial_migration.js =============...
Vi S's user avatar
  • 11
0 votes
0 answers
11 views

Compiling Vyper files results in a 'path exists outside base folder' error

I was working with the truffle VyperStorage Example Box. When I execute truffle compile it shows me the error above. I have installed Vyper using pip.The truffle config.js file is used as default so ...
Muhammad Uzair's user avatar
0 votes
1 answer
55 views

Truffle migrate Error: PollingBlockTracker

I'm trying to deploy a contract on Avalanche Fuji testnet using Truffle. Here is my truffle config: require('dotenv').config(); const mnemonic = process.env["MNEMONIC"]; const infuraUrl = ...
code_learner93's user avatar
0 votes
0 answers
11 views

Error relating to emittery package while running truffle migrate: when I am running truffle migrate following error comes. Can anyone help me on this

const mixin = emittery_1.default.mixin.bind(emittery_1.default); ^ TypeError: Cannot read properties of undefined (reading 'bind') at Object.call (C:\Users\...
MJT's user avatar
  • 1
1 vote
0 answers
12 views

IP host management in truffle_config.js (Private Ethereum Network)

I have 3 Amazon Ec2 instances (each with a Geth node running on them) and I'm running over them my Private Geth Ethereum (PoA) blokchain and I wanted to ask if it was necessary to specify the IPs of ...
AlexCav's user avatar
  • 41
0 votes
0 answers
17 views

Truffle migrate didn't migrate contract despite calling truffle migrate --reset

Here's my 2_gimmy_migration.js const Gimmy = artifacts.require("Gimmy_NFT.sol"); module.exports = function (deployer){ deployer.deploy(Gimmy); }; I had tried truffe migrate --reset ...
YaiMiChiLaoMa's user avatar
0 votes
1 answer
47 views

Truffle test USDC transfer to contract + instantiate contracts

I'm writing my smart contract tests in JS and using Truffle. I want to test a specific function in my contract that requires a token address and contract address as parameters: address _asset, ...
Piji's user avatar
  • 1
0 votes
0 answers
4 views

the command isn't running when I run the command truffle server

truffle serve is not a valid truffle command. Please see truffle help for available commands
manish reddy's user avatar
1 vote
0 answers
109 views

How to implement a custom consensus mechanism in Ganache

As a beginner in the Ethereum world, I have developed a blockchain network in Ethereum using Truffle, Ganache and Web3.js. I can deploy smart contract to Ganache network and transactions are included ...
Tripoli's user avatar
  • 11
1 vote
0 answers
16 views

How safe is it to use Truffle and store a seed in a script? [closed]

I want to do a script to automate an action. The script would run locally on my computer, using Truffle/HD-wallet-provider. Is it safe? Having my seed in the first line of the script, or do I have to ...
Thomas Marchand's user avatar
1 vote
0 answers
36 views

How to write in etherscan.io "Info" tab with hardhat/truffle?

I would like to achieve the same result as the below images. How could I populate the "Info" tab on etherscan.io with hardhat/truffle ? Example 1: https://etherscan.io/address/...
 Hovo Pinelopi 's user avatar
1 vote
1 answer
28 views

storing and retrieving data in Solidity

in another solidity study, I want to implement a contract to store user links. users must log in using the wallet address and be able to save data by name, description, type, and the link itself. ...
Lll Cilician's user avatar
2 votes
1 answer
94 views

Security and Performance of Solidity Contract

I continue to explore solidity. I wrote a small distributor contract that collects ETH from incoming transactions, records the addresses of incoming transactions with a given condition, and ...
Lll Cilician's user avatar
1 vote
1 answer
33 views

developing a contract that distributes tokens

I am developing a contract that distributes tokens and has already implemented the main functionality. The contract accepts tokens from the owner and distributes them by 1KK to each address from the ...
Lll Cilician's user avatar
2 votes
1 answer
58 views

error when working with arrays: DeclarationError: Undeclared identifier

**I am developing a smart contract distributor in the solidity language that will accept BEP20 tokens from the owner with the special contract address: 0x0000000000000000000000000000. the owner of the ...
Lll Cilician's user avatar
1 vote
1 answer
18 views

Error in truffle initial migration file

I'm learning solidity with the book "Master etherum". I'm trying to use following program in truffle. https://github.com/ethereumbook/ethereumbook/blob/develop/code/Solidity/Faucet4.sol // ...
YaiMiChiLaoMa's user avatar
1 vote
2 answers
2k views

Where can Developers get Sepolia Testnet ETH? [duplicate]

Where can web3 developers get free Sepolia Testnet ETH to use in their development process?
anataliocs's user avatar
1 vote
1 answer
716 views

Unhandled Exception: Connection refused - Truffle Ganache Connection with Flutter

I am getting this error when trying to link a smart contract deployed on a Ganache local blockchain with Flutter web3dart package. Note: Testing on android (both emulator and physical device give the ...
Tomas Ward's user avatar
1 vote
0 answers
68 views

How to pass web3 client from server to client in next.js?

I spent all day (meh, not a record (but I'm not finished yet lol)) trying to pass the web3 instance to the client side of my app. Why would I use it on the server side? Well, to keep my wallet ...
Eugene1111's user avatar
1 vote
0 answers
13 views

Trying to run a javascript test through Truffle. Truffle is not able to read the javascript file or I cannot understand the issue here

I am trying to run truffle test to test a javascript file on windows through powershell. The results keep showing a syntax error on the first character of the .js test file after compiling all ...
GimmeGinNtonic's user avatar
1 vote
1 answer
29 views

Error: Provided address "undefined" is invalid, the capitalization checksum test failed,

I have the following script: var assert = require('assert'); const path = require("path"); const fs = require("fs"); module.exports = async function(callback) { try{ ...
zak100's user avatar
  • 1,406
1 vote
1 answer
45 views

Reentrancy attack: Safe Remote Purchase

Hello everyone i am new to solidity coding, and i want to improve my security skill regarding smart contracts and evm. In order to accomplish this goal i tried a reentrancy attack on a simple contract....
ArtBalar's user avatar
2 votes
0 answers
50 views

Truffle hit a require or revert statement in simple ERC777 constructor

I have incredibly simple code, taking straight from openzeppelin's ERC777 contract. When I run truffle migrate, however, I receive Replacing 'Implementation' -------------------------- *** ...
chriscrutt's user avatar
0 votes
1 answer
36 views

Why am I getting `undefined` when trying to access array elements in Truffle Console?

I am getting an array from my contract, which seems to have the correct number of elements. However, when trying to access the first element using index notation, I am getting undefined: myArray = ...
pooya13's user avatar
  • 103
1 vote
2 answers
25 views

Blockchain with Vscode

TextFieldValue(text='I switch my career from Laravel dev to Blockchain, I want to know how to setup blockchain environment on your visual studio code. What do i need to install and start over? I was ...
Nnadi .C Charles's user avatar
2 votes
1 answer
29 views

Two identical functions inside a truffle migration

The contract VestingWallet.sol from OpenZeppelin have two functions with the same name "vestedAmount", but different parameters to call a particular function. The first one: function ...
titoi's user avatar
  • 31
0 votes
0 answers
23 views

How to transfer money inside truffle console?

When I log in to the truffle console I see there are a bunch of addresses filled with money. I need to transfer an amount to the account that I am using with Metamask. (I don't want to import the ...
Mirat Can Bayrak's user avatar
1 vote
1 answer
17 views

Adding chain to gnosis UI

I just followed steps to add new chain using this repo: https://github.com/safe-global/safe-infrastructure But when I click on Nothing happens. In order to bring up this safe-infrastructure and ...
Juliano Souza's user avatar
0 votes
3 answers
179 views

SQL Querying ability using Blockchain

I am working on an application that can handle SQL queries for data stored in Blockchain. Currently I am using Smart Contract for achieving this as this allows me to store the data in a well ...
Suvam Tamang's user avatar

1
2 3 4 5
59