Questions tagged [truffle]

Development environment, testing framework and asset pipeline for Ethereum

Truffle is a development environment, testing framework and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier. With Truffle, you get:

  • Built-in smart contract compilation, linking, deployment and binary management.
  • Automated contract testing with Mocha and Chai.
  • Configurable build pipeline with support for custom build processes.
  • Scriptable deployment & migrations framework.
  • Network management for deploying to many public & private networks.
  • Interactive console for direct contract communication.
  • Instant rebuilding of assets during development.
  • External script runner that executes scripts within a Truffle environment.

Github Repository

Official Website

1088 questions
9
votes
1 answer

Why am I getting exceeds gas limit error when I specify the exact gas limit?

I am deploying a contract using truffle, and when I specify the gas limit as the gas I want to use for the transaction I always get the exceeds gas limit error. Why does this happen? edit What I am trying to do is deploy the crypto kitties…
yemista
  • 433
  • 5
  • 15
9
votes
2 answers

Can't send transaction even if I use an example from official Ethereum webpage

I write Crowdsale using this example. But I can't send a transaction, my test fails with an error: Contract: Crowdsale should accept payments after start: AssertionError: expected promise to be fulfilled but it was rejected with 'Error: VM…
rel1x
  • 2,351
  • 4
  • 34
  • 62
9
votes
1 answer

Proper use of artifacts.require?

I am trying to understand how artifacts.require should be used. I've seen the standard paragraph describing it as being for migrations and testing. From this I infer that the globally scoped artifacts with its method require are automatically…
Doug Kent
  • 865
  • 2
  • 9
  • 20
9
votes
5 answers

What is the pattern for handling throw on a Solidity contract in tests

I have a function on a Solidity contract that does a throw. Eg. function do(x,y) { if ( msg.sender != owner ) throw; // ... } In the Truffle environment I have a test js something like: //.... part of a promise…
Interition
  • 381
  • 2
  • 15
8
votes
1 answer

How can I configure Hardhat to work with RSK regtest blockchain?

I intend to develop my smart contracts in Hardhat, and to test them on RSK regtest local node. I was able to find a Truffle regtest configuration. development: { host: "127.0.0.1", port: 4444, network_id: "*" }, What hardhat.config.js…
Gino Osahon
  • 399
  • 1
  • 6
8
votes
5 answers

Error: EACCES: permission denied, open '/root/.config/truffle/config.json'

Can't correct the EACCESS issue from trying to install truffle. Yes I had installed initially npm via sudo and not nvm but that was corrected -unless who knows what- as per web. This path did not actually exist so I created it as per a git issue: …
DRP
  • 239
  • 4
  • 16
8
votes
2 answers

Truffle migrate Error (after run testrpc)

I can´t migrate the standart contracts that come with truffle compile. Here´s what i do: truffle init truffle compile open other terminal and run testrpc truffle migrate and the first three step is smooth operation,but when i run truffle migrate…
zengcaifei
  • 119
  • 1
  • 7
7
votes
7 answers

MetaMask - RPC Error: Cannot set properties of undefined (setting 'loadingDefaults') error

I'm building a staking function and hitting the following error after giving permission to access my token: "MetaMask - RPC Error: Cannot set properties of undefined (setting 'loadingDefaults')" Staking function Solidity contract: // Staking…
Julien
  • 73
  • 6
7
votes
2 answers

How to interpret javascript BN object?

While I was working on smart contract using truffle, whenever request some number like account balance or address from the truffle console; I receive a BN object which looks like this: BN { negative: 0, words: [ 37748736, 3305132, 2220446, <1…
jarvis1234d
  • 81
  • 1
  • 5
7
votes
1 answer

DeclarationError: Undeclared identifier - although it's present in ERC721.sol

I am writing a contract on solidity 0.8.3 and I get this strange error for _setTokenURI() although the method is defined in OpenZeppelin 4.X. pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import…
Marcel
  • 1,537
  • 5
  • 19
  • 38
7
votes
2 answers

'ENV' is not recognized as an internal or external command

So, I have been following tutorials of Eat The Blocks on ToDo List Ethereum DApp. Done till step 6, but while running the command npm run dev-front I am getting this error. > Project@1.0.0 dev-front L:\Project > ENV=development…
LinearMan
  • 89
  • 1
  • 1
  • 5
7
votes
1 answer

How to update dapp contract

How can I update the smartcontracts of my Truffle dapp which are deployed in the Ethereum blockchain?
arodriguezdonaire
  • 5,396
  • 1
  • 26
  • 50
6
votes
5 answers

Truffle contract deployment failed, invalid sender

I'm trying to deploy a contract to the ropsten testnet using truffle, but I get the following error: Deploying 'Migrations' ---------------------- Error: *** Deployment Failed *** "Migrations" -- invalid sender. at…
Robbe Louwet
  • 97
  • 2
  • 8
6
votes
0 answers

Why is it impossible to deploy a smart contract (to Mainnet) using Truffle?

Why is deploying to Mainnet using Truffle so difficult? Here is a rundown of trying to deploy to Mainnet... Current Gasprice is 110 Wei. Therefore 110000000000 wei Let's plug that in.. mainnet: { provider: () => new…
GN.
  • 8,672
  • 10
  • 61
  • 126
6
votes
2 answers

Issues with npm config & errors installing ganache-cli and truffle

I want to install ganache-cli and truffle using npm and am getting two types of errors (see codes pasted below). npm config If I run the command npm config, I get the following errors. Could that be the reason for the errors in 2.? :~ john$ npm…
Weisel2095
  • 61
  • 3
1
2
3
72 73