diff --git a/.changeset/many-wolves-end.md b/.changeset/many-wolves-end.md new file mode 100644 index 000000000..7bc622e8e --- /dev/null +++ b/.changeset/many-wolves-end.md @@ -0,0 +1,7 @@ +--- +'@sphinx-labs/contracts': patch +'@sphinx-labs/plugins': patch +'@sphinx-labs/core': patch +--- + +Use artifact inference in Foundry plugin diff --git a/docs/troubleshooting-guide.md b/docs/troubleshooting-guide.md index c9fd37119..849e4018b 100644 --- a/docs/troubleshooting-guide.md +++ b/docs/troubleshooting-guide.md @@ -4,38 +4,11 @@ This guide covers some common issues you might encounter using Sphinx. If your q ## Table of Contents -- [Labeling contracts](#labeling-contracts) - [Slow compilation speed](#slow-compilation-speed) - [Errors](#errors) - [`Ineffective mark-compacts near heap limit allocation failed`](#ineffective-mark-compacts-near-heap-limit-allocation-failed) - [`EvmError: MemoryLimitOOG`](#evmerror-memorylimitoog) -## Labeling contracts - -When Sphinx can't infer the contract corresponding to an address, an error will be thrown asking you to label it yourself. This makes it possible for Sphinx to verify the contract on Etherscan and create a deployment artifact for it. - -You can label a contract in your deployment script with the `sphinxLabel` function, which is inherited from `Sphinx.sol`. For example: - -```sol -MyToken token = new MyToken{ salt: bytes32(0) }(); -sphinxLabel(address(token), "src/tokens/MyToken.sol:MyToken"); -``` - -You must use the **fully qualified name** of the contract, which is in the format `full/path/to/SourceFile.sol:ContractName`, as shown in the example above. - -If you're having trouble finding the contract corresponding to an address, we recommend using `console.log`. You can import it into your script using: - -``` -import "forge-std/console.sol"; -``` - -Then, you can log the addresses of your contracts: - -``` -MyToken token = new MyToken{ salt: bytes32(0) }(); -console.log('MyToken', address(token)); -``` - ## Slow compilation speed Sphinx may slow down the compilation speed of your script because the `Sphinx.sol` contract is large. You can speed up compilation during development by disabling the Solidity compiler optimizer. One approach is to create a new profile in your `foundry.toml` file. For example: diff --git a/packages/contracts/contracts/foundry/SphinxPluginTypes.sol b/packages/contracts/contracts/foundry/SphinxPluginTypes.sol index f7853a6c7..b940e859b 100644 --- a/packages/contracts/contracts/foundry/SphinxPluginTypes.sol +++ b/packages/contracts/contracts/foundry/SphinxPluginTypes.sol @@ -86,7 +86,6 @@ struct DeploymentInfo { SphinxConfig newConfig; ExecutionMode executionMode; InitialChainState initialState; - Label[] labels; bool arbitraryChain; } @@ -124,11 +123,6 @@ struct SphinxConfig { uint256 saltNonce; } -struct Label { - address addr; - string fullyQualifiedName; -} - struct DeployOptions { bytes32 salt; string referenceName; diff --git a/packages/contracts/contracts/foundry/SphinxUtils.sol b/packages/contracts/contracts/foundry/SphinxUtils.sol index e9e710b11..d9938fd9b 100644 --- a/packages/contracts/contracts/foundry/SphinxUtils.sol +++ b/packages/contracts/contracts/foundry/SphinxUtils.sol @@ -23,7 +23,6 @@ import { InitialChainState, OptionalAddress, Wallet, - Label, ExecutionMode, SystemContractInfo } from "./SphinxPluginTypes.sol"; diff --git a/packages/core/src/config/types.ts b/packages/core/src/config/types.ts index 3e33be05f..c54566e15 100644 --- a/packages/core/src/config/types.ts +++ b/packages/core/src/config/types.ts @@ -99,7 +99,6 @@ export type DeploymentInfo = { newConfig: SphinxConfig executionMode: ExecutionMode initialState: InitialChainState - labels: Array