To reinitialize discovery to get the EnigmaSimulation.sol
The location of the file ‘millionaires_problem.txt’ which contains the contact address needs to be changes in deployment and the test scripts.
For step 1: Checked whether the `EnigmaSimulation.json’ is in build/enigma_contracts and it is so this would probably confirm that the EnigmaSimulation.sol is compiled.
For step 2: Don’t know where to find the file ‘millionaires_problem.txt’ and what needs to be changed.
Can someone help out with step 2? Perhaps explain what is going on.
Much appreciated!!
PS: I thought it to be useful to create a separate thread for this error even thought it has already been mentioned. If there is a more effective way of documenting or a standard I can follow please do advice me on this.
Hi Franklin, that file should be in the same directory as your test file, because that’s where the secret contract’s address is read from.
The address is set/updated anytime you migrate, the file will be created if it doesn’t exist, the deploy script does this.
It does depend on where you ran the migrate from, though Laura recently fixed this to be relative in this commit
Sure you ran migrate successfully? Perhaps migration was successful but you had file permissions or something preventing the file from being created, please check the output for errors.
You’ll have to fix the compile error before migrating.
Can you try this with a fresh ‘discovery init -> compile -> migrate’ and confirm the file is there?
Sorry, just to be sure, do you mean the millionaires_problem.txt file? In that case I still have not found it.
I removed everything including the dependencies and started clean. Followed the steps on the medium post and the installation steps described op de git repo. Sadly still the same error when I execute the migrate command.
No there’ll be a simple_addition.txt file after migrating a new project.
So if that works your env is ok, it deploys and you can write files to your OS etc
There’s apparently an error in your contract preventing compilation, so you can’t migrate after making your changes.
The error message specified “only valid in async function at Object.run”, so I pasted the code snippet that was offered by the “an-intro-to-secret-contracts” tutorial inside the brackets of the only async function in the “2_deploy_contracts.js” file instead of at the end of the file as suggested by the tutorial.