Solidity version source: @custom:cdm @org/name:X.Y.Z - #83
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #76,
cdm deploypublishes the exactX.Y.Zsemver of each contract, sourced from Cargo.toml for Rust crates. Solidity contracts had no version source, so any Foundry/Hardhat deploy aborted — with an error telling the user to edit a Cargo.toml they don't have.Solidity contracts now declare their publish version as a colon suffix on the existing package-name tag — the same convention as
cdm i @org/name:1.2.1(package names can never contain:):The suffix is parsed where
@custom:cdmis read (both///line comments and/** */blocks) and threaded throughSolidityContractDefinition→ build targets →ContractInfo.version. Semver validation stays centralized inresolveContractVersion— same rules as Rust (strictX.Y.Z, not0.0.0, strictly greater than the registry's latest to publish) — but its error messages now give toolchain-appropriate advice: Cargo.toml[package].versionfor Rust, the:X.Y.Ztag suffix for Solidity.EVM backend
Solidity contracts target pallet-revive's EVM backend, not resolc/PolkaVM:
forge build(wasforge build --resolc) — the upstream solc pipeline; artifact layout (out/<Source>.sol/<Contract>.json,bytecode.object) is identical in both modes, so the scanner is unchanged.hh-sol-artifact-1(what@parity/hardhat-polkadotemits in EVM mode) alongsidehh-resolc-artifact-1; the hardhat template compiles EVM viapolkadot: { target: "evm" }.BytecodeTypewith no cross-VM check, and polkadot-sdk's own test matrix covers resolc→solc delegatecall.e2e coverage (new suite, live local PPN)
src/lib/contracts/tests/e2e/solidity.e2e.test.tsdrives the realdeployContractspipeline on a copy of the foundry-counter template and proves against a live chain:[MAGIC][key]versioned calls pin the previous EVM implementation over that shared storageFull e2e run: 5 files, 54/54 tests green (bulletin, create3, proxy, registry, solidity). Unit suite, typecheck, and format all pass with the builder changes. CI's e2e job now installs foundry-polkadot (the suite needs
forge; solc is auto-fetched). Hardhat is covered by unit tests plus a manual EVM-mode compile check (hh-sol-artifact-1, string bytecode) — no committed hardhat e2e, since it would hinge on a flaky npm install.Closes #81