Truffle command in Buidler version of Learn guide: "Deploying and Interacting with smart contracts"

:computer: Environment

Working on learning from the OpenZeppelin tutorial page:

(Solidity 0.6.2. Buidler 1.4.8. Node v15.0.1. Ubuntu 20.04.1 LTS.)


Using Buidler tutorial mode (not Truffle mode)
During final line of code to execute in the section: “Sending a Transaction”, when changing state of box to “23”, received the error copied below.

It appears to me that the tutorial suddenly switches to using “npx truffle exec” instead of “npx buidler run.” Could be misunderstanding this, but I did not succeed in returning “23” when using the command given.
I did succeed by running “npx buidler run.”

:1234: Code to reproduce

// scripts/index.js
// Send a transaction to store() a new value in the Box

// Call the retrieve() function of the deployed Box contract
const value = await box.retrieve();
console.log(“Box value is”, value.toString());

user@local:~/testdirectory$ npx truffle exec --network development ./scripts/index.js

ExtendableError: Could not find suitable configuration file.
at Function.detect (/home/user/testdirectory/node_modules/truffle/build/webpack:/packages/config/dist/index.js:148:1)
at Object.Run (…)
at (…)
at node:internal/main/run_main_module:17:47

npm err! code 1
npm err! path /home/user/testdirectory
npm err! command failed
npm err! command sh -c truffle exec --network development ./scripts/index.js

Perhaps I do not understand how to run both Truffle and Buidler in parallel?
I have been under the impression that their respective contract syntaxes hold some differences and require a little migration between.

I deeply appreciate the incredible documentation provided by the OpenZeppelin team. :pray:
I feel like I have learned the most about solidity in the least amount of time with the least trouble in the past 24 hours. Thank you all again. :pray: :blue_heart:

1 Like

Do you have a truffle-config.js file?

1 Like

Hi @Helper_Bot,

Welcome to the community :wave:

Sorry about the confusing Truffle code when it should be Buidler. It looks like I made a copy/paste error.

The command should be:

$ npx buidler run --network localhost ./scripts/index.js

I will be updating the Learn guides to use Hardhat (Buidler has been renamed and updated to Hardhat) in the next week and will fix this error then.

Please let me know if you have any feedback on the Learn guides so that we can keep improving them.

1 Like

Hi @Skyge,

I must have made a copy paste error when doing that part of the documentation.

Thanks for everything @abcoathup!
I assumed it may have been a copy/paste error but didn’t know enough yet to be certain!

So far your tutorial has been one of the most-powerful, fastest-paced, and best-functioning tutorials I’ve encountered. This is pretty much the main reason I felt the desire to point out the single error I encountered. It’s 98% perfect and I wanted to contribute some awareness to make it even more perfect.

Thank you so much again! :pray: :blue_heart:


Hi @Helper_Bot,

Thanks for the feedback. I am in the process of updating the Buidler sections to Hardhat and just fixed that copy paste error.

Feel free to ask any questions and provide any feedback.