Skip to content
Open
Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
1297375
Fix spelling error (#11283)
Danyylka May 27, 2025
25aec50
Corrected typos (#11322)
dedyshkaPexto May 27, 2025
007b2e0
chore: remove broken link from onboarding documentation SETUP.md (#11…
alexnicita May 27, 2025
36593b4
docs: replaced the link to the badge and to Discord (#11334)
oksanaphmn May 27, 2025
6d6f9a4
chore: edited the link to the commit activity badge (#11418)
oksanaphmn May 27, 2025
a60152b
Deleted celotool, helm charts and metadata-crawler (#11440)
martinvol Jul 4, 2025
ec2872b
docs(README): the old Blog link in the documentation was broken (#11463)
braveocheretovych Aug 4, 2025
d9090b9
fix(ci): use generic runnerdeployment and pin custom docker image (#1…
ezdac Aug 5, 2025
f4558bd
chore(deps): update celo-org/reusable-workflows action to v2.0.5 (#11…
renovate[bot] Aug 12, 2025
b129985
Deprecate `isReserveLow` on L2 (#11290)
m-chrzan Apr 9, 2025
b194a08
Update test-sol to use Foundry 1.0 (#11348)
m-chrzan Apr 24, 2025
fad3410
Soloseng/feat/deprecate-L1 (#11365)
soloseng May 1, 2025
efefa8c
Epoch manager update (#11339)
pahor167 May 1, 2025
9d09994
Soloseng/deprecate-L1-test (#11392)
soloseng May 5, 2025
03fa825
Epoch manager e2e for vote/active/revoke/unlock in between epoch swi…
pahor167 May 6, 2025
161fa89
Soloseng/update-workspace-settings (#11398)
soloseng May 8, 2025
7332428
Super bridge ETH wrapper (#11343)
pahor167 May 13, 2025
ff6cedb
Cleanup of package.json scripts.
Mc01 May 14, 2025
0c5b490
Fix check-versions script invocations (#11420)
m-chrzan May 28, 2025
99dd44f
Obsolete function usage in IMockValidators affects validation (#2) (#…
martinvol Jun 11, 2025
5fa7da5
Unused HotfixWhitelisted event in Governance contract can be removed …
martinvol Jun 11, 2025
4579d1a
Deregister validator Epoch manager e2e test (#11443)
pahor167 Jul 21, 2025
9ea8c64
Removed unused circulatingSupply on Celo Token (#11454)
martinvol Jul 22, 2025
86dd8bf
Celo token nits (#11451)
martinvol Jul 23, 2025
b47a962
Tooling update for CR13 (#11437)
martinvol Aug 13, 2025
ce8d516
PR fixes
martinvol Aug 19, 2025
a895ea8
Clean up dead code and refresh README (#11473)
lvpeschke Aug 21, 2025
5059542
fix: typo in parameter name: newMininumReports → newMinimumReports (#…
gap-editor Aug 28, 2025
b368e4a
fix(deps): update dependency mathjs to v7 [security] (#10841)
renovate[bot] Aug 28, 2025
50ff387
Fix typos in governance contracts documentation (#11370)
leopardracer Aug 28, 2025
0c6204e
chore: fix typo in comment (#11498)
lechpzn Sep 15, 2025
f676a20
fix: typo in release script console messages (#11500)
sashass1315 Sep 16, 2025
d0acc98
chore: fix typo in comments (#11499)
Forostovec Sep 16, 2025
51449f5
fix(deps): update bip39 digest to a7ecbfe (#10848)
renovate[bot] Sep 16, 2025
fba885a
chore: fix typos (#11503)
MozirDmitriy Sep 18, 2025
10f4e85
fix: typos and improve log clarity in protocol library files (#11502)
radik878 Sep 18, 2025
363e6ab
Fix typos in test contracts and comments for better readability (#11504)
Snezhkko Sep 18, 2025
7e1dd2d
chore: fix some typos (#11511)
phrwlk Sep 23, 2025
6f7619c
fix typos (#11510)
viktorking7 Sep 25, 2025
3c7b7db
Fix typos in specs for accounts and governance (#11509)
Fibonacci747 Sep 25, 2025
0e4c2a8
chore: fixed broken links (#11513)
cypherpepe Oct 2, 2025
0e33f38
Fix log message in `Migration.s.sol` (#11515)
anim001k Oct 2, 2025
00a93b1
Fix typos and improve NatSpec comments in EpochManager and SortedLink…
GarmashAlex Oct 2, 2025
7ea9348
chore(protocol): fix broken link (#11525)
Galoretka Oct 2, 2025
74ab174
Fix unit tests on master. (#11512)
Mc01 Oct 2, 2025
8bca0da
docs: fix broken link (#11538)
VolodymyrBg Oct 15, 2025
6ed11ed
fix: correct typo in packages/protocol/README.md (#11549)
zeevick10 Oct 20, 2025
6a0a938
Fix CELO equivalent calculation in EpochManager and update correspond…
pahor167 Oct 9, 2025
f6098a4
Update version number in EpochManager and improve AST compatibility r…
pahor167 Oct 13, 2025
b6d5a66
[Rebased] Migrate governance tests from Truffle to Foundry (#11487)
Mc01 Aug 28, 2025
acc36a0
Add Foundry release scripts and update README with release instructio…
pahor167 Sep 9, 2025
9b07ea1
Update README and Foundry configuration for contract verification (#1…
pahor167 Sep 9, 2025
67e8eee
Detruffle check-versions script (#11490)
m-chrzan Sep 19, 2025
186c7cd
Add scripts for upgrading op impls. (#11514)
Mc01 Sep 25, 2025
7320729
Master > CR14 (#11530)
Mc01 Oct 3, 2025
3f1fe08
Contain scripts for MIPS redeployment. (#11527)
Mc01 Oct 9, 2025
7b41e16
Add tooling for L2 to L1 withdrawal. (#11497)
Mc01 Oct 9, 2025
d215f55
Add verification steps for Foundry & Truffle. (#11529)
Mc01 Oct 10, 2025
f8168a4
Verify new chain deployments (#11470)
Mc01 Oct 14, 2025
57424c3
CR14 -> CR15 (#11546)
pahor167 Oct 20, 2025
e24acf1
Close most recent dispute game (#11548)
Mc01 Oct 20, 2025
75ed903
Update .gitmodules with mento fork (#11560)
martinvol Oct 27, 2025
cce2242
Remove Ganache migrations (#11441)
martinvol Oct 30, 2025
97d9f25
remove unused dependencies (#11565)
martinvol Nov 10, 2025
3da6ea7
Detruffle verify-deployed script (#11562)
m-chrzan Nov 12, 2025
1668afb
remove env tests and its associated dependencies (#11567)
martinvol Nov 12, 2025
802e5e6
Upload anvil artifacts for devchain, instead of ganache (#11568)
martinvol Dec 9, 2025
a8c835a
Prune dispute games (#11557)
Mc01 Dec 15, 2025
f138116
Add scripts for withdrawal / deposit on sepolia & mainnet (#11585)
Mc01 Dec 15, 2025
048a24f
OP Tooling (#11591)
Mc01 Jan 5, 2026
07ac28f
OP Tooling: Succinct (#11592)
Mc01 Jan 5, 2026
102996b
Use anvil builds generated in master (#11588)
martinvol Jan 5, 2026
03ea78e
Add ValidatorEpochRewardAllocated event and corresponding test (#1160…
pahor167 Jan 8, 2026
79fcdd5
Add yarn script to run mocha tests (#11594)
m-chrzan Jan 8, 2026
064886d
Fixes the broken `yarn test:ts` tests (#11612)
m-chrzan Jan 14, 2026
980ca41
Merge release 14 to release 15 (#11621)
pahor167 Jan 19, 2026
6102231
Remove remaining Truffle compatibility tests, replacing with new viem…
m-chrzan Feb 2, 2026
3325ade
Update of Delegation (#11617)
pahor167 Feb 3, 2026
c92b9bf
feat(protocol): Fix Foundry release tooling to produce identical byte…
pahor167 Feb 3, 2026
8e25ec7
Remove ganache from package.json (#11644)
m-chrzan Feb 3, 2026
7517b44
Revert changes for minimal CR14 diff (#11651)
martinvol Feb 9, 2026
33bed19
Adding security checks for release scripts (#11662)
martinvol Mar 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .agent/skills
323 changes: 323 additions & 0 deletions .cursor/skills/celo-release/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
---
name: celo-release
description: Deploy Celo core contract releases using Foundry tooling. Use when releasing contracts, testing releases on forks, generating governance proposals, or when user mentions release, deploy, upgrade contracts, CR14, CR15, make-release, or verify-deployed.
---

# Celo Core Contracts Release

Deploy and test Celo core contract releases using Foundry-based tooling.

## Quick Reference

| Step | Command | Output |
|------|---------|--------|
| 1. Generate libraries.json | `verify-deployed:foundry -b <PREVIOUS_TAG>` | `libraries.json` |
| 2. Generate report | `check-versions:foundry -a <PREVIOUS_TAG> -b <NEW_BRANCH>` | `releaseData/versionReports/releaseN-report.json` |
| 3. Deploy & create proposal | `make-release:foundry -b <NEW_BRANCH>` | `proposal.json` + deployed contracts |

## Networks

| Network | Chain ID | RPC URL | Use Case |
|---------|----------|---------|----------|
| Celo Mainnet | 42220 | https://forno.celo.org | Production releases |
| Celo Sepolia | 11142220 | https://forno.celo-sepolia.celo-testnet.org | Testnet releases |
| Local Fork | varies | http://127.0.0.1:8545 | Testing releases |

## Deployer Keys

Deployer keys are stored in encrypted mnemonic files in the repo root:

| Network | Mnemonic File | Encrypted File |
|---------|--------------|----------------|
| Celo Sepolia | `.env.mnemonic.celosepolia` | N/A (manual) |
| Mainnet | `.env.mnemonic.mainnet` | `.env.mnemonic.mainnet.enc` |

### Decrypting Keys (cLabs employees)

```bash
# Decrypt all mnemonic files using GCP KMS
yarn keys:decrypt
```

### Using Keys

Each mnemonic file exports `DEPLOYER_PRIVATE_KEY`. Source it before running release commands:

```bash
# For Celo Sepolia
source .env.mnemonic.celosepolia

# For Mainnet
source .env.mnemonic.mainnet
```

Then use `$DEPLOYER_PRIVATE_KEY` in release commands.

## Release Workflow

### Step 0: Confirm Release Parameters with User

**IMPORTANT**: Before executing any release commands, you MUST:

1. Query available tags and branches:
```bash
git tag -l 'core-contracts.*' | sort -V | tail -15
git branch -a | grep 'release/core-contracts'
```

2. Determine the release source using this priority order:

**Tag priority (check in order, use first match):**
1. Post-audit tag (if exists): `core-contracts.vN.post-audit` or `core-contracts.vN.post_audit`
2. Base tag: `core-contracts.vN`
3. Release branch: `release/core-contracts/N` (only if no tags exist)

**Note**: Not all releases have post-audit tags. If one exists, use it; otherwise use the base tag.

**For the NEW release**: Check for post-audit tag first, then base tag, then branch.
**For the PREVIOUS release**: Same logic - use post-audit tag if available, otherwise base tag.

3. Present a confirmation to the user with:
- **Previous release tag** (for libraries.json): e.g., `core-contracts.v14` or `core-contracts.v14.post-audit`
- **New release source**: Following the priority above
- **Target network**: e.g., `celo-sepolia` or `celo`

4. Use the AskQuestion tool to get explicit confirmation:
- Option to confirm the proposed tags/branches
- Option to specify different tag/branch

5. Only proceed with the release after user confirmation.

Example confirmation prompt (when post-audit tag exists):
```
I plan to release with the following parameters:
- Previous release tag: core-contracts.v14.post-audit
- New release tag: core-contracts.v15.post-audit
- Target network: celo-sepolia

Please confirm or specify different values.
```

Example confirmation prompt (when only base tag exists):
```
I plan to release with the following parameters:
- Previous release tag: core-contracts.v14
- New release tag: core-contracts.v15
- Target network: celo-sepolia

Please confirm or specify different values.
```

Example confirmation prompt (when only branch exists):
```
I plan to release with the following parameters:
- Previous release tag: core-contracts.v14
- New release branch: release/core-contracts/15 (no tag found)
- Target network: celo-sepolia

Please confirm or specify different values.
```

### Step 1: Generate libraries.json

Verify the **currently deployed** release to get library addresses:

```bash
cd packages/protocol

# For Celo Sepolia
yarn release:verify-deployed:foundry -b core-contracts.v${PREVIOUS} -n celo-sepolia

# For Mainnet
yarn release:verify-deployed:foundry -b core-contracts.v${PREVIOUS} -n celo
```

**Output**: `libraries.json` in `packages/protocol/`

### Step 2: Generate Compatibility Report

Compare previous release to new release branch:

```bash
yarn release:check-versions:foundry \
-a core-contracts.v${PREVIOUS} \
-b release/core-contracts/${NEW} \
-r ./releaseData/versionReports/release${NEW}-report.json
```

**Output**: `releaseData/versionReports/release${NEW}-report.json`

### Step 3: Prepare Initialization Data

Create or verify initialization data exists:

```bash
# Check if file exists
cat ./releaseData/initializationData/release${NEW}.json

# If missing, create empty (valid if no new contracts)
echo "{}" > ./releaseData/initializationData/release${NEW}.json
```

### Step 4: Deploy Release

#### On Local Fork (Testing)

```bash
yarn release:make:foundry \
-b release/core-contracts/${NEW} \
-k $DEPLOYER_PRIVATE_KEY \
-i ./releaseData/initializationData/release${NEW}.json \
-l ./libraries.json \
-n celo-sepolia \
-p ./proposal-fork.json \
-r ./releaseData/versionReports/release${NEW}-report.json \
-u http://127.0.0.1:8545
```

#### On Celo Sepolia

```bash
yarn release:make:foundry \
-b release/core-contracts/${NEW} \
-k $CELO_SEPOLIA_DEPLOYER_KEY \
-i ./releaseData/initializationData/release${NEW}.json \
-l ./libraries.json \
-n celo-sepolia \
-p ./proposal-celo-sepolia.json \
-r ./releaseData/versionReports/release${NEW}-report.json
```

#### On Mainnet

```bash
# First regenerate libraries.json for mainnet!
yarn release:verify-deployed:foundry -b core-contracts.v${PREVIOUS} -n celo

yarn release:make:foundry \
-b release/core-contracts/${NEW} \
-k $MAINNET_DEPLOYER_KEY \
-i ./releaseData/initializationData/release${NEW}.json \
-l ./libraries.json \
-n celo \
-p ./proposal-mainnet.json \
-r ./releaseData/versionReports/release${NEW}-report.json
```

## Release Artifacts

| Artifact | Location | Purpose |
|----------|----------|---------|
| `libraries.json` | `packages/protocol/` | Library addresses (network-specific!) |
| Version report | `releaseData/versionReports/releaseN-report.json` | Contract changes & version deltas |
| Init data | `releaseData/initializationData/releaseN.json` | Constructor args for new contracts |
| Proposal | `proposal-*.json` | Governance transactions |

**Important**: `libraries.json` is network-specific. Regenerate when switching between Celo Sepolia and Mainnet.

## Determining Release Numbers

**Priority**: Always prefer git tags over branches. Post-audit tags are preferred over base tags.

```bash
# List existing tags (check these FIRST)
git tag -l 'core-contracts.*' | sort -V | tail -15

# List release branches (fallback if no tag exists)
git branch -a | grep 'release/core-contracts'
```

**Tag priority (check in order, use first match):**
1. `core-contracts.vN.post-audit` or `core-contracts.vN.post_audit` - Post-audit (if exists)
2. `core-contracts.vN` - Base tag
3. `release/core-contracts/N` - Branch (fallback only)

**Note**: Not all releases have post-audit tags. Use it if available, otherwise use the base tag.

**Selection logic:**
1. For NEW release: Check for post-audit tag first, then base tag, then branch
2. For PREVIOUS release: Same logic - use post-audit tag if available, otherwise base tag

## Starting a Local Fork

Before testing on a local fork, start Anvil with the required parameters:

```bash
# Fork Celo Sepolia
anvil --fork-url https://forno.celo-sepolia.celo-testnet.org \
--code-size-limit 500000 \
--gas-limit 100000000

# Fork Mainnet
anvil --fork-url https://forno.celo.org \
--code-size-limit 500000 \
--gas-limit 100000000
```

**Important**: The `--code-size-limit` and `--gas-limit` flags are required for Celo contract deployments due to large contract sizes.

## Contract Verification

The release script automatically verifies deployed contracts on:
- **Blockscout** (https://celo-sepolia.blockscout.com or https://celo.blockscout.com) - No API key required
- **Celoscan** via Etherscan V2 API (https://celoscan.io) - **API key required** for production networks

### Verification Features

The script handles verification automatically with:
- **Linked libraries**: Contracts using libraries (e.g., Governance with Proposals library) are verified with the `--libraries` flag
- **Foundry profiles**: Sets `FOUNDRY_PROFILE` environment variable (`truffle-compat` for 0.5.x, `truffle-compat8` for 0.8.x) to ensure bytecode matches
- **Full compiler version**: Uses full version with commit hash (e.g., `0.5.14+commit.01f1aaa4`)

### Celoscan API Key (Required for celo-sepolia and mainnet)

The API key is **required by default** for production networks. Get your key from https://etherscan.io/myapikey

**Setup options (in order of precedence):**

1. **CLI flag**: `-a YOUR_API_KEY`
2. **Environment variable**: `export CELOSCAN_API_KEY=YOUR_API_KEY`
3. **Config file**: `packages/protocol/.env.json`
```json
{
"celoScanApiKey": "YOUR_API_KEY"
}
```

**Note**: The Etherscan V2 API uses a unified endpoint (`api.etherscan.io`) that works with a single API key for all supported chains including Celo.

### Skip Verification

To skip verification (e.g., for testing or if you don't have an API key):
```bash
yarn release:make:foundry ... -s
```

Verification is automatically skipped when using a custom RPC URL (local forks).

### Verification Troubleshooting

- **"Address is not a smart-contract"**: Block explorer hasn't indexed the contract yet. The script waits 30s initially, then automatically retries up to 6 times with logarithmic delays (5s, 10s, 20s, 40s, 60s max).
- **"Bytecode mismatch"**: Usually caused by wrong foundry profile. The script now automatically sets `FOUNDRY_PROFILE` based on contract source path.
- **Linked library errors**: The script automatically detects and passes library addresses via `--libraries` flag for contracts that use linked libraries.

## Common Issues

### "libraries.json not found"
Run `verify-deployed:foundry` first with the previous release tag.

### "Version mismatch detected"
Update `getVersionNumber()` in the contract to match expected version from the report.

### "Deployment reverted" or "Out of gas" on Local Fork
Ensure Anvil is started with `--code-size-limit 500000 --gas-limit 100000000`.

### Testing on Local Fork
Use anvil's default test key for local forks:
```
0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
```

## Additional Resources

For complete documentation, see [RELEASE_PROCESS_FOUNDRY.md](../../packages/protocol/RELEASE_PROCESS_FOUNDRY.md)
Loading
Loading