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 defined by the truffle executable tool when doing migrations or running tests. However, I am working with some code that uses artifacts.require
outside the context of any migrations or tests, rather, this code just needs to do the usual at
and new
. However, in this context, the object artifacts
is not defined.
Do I have the right picture here? Is this an appropriate use of artifacts.require
? If so, what must be done to make it be defined outside of migrations and testing?
Thanks for any suggestions!