feat(deploy): single-shot BSM deploy + Tangle blueprint registration#7
Merged
Merged
Conversation
Replaces the prior `deploy/register-blueprint.sh` that printed cast commands for the operator to paste manually. The new flow deploys InferenceBSM (impl + UUPS proxy + initialize) AND registers the blueprint on Tangle in a single broadcast via `contracts/script/RegisterBlueprint.s.sol`. Mirrors the proven pattern from ai-agent-sandbox-blueprint's RegisterBlueprint.s.sol (sandbox/instance/TEE blueprint IDs 0/1/2 already registered against Base Sepolia tnt-core). ## Changes - **`contracts/script/RegisterBlueprint.s.sol`** (new): builds the `BlueprintDefinition` matching `blueprint.json`, deploys BSM (impl + proxy + `initialize(paymentToken)`), then calls `Tangle.createBlueprint`. Reads `PRIVATE_KEY`, `TANGLE_CORE`, `PAYMENT_TOKEN` from env with Base Sepolia / anvil defaults. - **`deploy/register-blueprint.sh`**: rewritten to invoke the forge script in one broadcast, parse the proxy + blueprint ID out of console2 output, and emit the operator-registration calldata for the operator's separate `Tangle.registerOperator` call. - **`contracts/foundry.toml`**: bump tnt-core 0.10.4 → 0.13.0 (latest soldeer release matching the deployed Base Sepolia ABI; `BlueprintDefinition` gained a `metadataHash` field between 0.10 and 0.13 — selector mismatch would revert otherwise). - **`contracts/remappings.txt`**: drop stale 0.10.4 entries, point `tnt-core/` at the new 0.13.0 dep. - **`contracts/soldeer.lock`**: regenerated. ## Usage (Base Sepolia) ``` export PRIVATE_KEY=0x... export RPC_URL=https://sepolia.base.org export TANGLE_CORE=0xC9b0716a187072be0f38A5D972392C6479b9Cfe3 export PAYMENT_TOKEN=0x036CbD53842c5426634e7929541eC2318f3dCF7e ./deploy/register-blueprint.sh ``` ## What this PR does NOT do Actually run the broadcast — that creates a permanent on-chain blueprint ID that can't be reused. Land this PR for review, then operators / blueprint owners run the script once they're ready to publish. ## Verification forge build clean (asm-keccak256 lint warnings only)
drewstone
approved these changes
May 21, 2026
drewstone
left a comment
Contributor
There was a problem hiding this comment.
Auto-approved via session script.
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.
Replaces the prior
deploy/register-blueprint.sh(which only printed cast commands for the operator to paste manually) with a proper single-shot flow that deploys InferenceBSM (impl + UUPS proxy + initialize) AND registers the blueprint on Tangle in the same broadcast.Mirrors the proven pattern from
ai-agent-sandbox-blueprint'sRegisterBlueprint.s.sol(sandbox/instance/TEE blueprint IDs 0/1/2 already on-chain on Base Sepolia).What changed
contracts/script/RegisterBlueprint.s.sol(new): Foundry script that builds theBlueprintDefinitionmatchingblueprint.json, deploys InferenceBSM (impl + proxy +initialize(paymentToken)), then callsTangle.createBlueprint. Env-parameterized (PRIVATE_KEY,TANGLE_CORE,PAYMENT_TOKEN) with Base Sepolia + anvil defaults.deploy/register-blueprint.sh(rewritten): invokes the forge script in one broadcast, parses the proxy + blueprint ID out ofconsole2output, and emits the operator-registration calldata for the operator's separateTangle.registerOperatorcall.contracts/foundry.toml: bumptnt-core0.10.4 → 0.13.0 (latest soldeer release matching the deployed Base Sepolia ABI;BlueprintDefinitiongained ametadataHashfield between 0.10 and 0.13 — selector mismatch would otherwise revert against the live contract).contracts/remappings.txt: drop stale 0.10.4 entries, pointtnt-core/at the 0.13.0 dep.contracts/soldeer.lock: regenerated.Usage (Base Sepolia)
Local anvil works with no env vars (defaults to LocalTestnet snapshot addresses).
What this PR does NOT do
Actually run the broadcast — creating a blueprint produces a permanent on-chain ID. Land this PR for review, then run the script when you're ready to publish.
Test plan
forge buildclean (asm-keccak256 lint warnings only, pre-existing inInferenceBSM.sol)./deploy/register-blueprint.shagainst anvil snapshotRPC_URL=https://sepolia.base.organdTANGLE_CORE=0xC9b0716a187072be0f38A5D972392C6479b9Cfe3