Open holic opened 2 months ago
We could potentially add this to the factory, like
address expectedWorldAddress = Create2.computeAddress(...);
if (expectedWorldAddress.code.length > 0) {
revert WorldExists(expectedWorldAddress);
}
but could do something similar in the deployer just before deploying to avoid modifying audited code
If I deploy a world with
mud dev-contracts
to a long-running anvil instance, then restart and deploy again, it'll reuse the salt and thus get the same world address. However, the second world deploy will fail.It should either detect this and pick a new salt or reuse the already-deployed world.
We should also see if we can improve the error message from these instances, because it's really unclear