Commit 3a7ec22
authored
Add security txt metadata to candy machine programs (#29)
* Add security txt metadata to candy machine programs
* Align security contact metadata
* Make IDL generation work with Anchor 0.30
- Enable the `idl-build` feature on both program crates so `anchor build --idl` succeeds; propagate it from candy-guard to candy-machine-core.
- Provide a manual `IdlBuild` impl for `MintAssetArgs` since `mpl_core::types::PluginAuthorityPair` does not implement Anchor 0.30's `IdlBuild` trait.
- Pin the program IDs in each `Anchor.toml [programs.devnet]` so the IDL build no longer rewrites `declare_id!` with a generated keypair.
- Pin the IDL build toolchain to `nightly-2024-06-01` and normalize Anchor 0.30 IDL output (`defined`, `pubkey`, `writable`/`signer`/`optional`, account/type split) into the legacy shape that Kinobi 0.14 expects.
- Regenerate `idls/*.json` against this pipeline; locked dependency updates fall out of enabling `idl-build`.
* Fix Programs / Test job under Anchor 0.30 idl-build
- Reorder `candy_machine.rs` imports so `cargo fmt --check` is clean now that the file imports both `anchor_lang::prelude::*` and `anchor_lang::prelude::borsh::*`.
- Drop `--all-features` from the clippy step in `test-programs.yml` and pin it to `--features cpi`; the new `idl-build` feature can only be safely enabled from `anchor build --idl`, otherwise the `#[program]` macro panics with "Failed to get program path".
* ci(generate_clients): pre-install Anchor CLI before pnpm generate
`configs/shank.cjs` pins `RUSTUP_TOOLCHAIN=nightly-2024-06-01` so Anchor 0.30's `idl-build` can use the proc-macro span APIs it needs. On a cache-miss, `shank-js` was then trying to `cargo install --locked anchor-cli@0.30.1` under that nightly, which fails because `ahash 0.7.6` references the removed `stdsimd` rustc feature.
Install Anchor CLI in a dedicated step (using the workflow's default Rust toolchain) before invoking `pnpm generate`, so `shank-js` always finds the binary in `./.crates/bin/anchor` and never compiles it under the pinned nightly.
* Update generated clients
* Pin program IDs in Anchor.toml [programs.localnet]
`anchor build --idl` defaults to the localnet cluster, so without
`[programs.localnet]` it generates a throwaway keypair and rewrites
`declare_id!` to its address. That is what produced the bogus
`F8FnAZFh…` and `678oZidn…` IDs in `Update generated clients`.
Declare each program ID under `[programs.localnet]` so the IDL build
keeps the real on-chain addresses, restore `declare_id!`, and refresh
the IDL `address` fields to match.
* Keep security.txt PR scoped
Revert the broad Anchor 0.30 IDL/codegen repair from this PR and keep only the security.txt metadata changes.
Because security.txt metadata does not affect IDL shape, skip the Generate clients job when the PR only changes the security metadata files in this branch; program build/test coverage still runs.
* Clarify security.txt-only CI guard
Rename the metadata-only workflow flag to security_txt_only so the skip condition clearly refers to this PR's security.txt-only change set.
* Remove security.txt workflow guard
Keep this PR scoped to the program security.txt metadata and dependency changes; do not add workflow routing for the existing client-generation issue.
---------
Co-authored-by: stranzhay <stranzhay@users.noreply.github.com>1 parent 5033efd commit 3a7ec22
6 files changed
Lines changed: 31 additions & 0 deletions
File tree
- programs
- candy-guard
- program
- src
- candy-machine-core
- program
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
15 | 28 | | |
16 | 29 | | |
17 | 30 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
18 | 31 | | |
19 | 32 | | |
20 | 33 | | |
| |||
0 commit comments