/r/Truffle

Photograph via snooOG

This is the subreddit for blockchain devs who like to use Truffle, a blockchain development suite, getting you from idea to dapp as quickly as possible!

/r/Truffle

378 Subscribers

1

The State of Blockchain Development

Let's talk about blockchain: while NFTs occupy a peripheral role, cryptocurrencies established a potent presence with 27% of developers actively engaged. Looking at things on the regional scale, we can see that North America and East Asia emerge as vibrant hubs, yet the Middle East & Africa is drawing attention, particularly in the realm of finance and banking.

Experience emerges as a crucial factor, with developers with 6-10 years of expertise taking the lead. Seasoned professionals with 11-15 years show a thoughtful interest, ready to make the most of their vast experience. In addition, Ethereum stands as the undisputed titan in the blockchain domain, maintaining a robust balance between learners and active developers. Get ready for Binance Smart Chain and IBM Blockchain to step up as notable contenders.

If you'd like to add your contribution to this space, explore our latest survey on emerging technologies. The survey aims to get insights and perspectives from developers, to better understand decentralised tech and emerging technologies and their impact on the development industry. To show appreciation for your time, we've also prepared some cool prizes, like Ledger Nano S Plus & case, 2x Raspberry Pi 5, 5x YubiKeys Hardware 2fa keys and more.

👉 Take the survey now

0 Comments
2023/11/22
16:42 UTC

1

Why can't my Mac m1 find truffle

It's always zsh truffle not found. I think it is lighter than using hardhat.

0 Comments
2023/11/13
13:31 UTC

1

Truffle Teams 2.0

Hi everyone,

Does anyone wish Truffle Teams was still around? My team and I really saw the potential and are developing a solution inspired by it. Essentially a single platform/solution for teams working on Web3 projects to quickly test, compile, debug, and manage their deployments all in place.

Happy to share beta access and get feedback with anyone who is interested!

3 Comments
2023/09/24
21:51 UTC

1

🍫🌇🫡

1 Comment
2023/08/19
03:39 UTC

1

Why selfdestruct not executing: balance of SSUE2 not zero

Hi,

I have two Smart contracts (SCs):

pragma solidity ^0.5.16;
contract SSUE2 {
    address public owner;
    bool public paused;
    constructor() public {
        owner = msg.sender;
    }
    function setPaused(bool _paused) public {
        paused = _paused;
    }
    function destroySmartContract(address payable _to) public payable{
        selfdestruct(_to);
    }
   function() external payable{}
}

and

// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
import './SSUE2.sol';
contract SSUE2Tester {
    SSUE2 public sa;
    address payable public owner;
    bool public paused;
    constructor() public {
        owner = msg.sender;
    }
    function tester() public {    
        sa = new SSUE2();
        paused = false;
        sa.setPaused(paused);
        sa.destroySmartContract(owner);
    }
    function() external payable{}
}

Initially, SSUE2’s balance is 11 due to transfer from transfer from truffle accounts[2]. I am executing SSUE2’s destroySmartContract(..) method by calling it from SSUE2Tester. But the selfdestruct is not executing hence SSUE2’s balance remains the same i.e. 11 not zero.

The script is given below:

const path = require("path");
const fs = require("fs");
module.exports = async function(callback)  
{
    try {
        let argStrWithComma= null
        let transferFuncName = null
        let funcStr = "function mint() public {"
        let argStrN = null
        let result2 = ""
        console.log("Before object creation")
        const vic= artifacts.require("SSUE2");
        const att= artifacts.require("SSUE2Tester");
        const vicobj = await vic.new();
        const attobj = await tes.new();
        const accounts = await web3.eth.getAccounts();
        console.log("After object creation")
        let acc2 = accounts[2]
        acc2bal = await web3.eth.getBalance(acc2)
        web3.utils.fromWei(acc2bal, "ether")
        console.log(`acc2 balance is ${acc2bal}`)
        amount = '11'
        result1 = await web3.eth.sendTransaction({to:vicobj.address, from:acc2, value: web3.utils.toWei(amount)})
        console.log("receipt Ok  : ", result1)
        console.log("sender  ok : ", result1.from)
        console.log("receiver ok: ", result1.to)
        console.log("After Ether transfer")
        vicbal = await web3.eth.getBalance(vicobj.address)
        web3.utils.fromWei(vicbal, "ether")
        console.log(`1Deposited ${amount} Ether from acc2:${acc2}, to victim:`, vicobj.address,` balance is ${vicbal}`)
console.log(`Before Executing destroySmartContract() by victim:`, vicobj.address,` balance is ${vicbal}`)
        transferFuncName= "tester"
        result2 = await attobj[transferFuncName]({from:accounts[3]})
        vicbal = await web3.eth.getBalance(vicobj.address)
        web3.utils.fromWei(vicbal, "ether")
        vicbal = await web3.eth.getBalance(vicobj.address)
        web3.utils.fromWei(vicbal, "ether")
        console.log(`After Executing tester method by victim:`, vicobj.address,` balance is ${vicbal}`)
  catch(error){
        console.log(error)
  }
  callback();
}

The output is:

The output is:

$ truffle exec FuncNE3_si_tes2.js

Using network 'development'.
Before object creation
After object creation
acc2 balance is 77999158400000000000
receipt Ok  :  { transactionHash:
  '0x77af56d4910974f01fa6111e1370c234be35cd50d7ed64009bed1ed88de788d2',
 transactionIndex: 0,
 blockHash:
  '0x91d6e00159213e6ad1d9e4573cd2ae710e4d83ee1844767c99543768393c91e8',
 blockNumber: 22,
 from: '0xf14266366ce4e027cf09ae733c59365f220cb3ea',
 to: '0xee3f65c3901ad547273b839a7789568ea9a556f0',
 gasUsed: 21040,
 cumulativeGasUsed: 21040,
 contractAddress: null,
 logs: [],
 status: true,
 logsBloom:
  '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,00000000000000000000000000000000000000000000000000000' }
sender  ok :  0xf14266366ce4e027cf09ae733c59365f220cb3ea
receiver ok:  0xee3f65c3901ad547273b839a7789568ea9a556f0
After Ether transfer
1Deposited 11 Ether from acc2:0xf14266366CE4E027cF09Ae733C59365F220Cb3ea, to victim: 0xEE3f65C3901aD547273b839a7789568EA9a556f0  balance is 11000000000000000000
Before Executing destroySmartContract() by victim: 0xEE3f65C3901aD547273b839a7789568EA9a556f0  balance is 11000000000000000000
After Executing tester method by victim: 0xEE3f65C3901aD547273b839a7789568EA9a556f0  balance is 11000000000000000000

Somebody please guide me why does the balance of SSUE2 i.e. victim, is not Zero but still 11??

Zulfi.

0 Comments
2023/05/18
00:58 UTC

1

Truffle Debugging Tutorial: Can't understand the code

Hi,

I am trying to understand the Debugging tutorial at:

https://trufflesuite.com/guides/debugging-an-example-smart-contract/

The smart contract (SC) for the tutorial is:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract SimpleStorage {
 uint myVariable;
 function set(uint x) public {
   myVariable = x;
 }
 function get()  public view returns (uint) {
   return myVariable;
 }
}

I can’t understand the following code because I did not interact with this language before. Somebody, please guide me about the following code:

1.SimpleStorage.deployed()
2..then(function (instance) {
3.return instance.get.call();
4.})
5..then(function (value) {
6.return value.toNumber();
7.});

I have the following questions:

1)what is the language of the code?

2)Why the line2 of the code uses the command ‘get.call()’?

3)what is the difference between ‘function (instance), and ‘function (value)’?

4)what is the data type of value?

Somebody, please guide me.

Zulfi.

1 Comment
2023/05/10
03:53 UTC

2

Truffle Develop: Can't paste the whole command on truffle 'develop' prompt

Hi,

I am following the tutorial at:

https://trufflesuite.com/guides/debugging-an-example-smart-contract/

But when I try to execute the command:

SimpleStorage.deployed()
.then(function (instance) {
return instance.get.call();
})
.then(function (value) {
return value.toNumber();
});

I can’t pastethe whole command on the prompt, I got the following:

truffle(develop)> SimpleStorage.deployed()
 .then(function (instance) {
Invalid REPL keyword
truffle(develop)>     return instance.get.call();
Thrown:
evalmachine.<anonymous>:0
return instance.get.call();
^^^^^^

Somebody please guide me how to solvethis problem.

Zulfi.

1 Comment
2023/05/05
05:00 UTC

1

Smart contract upgrades: should we and how?

0 Comments
2022/08/19
00:29 UTC

2

Build a NFT Marketplace on Ethereum and Optimism

HIHIHIHI

I'll be livestreaming a tutorial on building an NFT Marketplace
Would love to see some registrations :)
https://www.crowdcast.io/e/truffle-nft-marketplace-workshop

0 Comments
2022/05/26
20:30 UTC

3

Build, debug, and deploy your smart contracts in VS Code

Hey Trufflers!!
We're excited to announce the release of the Truffle for VS Code Extension. Microsoft VS Code users can now build, debug and deploy smart contracts on the Ethereum blockchain using the Truffle Suite of Web3 dev tools.

https://trufflesuite.com/blog/build-on-web3-with-truffle-vs-code-extension/?utm_source=reddit&utm_medium=devcommunity&utm_campaign=2022_May_truffle-vscode-ext-blog_announcement_content

0 Comments
2022/05/26
20:28 UTC

4

Problem with 'truffle test'

Hello,

I am a newbie. I was following the tutorial ( Truffle Suite - Truffle Suite ). After running 'truffle test', there are characters raining down like the following video.

https://reddit.com/link/rzv2m3/video/poupd8ewsoa81/player

I found out a kind of warning "LIBERTY LIBERTY LIBERTY" before the characters raining as following snapshot.

https://preview.redd.it/q70lk747toa81.jpg?width=2048&format=pjpg&auto=webp&s=3c47c264c413a43d6265b507799f5affdf99e879

Would it be possible for someone to guild me through this learning curve?

Thank you very much.

8 Comments
2022/01/09
16:17 UTC

1

Error: Cannot find module 'truffle-assertions'

Can someone help me with this error? I have been stuck on this for the past few days. I have tried all kinds of possible solutions and nothing seems to work.

1 Comment
2021/12/26
18:19 UTC

1

Could not find artifacts from any sources

When running the truffle test I got this error. I am having a hard time getting the tests to run.

0 Comments
2021/12/21
18:37 UTC

3

Truffle testing

I am having trouble with truffle testing. I cannot figure out how to get the test to run properly. I keep getting everything is up to date nothing to compile 0 passing. It seems as if it is not reading any of my tests at all.

10 Comments
2021/12/20
21:16 UTC

1

Truffle Video Tutorial Series for Beginners

Build a Truffle 2021 Blockchain Project for a Blockchain Dapp

Learn to start your first Truffle project! With Truffle, you can program a blockchain decentralized web app with Solidity smart contracts. Start the first step with this tutorial!

● Truffle version: 5.4.11

Build an NFT | OpenZeppelin ERC721 Contract Tutorial

Learn how to import a token template for a Non-Fungible Token into your smart contract blockchain project. Use OpenZeppelin, the most popular library for secure blockchain applications! In this project, we use Truffle 2021 and Solidity to build a decentralized web app (dapp).

Build a Custom NFT Smart Contract | OpenZeppelin ERC721 Tutorial

Learn how to use a token template to customize your own NFT! Build a Non-Fungible Token in your smart contract blockchain project. Use OpenZeppelin, the most popular library for secure blockchain applications! In this project, we use Truffle 2021 and Solidity to build a decentralized web app (dapp).

Source code: https://github.com/mammothtraining/Build-a-Custom-NFT-Smart-Contract-OpenZeppelin-ERC721-Tutorial

Deploy Solidity Smart Contracts with Ganache Personal Blockchain

Learn how to deploy and test your Solidity smart contracts on a personal Ethereum blockchain with Ganache 2021. Perfect for decentralized app (dapp) programming!

Leave a suggestion or ask a question in the comments below.

0 Comments
2021/12/20
18:45 UTC

2

Again, earlier lacks solution (Error: Returned error: VM Exception while processing transaction: revert, using different SC)

Hi,

I posted a similar problem at: No solution with similar previous problem

Following are my contracts:

pragma solidity 0.5.16;

contract F1{ address public owner; uint public bal= 1 ether; constructor() public { owner = msg.sender; } function() external payable { bal = bal + msg.value; } }

==

Truffle test

pragma solidity ^0.5.16;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/Funding.sol";
contract TestFunding {
 // Truffle will send the TestContract one Ether after deploying the contract.
 uint public initialBalance = 1 ether;
 function testInitialBalanceUsingDeployedContract() public {
   Funding funding = Funding(DeployedAddresses.Funding());
   // perform an action which sends value to myContract, then assert.
   address(funding).transfer(10);
   Assert.equal(funding.bal(), 0, "Ether transferred");
   //Assert.equal(funding.bal, 0,"Ether  transferred");
   //Assert.equal(funding.bal(), 11,"Ether not transferred");
 }
 function () external payable {
   // This will NOT be executed when Ether is sent. \o/
 }
}
//import "truffle/DeployedAddresses.sol";

//import "truffle/DeployedAddresses.sol";

and my 2_deploy.contracts.js

const F1 = artifacts.require("F1");
module.exports = function(deployer) {

deployer.deploy(F1); };

I am getting following error during truffle test:

$ truffle test

Using network 'development'. Compiling your contracts...

fwCompiling ./contracts/F1.sol Compiling ./test/TestF1.sol Artifacts written to /tmp/test--13270-blknLiBqwAGU Compiled successfully using:

  • solc: 0.5.16+commit.9c3226ce.Emscripten.clang TestF1
  1. testInitialBalanceUsingDeployedContract

No events were emitted 0 passing (6s) 1 failing 1) TestF1 testInitialBalanceUsingDeployedContract: Error: Returned error: VM Exception while processing transaction: revert at Context.TestCase (/truffle/build/webpack:/packages/core/lib/testing/SolidityTest.js:92:1) at process._tickCallback (internal/process/next_tick.js:68:7) u/lc2530hz:~/Truffle_programs/TransferEther2$ truffle version Truffle v5.1.67 (core: 5.1.67) Solidity v0.5.16 (solc-js) Node v10.23.3 Web3.js v1.2.9 u/lc2530hz:~/Truffle_programs/TransferEther2$

Zulfi.

(coins for few unique solution providers)

0 Comments
2021/12/17
15:59 UTC

1

TypeError:Exactly one argument expected for explicit type conversion: Should I use 'new' keyword or not?

I have got following contracts: Sender:

pragma solidity ^0.5.8;
contract sender{
   address owner;
   constructor () public{
   owner = msg.sender;
}
function transferTo(address to, uint amount) public{
   (bool success,) = to.call.value(amount)("");
   require (success);
}
function() external payable{}
}

and the receiver:

pragma solidity ^0.5.8;
contract receiver{
   address public owner;
   mapping(address => uint) public balance; 
constructor () public{
   owner = msg.sender;
}
function() external payable{
   balance[owner] += msg.value;}
}

and the tester:

pragma solidity ^0.5.8;
import "truffle/Assert.sol";
import "../contracts/sender.sol";
import "../contracts/receiver.sol";
contract TestTransfer{
function testTransfer() public{
   sender senderObj = sender();
   receiver receiverObj =  receiver();
//senderObj.transferTo(0x00428136F8db6ceB3aB5d084C67A32Cd77857FA2, 10);
//senderObj.transferTo(address(receiver), 10);
   senderObj.transferTo(address(receiverObj), 10);
   Assert.equal(receiverObj.balance(receiverObj.owner()), 10, "Received amount is not correct");
}
}

When I am executing 'truffle test' without using 'new' keyword with following object creation statements:

sender senderObj = sender();
receiver receiverObj =  receiver();

I am getting the error:

/test/testingTransfer.sol:9:26: TypeError: Exactly one argument expected for explicit type conversion. sender senderObj = sender(); ^------^ /test/testingTransfer.sol:10:31: TypeError: Exactly one argument expected for explicit type conversion. receiver receiverObj = receiver(); ^--------^

Please guide me should I use 'new' keyword with object creation statements or not?

Zulfi.

0 Comments
2021/12/15
03:01 UTC

2

truffle

Hi,

I am using Truffle test to test the transfer of Ether. Following is my sender:

pragma solidity ^0.5.8;
contract sender{
  address owner;
constructor () public{
  owner = msg.sender;
}
function transferTo(address to, uint amount) public{
  (bool success,) = to.call.value(amount)("");
  require (success);
}
function() external payable{}
}

Following is my receiver:

pragma solidity ^0.5.8;
contract receiver{
  address public owner;
  mapping(address => uint) public balance;  
constructor () public{
  owner = msg.sender;
}
function() external payable{
  balance[owner] += msg.value;}
}

Following is my tester:

pragma solidity ^0.5.8;
import "truffle/Assert.sol";
import "../contracts/sender.sol";
import "../contracts/receiver.sol";
contract TestTransfer{
  function testTransfer() public{
     sender senderObj = new sender();
     receiver receiverObj = new receiver();
     senderObj.transferTo(msg.sender, 10);
     Assert.equal(receiverObj.balance(receiverObj.owner()), 10, "Received amount is not correct");
  }
}

Output says that my test fails and displays an error message.

The output and the error message is given below:

TestTransfer
   1) testTransfer
   > No events were emitted
 0 passing (5s)
 1 failing
 1) TestTransfer
      testTransfer:
    Error: Returned error: VM Exception while processing transaction: revert
     at Context.TestCase (/home/zulfi/.nvm/versions/node/v10.23.3/lib/node_modules/truffle/build/webpack:/packages/core/lib/testing/SolidityTest.js:92:1)
     at process._tickCallback (internal/process/next_tick.js:68:7)

Zulfi.

(Solve the above problem and get coins)

10 Comments
2021/12/13
17:29 UTC

1

How to transfer Ether from SendToFallback SC to Fallback SC?

Hi,

I have two contracts:

pragma solidity ^0.5.8;
contract Fallback {
   event Log(uint gas);
   // Fallback function must be declared as external.
   function() external payable {
       // send / transfer (forwards 2300 gas to this fallback function)
       // call (forwards all of the gas)
       emit Log(gasleft());
   }
   // Helper function to check the balance of this contract
   function getBalance() public view returns (uint) {
       return address(this).balance;
   }
}

==

pragma solidity ^0.5.8;
contract SendToFallback {
   function transferToFallback(address payable _to) public payable {
       _to.transfer(msg.value);
   }
   function callFallback(address payable _to) public payable {
       //(bool success,) = bank.call.value(msg.value)(payload);  
       //(bool success,) = bank.call{value: msg.value}(payload);
       //require(success, "Ether transfer failed.");
       (bool sent, ) = _to.call.value(msg.value)("");
       require(sent, "Failed to send Ether");
   }
  function() external payable{
   }
}

Problem:

I am sending Ether from SendtFallback smart contract (SC)to Fallback SC but Fallback balance is zero and SendToFallback balance does not change. I think the problem is with the signature of transferToFallback function of SendToFallback SC. It does not accept any argument for sending Ether. Please guide me how to send Ether from SendToFallback Smart Contract to Fallback.

My Work:

I have used truffle console for sending Ether. I am using the following command:

)> senderSTB.transferToFallback(receiverFB.address, {from:accounts[0]})
The stateent executed below:
{ tx:
  '0x288ff695c288fe58f1a907eb95ee63c403017d73d7c202bf4d76b71a2dc4e51b',
 receipt:
  { transactionHash:

but there was no change in the balance of both the SC.

The complete steps are:

truffle(development)> acc1 = accounts[1]
'0xC77Bb2443c89B34daa0CCBd60E33c0C9C9C79f2a'
truffle(development)> const senderSTB = await SendToFallback.new()
undefined
truffle(development)> const receiverFB = await Fallback.new();
undefined
truffle(development)> balance1 = await web3.eth.getBalance(acc1)
undefined
truffle(development)> web3.utils.fromWei(balance1, "ether")
'100'
truffle(development)> FBbal = await web3.eth.getBalance(receiverFB .address)
undefined
truffle(development)> web3.utils.fromWei(FBbal, "eth6er")
'0'
truffle(development)> STBbal = await web3.eth.getBalance( senderSTB .address)
undefined
truffle(development)> web3.utils.fromWei(STBbal, "ether")
'0'
truffle(development)> web3.eth.sendTransaction({to:senderSTB.address, from:acc1, value: web3.utils.toWei('11')})
{ transactionHash:
  '0x7ddb83347e0b5d5b8b97c08fb77fdcd12b8b2a7cad2648c02477a9f93cb88efc',
 transactionIndex: 0,
 blockHash:
truffle(development)> STBbal = await web3.eth.getBalance( senderSTB .address)
undefined
truffle(development)> web3.utils.fromWei(STBbal, "ether")
'11'
truffle(development)> senderSTB.transferToFallback(receiverFB.address, {from:accounts[0]})
{ tx:
  '0x288ff695c288fe58f1a907eb95ee63c403017d73d7c202bf4d76b71a2dc4e51b',
truffle(development)> STBbal = await web3.eth.getBalance( senderSTB .address)
undefined
truffle(development)> web3.utils.fromWei(STBbal, "ether")
'11'
truffle(development)>  

The transfer statement executed but the balance is still 11 Ether. This means that Ether did not transfer. Please guide me how to transfer Ether from SendToFallback to Fallback smart contract using truffle console.

The migration file i.e. 2_deploy_contracts.js is:

const FB = artifacts.require("Fallback");
const STFB = artifacts.require("SendToFallback");
module.exports = function(deployer) {
deployer.deploy(FB);
deployer.deploy(STFB);
};

Zulfi.

0 Comments
2021/12/10
17:33 UTC

1

Issue with web3.eth.sendTransaction

I'm just trying to send ETH from one account to another with the truffle console but it's not sending. This is what I'm doing in terminal, but it's not sending

truffle console

truffle(ganache)> web3.eth.getAccounts()

[

'0xEc9D7560Ee7abBe559C7BA1E7a7E83548d21195a',

'0x575B318c5fb8042a67B5684992D47314E219Dc3B',

'0xE20F038645A1FE7B4172487b0a7e8Fa5B6d872Dd',

'0x98608Ed503F2B55953D2109ecACF24244a22E30d',

'0x3f09649C736AFC84a1ee3461C776957208C19670',

'0xa42aa3a992b1f79d0117fFc4F7F27cF4749db7a0',

'0x7Aa3e2829E12446714164f49813CC60170697D0D',

'0xde7a890D79F66332dC1Df69f5F19FF234885fFF5',

'0x5ce2A50cabA6862F37c084FE7f917A4C3674a936',

'0xeB5c6Cafd53C2C4ff704F9CDaCCb3442b6A5Bbd5'

]

truffle(ganache)> web3.eth.sendTransaction({from: '0xEc9D7560Ee7abBe559C7BA1E7a7E83548d21195a', to: '0x575B318c5fb8042a67B5684992D47314E219Dc3B', value: 1000000})

{

transactionHash: '0xa7c93e92a6305f749af2c5c6267caccbe6e1008950da4bad1fa704959fe1d417',

transactionIndex: 0,

blockHash: '0x0c83e9c292ad7a3e4a1194d319aceba2a3ca70f700e01e12b06020b117c6ed89',

blockNumber: 1,

from: '0xec9d7560ee7abbe559c7ba1e7a7e83548d21195a',

to: '0x575b318c5fb8042a67b5684992d47314e219dc3b',

gasUsed: 21000,

cumulativeGasUsed: 21000,

contractAddress: null,

logs: [],

status: true,

logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'

}

truffle(ganache)>

0 Comments
2021/12/02
00:40 UTC

2

I've been trying to install Truffle on macOS Monterey for a couple days now. I'm giving up and will try Hardhat tomorrow.

Seems to be incompatible.

5 Comments
2021/11/17
21:41 UTC

1

can't install ganashe through npm

I get this in my terminal and I'm actually stuck on what to do..PLEASE HELP!

npm install
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'ganache@2.5.4',
npm WARN EBADENGINE   required: { node: '12.13.1' },
npm WARN EBADENGINE   current: { node: 'v16.11.1', npm: '8.1.3' }
npm WARN EBADENGINE }
npm WARN deprecated safe-event-emitter@1.0.1: Renamed to @metamask/safe-event-emitter
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated request-promise-native@1.0.8: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated @web3-js/scrypt-shim@0.1.0: This package is deprecated, for a pure JS implementation please use scrypt-js
npm WARN deprecated eth-sig-util@1.4.2: Deprecated in favor of '@metamask/eth-sig-util'
npm WARN deprecated ethereumjs-account@3.0.0: Please use Util.Account class found on package ethereumjs-util@^7.0.6 https://github.com/ethereumjs/ethereumjs-util/releases/tag/v7.0.6
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated eth-sig-util@2.3.0: Deprecated in favor of '@metamask/eth-sig-util'
npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated vis-uuid@1.1.3: We don't use this library anymore so you shouldn't either. Use e.g. 'uuid' instead!
npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated uuid@2.0.1: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated babel-eslint@10.0.3: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated ethashjs@0.0.8: New package name format for new versions: @ethereumjs/ethash. Please update.
npm WARN deprecated uuid@2.0.3: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated multicodec@1.0.4: This module has been superseded by the multiformats module
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated ethereumjs-blockchain@4.0.4: New package name format for new versions: @ethereumjs/blockchain. Please update.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated multibase@0.7.0: This module has been superseded by the multiformats module
npm WARN deprecated multibase@0.6.1: This module has been superseded by the multiformats module
npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated multicodec@0.5.7: This module has been superseded by the multiformats module
npm WARN deprecated @web3-js/websocket@1.0.30: The branch for this fork was merged upstream, please update your package to websocket@1.0.31
npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update.
npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update.
npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update.
npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated svgo@0.7.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated ethereumjs-common@1.5.0: New package name format for new versions: @ethereumjs/common. Please update.
npm WARN deprecated ethereumjs-common@1.5.0: New package name format for new versions: @ethereumjs/common. Please update.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated ethereumjs-vm@4.2.0: New package name format for new versions: @ethereumjs/vm. Please update.
npm WARN deprecated cids@0.7.5: This module has been superseded by the multiformats module
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated highlight.js@9.13.1: Version no longer supported. Upgrade to @latest
npm WARN deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.11: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.11: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /home/mehdielghali/Desktop/ganache-ui/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/bin/node /home/mehdielghali/Desktop/ganache-ui/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/usr/bin/node',
npm ERR! gyp verb cli   '/home/mehdielghali/Desktop/ganache-ui/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.11.1 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "/usr/bin/python3" in the PATH
npm ERR! gyp verb `which` succeeded /usr/bin/python3 /usr/bin/python3
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack 
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Linux 5.14.16-301.fc35.x86_64
npm ERR! gyp ERR! command "/usr/bin/node" "/home/mehdielghali/Desktop/ganache-ui/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/mehdielghali/Desktop/ganache-ui/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.11.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mehdielghali/.npm/_logs/2021-11-14T02_59_08_900Z-debug.log
4 Comments
2021/11/14
03:01 UTC

1

Can't sent Eth to Smart Contract

I'm using the truffle CLI. I'm typing in:

contract = await SafetyDepositBox.deployed()

contract.sendTransaction({from: '0x52aB64a54b1810deb3ff412E6Adb921F57f75e08', value: web3.utils.toWei("1", 'ether')})

I'm getting back this: 'Error: Returned error: VM Exception while processing transaction: revert\n'

Any idea's why?

1 Comment
2021/11/07
22:28 UTC

1

rpm vulnerabilities prevent install of ganache-cli on fresh WSL ubuntu 20.04

hey yall... just trying to install ganache-cli on this Windows 10 wls ubuntu instance.

npm install -g ganache-cli runs for a bit, then comes out telling me there are 8 vulnerabilities (7 moderate, 1 high) and to run npm audit for details. npm audit tells me 0 vulnerabilities.

I was able to install the alpha version, but it would not run with my (latest) version of node! I saw a few other messages about these vulnerability warnings, and someone downgraded node to make the cli work. What gives with this? I just found out about it, and the GUI version seems very cool, but I'd definitely like to get the cli version running.

thanks! And yes my karma is probably 1. Sometimes the only answer is to reboot yourself.

1 Comment
2021/11/06
01:52 UTC

1

Ganache blockchain gas price

As usual, ganache gives 10 accounts and each account has 100 ETH.

I am still learning ethereum so i am trying to make and send transactions using ganache.

I noticed that in my transaction it doesn’t matter what value of gas price i set, the same amount is deducted regardless of the value i set in gas price/limit.

And last thing, when i went to ganache chain setting i found the gas price and limit and still even with the default value the value of the transaction and the gas price doesn’t add up to give the value of the account before the transaction is sent.

Please clarify my confusion on gas.

0 Comments
2021/10/24
15:11 UTC

2

I'm unable to deploy my contracts on Ropsten (Not using infura)

I'm trying to deploy a few contracts on the Ropsten network by connecting to my local geth instance. But every time I try to run truffle migrate --network ropsten, I get the following error:

Error: Returned error: the method net_version does not exist/is not available

I'm able to connect to my ganache instance, but not the geth instance. Although if I try to run:

geth attach http://127.0.0.1:8545

in my command prompt (running Windows), I connect perfectly.

My truffle-config.js's ropsten setup is the following:

// Within networks: {}
ropsten: {
    host: "127.0.0.1", 
    port: 8545, 
    network_id: 3, 
    gas: 5500000,
    confirmations: 2,
    timeoutBlocks: 200, 
    skipDryRun: true 
},

And when starting my geth instance in order to connect to it from the geth console or (hopefully) Truffle, I run:

geth --syncmode="light" --cache=4096 -http --http.port 8545 --http.corsdomain "*" -http.api "eth,web3,personal"

I tried searching for a solution on Reddit, DuckDuckGo and Google and most answers recommend I use --rpc, but my geth doesn't even recognize that flag, I can't find it on the documentation.

Hopefully some of you know what I'm doing wrong :( Oh and this is what I'm running on:

- Windows 10
- Truffle v5.4.11 (core: 5.4.11)
- Node v14.17.6 
- geth version: 1.10.9 - stable - eae3b194

Thanks!

1 Comment
2021/10/10
21:00 UTC

4

Looking a dev to help us create a Truffle test suite

I’m on a tiny team at KogeFarm (a yield optimizer) on Polygon and expanding.

We are a small yet scrappy team with an awesome community attempting to expand auto-compounding yield across DeFi.

We are currently looking for someone to help us build smart contract tests in Truffle. If all goes well, we may be interested in having you join the team at some point. This would be a great opportunity for someone wanting to be a part of a growing dapp with the opportunity to help out in various areas at some point.

All remote, no meetings, work when you want with ultimate flexibility. DM me if you’re interested.

1 Comment
2021/09/26
01:18 UTC

Back To Top