diff --git a/packages/foundry/script/DeployMockTokens.s.sol b/packages/foundry/script/00_DeployMockTokens.s.sol similarity index 100% rename from packages/foundry/script/DeployMockTokens.s.sol rename to packages/foundry/script/00_DeployMockTokens.s.sol diff --git a/packages/foundry/script/DeployConstantSum.s.sol b/packages/foundry/script/01_DeployConstantSum.s.sol similarity index 100% rename from packages/foundry/script/DeployConstantSum.s.sol rename to packages/foundry/script/01_DeployConstantSum.s.sol diff --git a/packages/foundry/script/DeployConstantProduct.s.sol b/packages/foundry/script/02_DeployConstantProduct.s.sol similarity index 100% rename from packages/foundry/script/DeployConstantProduct.s.sol rename to packages/foundry/script/02_DeployConstantProduct.s.sol diff --git a/packages/foundry/script/Deploy.s.sol b/packages/foundry/script/Deploy.s.sol index 1f7d1433..c66434ce 100644 --- a/packages/foundry/script/Deploy.s.sol +++ b/packages/foundry/script/Deploy.s.sol @@ -2,18 +2,18 @@ pragma solidity ^0.8.24; import { ScaffoldHelpers } from "./ScaffoldHelpers.sol"; -import { DeployMockTokens } from "./DeployMockTokens.s.sol"; -import { DeployConstantSum } from "./DeployConstantSum.s.sol"; -import { DeployConstantProduct } from "./DeployConstantProduct.s.sol"; +import { DeployMockTokens } from "./00_DeployMockTokens.s.sol"; +import { DeployConstantSum } from "./01_DeployConstantSum.s.sol"; +import { DeployConstantProduct } from "./02_DeployConstantProduct.s.sol"; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; /** * @title Deploy Script - * @notice Import all deploy scripts here so that scaffold can exportDeployments() + * @dev Import & run deploy scripts here so that contract Abis are carried to /nextjs * @dev Run this script with `yarn deploy` */ contract DeployScript is ScaffoldHelpers { - function run() external virtual { + function run() external virtual export { // Deploy mock tokens to be used for pools and hooks contracts DeployMockTokens deployMockTokens = new DeployMockTokens(); (IERC20 mockToken1, IERC20 mockToken2, IERC20 mockVeBAL) = deployMockTokens.run(); @@ -25,12 +25,10 @@ contract DeployScript is ScaffoldHelpers { // Deploy a constant product factory, a hooks contract, and a pool DeployConstantProduct deployConstantProduct = new DeployConstantProduct(); deployConstantProduct.run(mockToken1, mockToken2, mockVeBAL); + } - /** - * This function generates the file containing the contracts Abi definitions that are carried from /foundry to /nextjs. - * These definitions are used to derive the types needed in the custom scaffold-eth hooks, for example. - * This function should be called last. - */ + modifier export() { + _; exportDeployments(); } }