Closed rstormsf closed 5 years ago
Hey @rstormsf ! As an aside, you probably want to change unlinked_binary
to bytecode
in 2_deploy.js
. Looks like it's been deprecated in the contract json spec.
Ugh unlinked_binary
is a mess. It should be working, though. Maybe something is up with the deprecation mechanisms in contract-schema.
@rstormsf , looked into your issue a bit. it looks like the way migrations are currently rigged, the resolver expects to be passed artifacts (via artifact.require
's) before the deployer module.exports. I'm not familiar with circom
, but you might be able to hook it up to truffle as an external compiler rather than running a script in-between normal compilation and testing (npx truffle compile && node makeMiMC.js && npx truffle test...
)
@CruzMolina I wish it could be possible: https://github.com/iden3/circomlib/blob/master/src/mimc_gencontract.js take a look at it ;-)
Hey @rstormsf are you still having trouble with this? It looks like Artifactor is working as expected, and you'd need to set up a separate script as @CruzMolina mentioned before you can migrate this way. We're going to go ahead and close this issue. Please bring this up in the Truffle Spectrum if you'd like to discuss it further!
I encountered this problem too.
Running the code which uses truffle-artifactor
into a separate stage between truffle compile
and truffle test
seems to have avoided the problem of having to run truffle test
multiple times.
However, I still run into the blank 'Error: Error: Error' message whenever I try and use any of those contracts, that's really frustrating because getting any meaningful stack trace or debug information from Truffle seems to be harder than extracting blood from a stone.
@HarryR are you trying to do something similar as rstormf?
If you're trying to migrate than I believe you will have to "make" the contract artifact and import into the migrations scripts.
I'm doing something very similar to @rstormsf - generating EVM bytecode with a different method, then using it linked from Solidity code.
The fix described above has fixed half the problem - I have a separate script 'generate-artifacts.js' which is run in between compile
and test
, then i can import the artifacts normally using artifact.require(...)
so truffle-artifactor
isn't used at any point in the migration .js scripts.
However, whenever I include the library Name { ... }
code in a Solidity I get the blank Error: Error: Error
message, before it's even run any of the migrations code. That seems unrelated to the bug described in this ticket (or.. maybe it is tangentially related?)
I can deploy the contract, run it via JS tests etc. But whenever I try to use it from Solidity code (either directly in contracts, or via tests) truffle will error out with the blank message before running migrations.
I'll open a ticket if I can't find a workaround.
@HarryR can you provide a reproduction repo for your Library
error?
Thinking about this some more, there might be a way to use the external compiler feature to get the circom
compiler lib to work. Are you using this lib?
Hi.
I'm not using circom
.
My problem has nothing to do with artifactor.
I am working around it in a different way.
Issue
Steps to Reproduce
Create migration script in special way: https://github.com/peppersec/truffle_bug/blob/master/migrations/2_deploy.js#L14
Expected Behavior
should be working
Actual Results
Errors out on the first run
Environment
truffle version
): 5.0.26node --version
): 10Please check out the full repo https://github.com/peppersec/truffle_bug