Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c126346
feat(deploy): hydrate LibProdDeployV4 + add V4 suites to Deploy.sol
Jun 19, 2026
f6ab6b4
test(deploy): pin LibProdDeployV4 constants (mirror LibProdDeployV3 t…
thedavidmeister Jun 27, 2026
e657468
ci(manual-sol-artifacts): pass secrets explicitly to cross-org rainix…
thedavidmeister Jun 27, 2026
45c96dc
ci(deploy): deploy suites to Base only
thedavidmeister Jun 27, 2026
e6722d4
test(deploy): make LibProdDeployV3 audit-trail-only (no recompile)
thedavidmeister Jun 27, 2026
c48094d
feat(deploy): freeze LibProdDeployV2 creation bytecode + round-trip test
thedavidmeister Jun 28, 2026
5098a8c
refactor(deploy): remove phantom LibProdDeployV3, retarget references…
thedavidmeister Jun 28, 2026
7967a4b
ci: retrigger static (transient GitHub 429 on rainix nix-flake fetch)
thedavidmeister Jun 28, 2026
cfcca55
chore(deploy): set optimizer_runs=5000 to fit StoxReceiptVault under …
thedavidmeister Jun 28, 2026
307df97
chore(deps): bump rain-deploy 0.1.3 -> 0.1.4
thedavidmeister Jun 29, 2026
5462f2c
ci(slither): exclude too-many-digits detector
thedavidmeister Jun 29, 2026
e230cbf
test(deploy): assert V4 prod deployment codehashes live on Base
thedavidmeister Jun 29, 2026
7f17097
docs: address CodeRabbit review on #208 (stale version/optimizer refs)
thedavidmeister Jun 29, 2026
fe2a9f9
refactor(deploy): remove legacy pre-V4 deploy suites
thedavidmeister Jun 29, 2026
12a5041
test(deploy): cover V4 beacon-set deployer beacon wiring on Base
thedavidmeister Jun 29, 2026
0f16a6c
test(prod): refresh pinned Base fork block
thedavidmeister Jun 29, 2026
1288cc9
test(prod): re-pin Base fork block closer to head
thedavidmeister Jun 29, 2026
9b492b9
test(prod): restore original pinned Base fork block
thedavidmeister Jun 29, 2026
c6677e2
refactor(deploy): factor supported networks into LibStoxDeployNetworks
thedavidmeister Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions .github/workflows/manual-sol-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,44 @@ on:
required: true
type: choice
options:
# ===================================================================
# V4 (rain.vats 0.1.6 — audited build). Deploy these in the listed
# order; later entries reference earlier ones via dependency pointers
# so an out-of-order run trips the dep-codehash check.
# ===================================================================
# 1. Implementations (no dependencies, deploy first)
- stox-receipt
- stox-receipt-vault
- stox-wrapped-token-vault
# 2. Beacon (depends on stox-wrapped-token-vault)
- stox-wrapped-token-vault-beacon
- stox-receipt-v4
- stox-receipt-vault-v4
- stox-wrapped-token-vault-v4
# 2. Beacon (depends on stox-wrapped-token-vault-v4)
- stox-wrapped-token-vault-beacon-v4
# 3. Deployers (depend on their beacons/implementations)
- stox-wrapped-token-vault-beacon-set-deployer
- stox-offchain-asset-receipt-vault-beacon-set-deployer
# 4. Unified deployer (no on-chain dependencies)
- stox-unified-deployer
- stox-wrapped-token-vault-beacon-set-deployer-v4
- stox-offchain-asset-receipt-vault-beacon-set-deployer-v4
# 4. Unified deployer (depends on the two set-deployers above)
- stox-unified-deployer-v4
# 5. Authorizers (no on-chain dependencies)
- stox-offchain-asset-receipt-vault-authorizer-v1
- stox-offchain-asset-receipt-vault-payment-mint-authorizer-v1
- stox-offchain-asset-receipt-vault-authorizer-v1-v4
- stox-offchain-asset-receipt-vault-payment-mint-authorizer-v1-v4
# 6. Corporate-actions facet (no on-chain dependencies — the
# receipt-vault impl hardcodes its address but doesn't link to it
# at deploy time).
- stox-corporate-actions-facet-v4
jobs:
deploy:
uses: rainlanguage/rainix/.github/workflows/rainix-manual-sol-artifacts.yaml@main
with:
suite: ${{ inputs.suite }}
secrets: inherit
# The reusable workflow lives in a different org (rainlanguage), so
# `secrets: inherit` does not forward this repo's secrets to it — they must
# be passed explicitly. Only the secrets this repo actually holds are
# listed; the reusable workflow declares the full set as optional and falls
# back to `|| vars.* || ''` for any it isn't given.
secrets:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
RPC_URL_ARBITRUM_FORK: ${{ secrets.RPC_URL_ARBITRUM_FORK }}
RPC_URL_BASE_FORK: ${{ secrets.RPC_URL_BASE_FORK }}
RPC_URL_BASE_SEPOLIA_FORK: ${{ secrets.RPC_URL_BASE_SEPOLIA_FORK }}
RPC_URL_FLARE_FORK: ${{ secrets.RPC_URL_FLARE_FORK }}
RPC_URL_POLYGON_FORK: ${{ secrets.RPC_URL_POLYGON_FORK }}
CI_DEPLOY_BASE_ETHERSCAN_API_KEY: ${{ secrets.CI_DEPLOY_BASE_ETHERSCAN_API_KEY }}
49 changes: 29 additions & 20 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,15 @@ this stack.

- Solidity 0.8.25 (exact pin `=0.8.25` in contracts, `^0.8.25` in libraries)
- EVM target: Cancun
- Optimizer: 24483 runs — empirically the highest value where `StoxReceiptVault`
runtime stays under EIP-170 (24,576 bytes). The setting is a runtime-gas vs
- Optimizer: 5000 runs — `StoxReceiptVault` is the contract that binds against
EIP-170 (24,576-byte runtime limit), and 5000 keeps it under the limit while
the rest of the suite stays well clear. The setting is a runtime-gas vs
deploy-bytecode tradeoff (high values inline aggressively for fast runtime at
the cost of deployed bytecode size); we pin the highest value that keeps the
vault deployable to mainnet chains. 500-byte margin at this value — sensitive
to vault source changes and dependency-tree bytecode shifts. Re-run the binary
search if the vault size approaches the limit again. The corresponding
`foundry.toml` comment block flags this; both must stay in sync.
the cost of deployed bytecode size). The margin is thin and sensitive to vault
source changes and dependency-tree bytecode shifts — re-check
`StoxReceiptVault`'s `forge build --sizes` runtime margin on any such change.
The corresponding `foundry.toml` comment block flags this; both must stay in
sync.
- `via_ir` is OFF. IR was tried (#144) and made the vault larger for our
inheritance shape, opposite of the goal. Don't enable without a measurement
showing it now helps.
Expand Down Expand Up @@ -270,23 +271,31 @@ library. When making changes to contract source:
## Deployment

`script/Deploy.sol` dispatches based on `DEPLOYMENT_SUITE` env var. One contract
per suite to avoid Zoltu factory nonce issues:

- `stox-receipt` — deploys StoxReceipt
- `stox-receipt-vault` — deploys StoxReceiptVault
- `stox-wrapped-token-vault` — deploys StoxWrappedTokenVault
- `stox-wrapped-token-vault-beacon` — deploys StoxWrappedTokenVaultBeacon
per suite to avoid Zoltu factory nonce issues. Every suite targets the
`LibProdDeployV4` (rain.vats 0.1.6) pins and deploys to Base; the frozen pre-V4
deployments live in `LibProdDeployV1` / `LibProdDeployV2` as an audit trail and
are not redeployable from the current source.

- `stox-receipt-v4` — deploys StoxReceipt
- `stox-receipt-vault-v4` — deploys StoxReceiptVault
- `stox-wrapped-token-vault-v4` — deploys StoxWrappedTokenVault
- `stox-wrapped-token-vault-beacon-v4` — deploys StoxWrappedTokenVaultBeacon
(depends on StoxWrappedTokenVault)
- `stox-wrapped-token-vault-beacon-set-deployer` — deploys
- `stox-wrapped-token-vault-beacon-set-deployer-v4` — deploys
StoxWrappedTokenVaultBeaconSetDeployer (depends on beacon)
- `stox-offchain-asset-receipt-vault-beacon-set-deployer` — deploys
- `stox-offchain-asset-receipt-vault-beacon-set-deployer-v4` — deploys
StoxOffchainAssetReceiptVaultBeaconSetDeployer (depends on StoxReceipt,
StoxReceiptVault)
- `stox-unified-deployer` — deploys StoxUnifiedDeployer
- `stox-corporate-actions-facet` — deploys StoxCorporateActionsFacet

Manual deployment via GitHub Actions workflow (`manual-sol-artifacts.yaml`)
supports multiple networks.
- `stox-unified-deployer-v4` — deploys StoxUnifiedDeployer (depends on both
beacon-set deployers)
- `stox-offchain-asset-receipt-vault-authorizer-v1-v4` — deploys
StoxOffchainAssetReceiptVaultAuthorizerV1
- `stox-offchain-asset-receipt-vault-payment-mint-authorizer-v1-v4` — deploys
StoxOffchainAssetReceiptVaultPaymentMintAuthorizerV1
- `stox-corporate-actions-facet-v4` — deploys StoxCorporateActionsFacet

Manual deployment runs via the GitHub Actions workflow
(`manual-sol-artifacts.yaml`), which deploys to Base.

## Naming Conventions

Expand Down
20 changes: 10 additions & 10 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ libs = ['dependencies']

solc = "0.8.25"
optimizer = true
# `optimizer_runs` is a runtime-gas vs deploy-bytecode tradeoff: high values
# inline aggressively for fast runtime at the cost of deployed bytecode size.
# StoxReceiptVault is at the EIP-170 24,576-byte limit. 24483 is the highest
# value found by empirical binary search (legacy pipeline; via_ir was tried
# in #144 and made the vault larger) where StoxReceiptVault stays under
# EIP-170. 24484 trips the limit. Re-run the search if vault source changes
# or the dependency tree's bytecode shifts under us; the boundary is
# sensitive and not stable across compiler versions or refactors.
optimizer_runs = 24483
# `optimizer_runs` is a runtime-gas vs deploy-bytecode tradeoff: higher values
# inline aggressively for faster runtime at the cost of larger deployed
# bytecode. StoxReceiptVault is the contract that binds against the EIP-170
# 24,576-byte runtime limit; 5000 keeps it under the limit while the rest of
# the suite stays well clear. The margin is thin and sensitive to vault source
# changes and dependency-tree bytecode shifts — re-check StoxReceiptVault's
# `forge build --sizes` runtime margin on any such change. via_ir is OFF (tried
# in #144, made the vault larger for this inheritance shape).
optimizer_runs = 5000
Comment on lines +8 to +16

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Keep the canonical optimizer profile at 24483 runs.

Dropping optimizer_runs to 5000 changes the deployed bytecode that the deterministic Zoltu addresses, codehash pins, and fork assertions are meant to track. The repo guideline fixes the single Foundry profile at 24483 runs specifically so deploys and tests compile the same artifact set; changing that here makes the new V4 pins represent a different canonical build profile. As per coding guidelines, foundry.toml must use a single profile with optimizer_runs = 24483, keep via_ir off, and preserve deterministic codehash comparison settings.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@foundry.toml` around lines 8 - 16, The Foundry profile in foundry.toml is
using a non-canonical optimizer setting, which will change the compiled
artifacts used by deploys, codehash pins, and fork assertions. Update the single
profile back to optimizer_runs = 24483 while keeping via_ir off, and ensure the
canonical build settings remain aligned with the deterministic Zoltu address and
codehash comparison flow used across the suite.

Source: Coding guidelines


evm_version = "cancun"

Expand All @@ -40,7 +40,7 @@ remappings = [
forge-std = "1.16.1"
"@openzeppelin-contracts" = "5.6.1"
"@openzeppelin-contracts-upgradeable" = "5.6.1"
"rain-deploy" = "0.1.3"
"rain-deploy" = "0.1.4"
"rain-extrospection" = "0.1.1"
"rain-factory" = "0.1.1"
"rain-math-fixedpoint" = "0.2.0"
Expand Down
2 changes: 1 addition & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@openzeppelin-contracts-5.6.1/=dependencies/@openzeppelin-contracts-5.6.1/
@openzeppelin-contracts-upgradeable-5.6.1/=dependencies/@openzeppelin-contracts-upgradeable-5.6.1/
forge-std-1.16.1/=dependencies/forge-std-1.16.1/
rain-deploy-0.1.3/=dependencies/rain-deploy-0.1.3/
rain-deploy-0.1.4/=dependencies/rain-deploy-0.1.4/
rain-extrospection-0.1.1/=dependencies/rain-extrospection-0.1.1/
rain-factory-0.1.1/=dependencies/rain-factory-0.1.1/
rain-math-fixedpoint-0.2.0/=dependencies/rain-math-fixedpoint-0.2.0/
Expand Down
2 changes: 1 addition & 1 deletion script/BuildPointers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity =0.8.25;
import {Script} from "forge-std-1.16.1/src/Script.sol";
import {LibCodeGen} from "rain-sol-codegen-0.1.0/src/lib/LibCodeGen.sol";
import {LibFs} from "rain-sol-codegen-0.1.0/src/lib/LibFs.sol";
import {LibRainDeploy} from "rain-deploy-0.1.3/src/lib/LibRainDeploy.sol";
import {LibRainDeploy} from "rain-deploy-0.1.4/src/lib/LibRainDeploy.sol";
import {StoxReceipt} from "../src/concrete/StoxReceipt.sol";
import {StoxReceiptVault} from "../src/concrete/StoxReceiptVault.sol";
import {StoxCorporateActionsFacet} from "../src/concrete/StoxCorporateActionsFacet.sol";
Expand Down
Loading
Loading