Open holic opened 1 year ago
Following how MudTest
extends Foundry's Test
, you could have MudScript
extending Script
.
Following how
MudTest
extends Foundry'sTest
, you could haveMudScript
extendingScript
.
Definitely! And we could move away from a generic run(address)
to something like afterDeployWorld(address)
, leaving us room to add other "hooks" like afterUpgradeWorld(address)
with this structure, we'd be able to split big PostDeploy scripts into multiple files, which could help with issues we're seeing in Sky Strife where kicking off 300+ txs in a single script causes failures due to overlapping nonces
if we went this route, another thing that would be great is to be able to specify a list of "dependencies" for managing deploy order
contract UploadMaps is MudScript {
afterDeployWorld(address worldAddress) {
....
}
}
contract CreateDebugMatch is MudScript {
bytes4[] public constant dependsOn = [UploadMaps.afterDeployWorld.selector];
afterDeployWorld(address worldAddress) {
....
}
}
mostly so we have a place to set up boilerplate like setting the store address
but also could mean in the future we add support for multiple PostDeploy scripts by looking at the scripts inheritance chain and, if it inherits from our base PostDeploy, it's executed, regardless of the name (no special PostDeploy naming needed anymore)