Closed wyze closed 7 months ago
Hey, @wyze. You can pass a readEventArgument
future into contractAt
:
const address = module.readEventArgument(
create,
"WrappedToken",
"wrappedToken",
);
const newToken = m.contract("name", address);
return { newToken }
It will show up in the list of deployed contracts under "name"
or an id you specify (e.g. m.contract("name", address, { id: "MyToken" })
.
You can't currently pass a readEventArgument
future in as the name of a contract though.
I have a factory pattern where the
create
function supports an array of tokens to create, which in turn, emits event per token created. I am trying to read the token name and address from the event emitted and log out the address during deployment. I see the value is in the journal file but not sure how to get it to display in the terminal somewhere.Here is my module:
I am trying to read the name and address values here.
Factory contract here: