latticexyz / mud

MUD is a framework for building autonomous worlds
https://mud.dev
MIT License
724 stars 181 forks source link

Feedback for “Add a system” #2861

Closed ryanalbrecht closed 4 months ago

ryanalbrecht commented 4 months ago

Im still very new to this but there is a slight error in the code when using the default setup with the HelloWorld tutorial.

createSystemCall.ts should be app_decrement() instead of decrement() as the generated function name in packages\contracts\src\codegen\world\IDecrementSystem.sol is prefixed with app__

const decrement = async () => {
  const tx = await worldContract.write.app__decrement();
  await waitForTransaction(tx);
  return getComponentValue(Counter, singletonEntity);
};
qbzzt commented 4 months ago

Thank you. decrement() used to be correct, but then we changed the templates and didn't change the guide to match. I apologize. I just submitted a PR to fix this: https://github.com/latticexyz/mud/pull/2859 .

holic commented 4 months ago

fixed in https://github.com/latticexyz/mud/pull/2859