Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
2751b9d
[Rebased] Migrate governance tests from Truffle to Foundry (#11487)
Mc01 Aug 28, 2025
9f0b773
Add Foundry release scripts and update README with release instructio…
pahor167 Sep 9, 2025
3aba928
Update README and Foundry configuration for contract verification (#1…
pahor167 Sep 9, 2025
b8ba230
Cherry pick apply migrations.
Mc01 Jul 17, 2025
3a9f12a
Quick & dirty migration fix for op-geth.
Mc01 Jul 17, 2025
aed6f6e
Update governance multi-sig settings and adjust proposal stage durations
pahor167 Jul 22, 2025
c2f2dcd
Add epoch manager parameter + cleanup.
Mc01 Jul 22, 2025
257ab0a
Further cleanup.
Mc01 Jul 22, 2025
9f7e5ce
broadcast fix
pahor167 Jul 22, 2025
bf5eb60
disable governance multisig
pahor167 Jul 22, 2025
a67b701
remove GovernanceMultisig
pahor167 Jul 22, 2025
69002a3
Improve ownership transfer logging in migration script
pahor167 Jul 23, 2025
dc439bb
Refactor ownership transfer to use registry for contract address reso…
pahor167 Jul 23, 2025
f14527e
Cleanup + TODOs after sync with Volpe.
Mc01 Jul 23, 2025
8359a52
Only owner for epoch manager.
Mc01 Jul 23, 2025
534731b
Correct loading json vars.
Mc01 Jul 23, 2025
60d047b
Add lockGold function call in migration script
pahor167 Jul 23, 2025
623c56a
Update epoch duration to 60 seconds in migrations configuration
pahor167 Jul 23, 2025
a719701
Removal of locked gold
pahor167 Jul 23, 2025
fd374e6
Update migrationsConfig.json
jcortejoso Jul 23, 2025
c4b7d39
Fix protocol tests in CI.
Mc01 Aug 1, 2025
880a001
Fix integration tests.
Mc01 Aug 1, 2025
e399ab5
Fix e2e epoch manager initialize.
Mc01 Aug 4, 2025
6337b3c
Use precompiled celo-foundry binaries for CI.
Mc01 Aug 4, 2025
251d622
Change base container image for CI.
Mc01 Aug 6, 2025
553b14d
Fix e2e.
Mc01 Aug 6, 2025
4ad9001
Bump version.
Mc01 Aug 7, 2025
2b02011
Fix common tests.
Mc01 Aug 7, 2025
e9005b0
Adapt start anvil script for Op state.
Mc01 Aug 7, 2025
42b28ca
Don't remove tmp dir.
Mc01 Aug 7, 2025
6d0d2e1
migration: Set intrinsic gas fee stable to 50k
palango Aug 19, 2025
4ae4b76
Cleanup after cherry-pick.
Mc01 Sep 15, 2025
54a71ef
Bring back approver multisig.
Mc01 Sep 16, 2025
87ca89c
Rollback migrations config. Fix e2e tests. Apply changes from CR.
Mc01 Sep 16, 2025
19c2af6
Detruffle check-versions script (#11490)
m-chrzan Sep 19, 2025
351d0dd
Add scripts for upgrading op impls. (#11514)
Mc01 Sep 25, 2025
2c5b2c9
Merge branch 'release/core-contracts/14' into mc01/cr14/geth-migrations
martinvol Sep 26, 2025
d393c5a
Master > CR14 (#11530)
Mc01 Oct 3, 2025
fbe88d2
CR.
Mc01 Oct 7, 2025
082c159
Merge branch 'release/core-contracts/14' into mc01/cr14/geth-migrations
Mc01 Oct 7, 2025
f2baef8
Run prettier.
Mc01 Oct 7, 2025
06c8866
CR - add additional anvil port.
Mc01 Oct 8, 2025
6ea49d0
Geth migrations - fix tests.
Mc01 Oct 14, 2025
0a5c8c5
Update .gitmodules with mento fork (#11559)
martinvol Oct 27, 2025
38c63c3
Add production environment to workflow for oidc trusted publishing (#…
pputman-clabs Dec 9, 2025
e7ab870
Pputman/update ci environment (#11579)
pputman-clabs Dec 9, 2025
2553a3d
[Rebased] Migrate governance tests from Truffle to Foundry (#11487)
Mc01 Aug 28, 2025
8ba6470
Add Foundry release scripts and update README with release instructio…
pahor167 Sep 9, 2025
107de12
Update README and Foundry configuration for contract verification (#1…
pahor167 Sep 9, 2025
d6cc7b7
Detruffle check-versions script (#11490)
m-chrzan Sep 19, 2025
511adcf
Add scripts for upgrading op impls. (#11514)
Mc01 Sep 25, 2025
3b9ad7d
Master > CR14 (#11530)
Mc01 Oct 3, 2025
2963ee8
Contain scripts for MIPS redeployment. (#11527)
Mc01 Oct 9, 2025
a286c43
Add tooling for L2 to L1 withdrawal. (#11497)
Mc01 Oct 9, 2025
41b1e08
Add verification steps for Foundry & Truffle. (#11529)
Mc01 Oct 10, 2025
9a4612e
Verify new chain deployments (#11470)
Mc01 Oct 14, 2025
39d2c56
CR14 -> CR15 (#11546)
pahor167 Oct 20, 2025
811366e
Close most recent dispute game (#11548)
Mc01 Oct 20, 2025
bd4be1e
Remove Ganache migrations (#11441)
martinvol Oct 30, 2025
1bbed8c
remove unused dependencies (#11565)
martinvol Nov 10, 2025
2635163
Detruffle verify-deployed script (#11562)
m-chrzan Nov 12, 2025
c14376f
remove env tests and its associated dependencies (#11567)
martinvol Nov 12, 2025
f0b09b7
Upload anvil artifacts for devchain, instead of ganache (#11568)
martinvol Dec 9, 2025
3461f59
Trigger npm devchain build on master (#11584)
martinvol Dec 16, 2025
4490f7b
Make anvil devchain uploads monthly again (#11590)
martinvol Jan 5, 2026
7383f0a
Merge branch 'release/core-contracts/15' into martinvol/gethMigrations
martinvol Jan 5, 2026
75b2160
migrations work
martinvol Jan 6, 2026
06fb208
unified start anvil
martinvol Jan 6, 2026
607a2a4
Use default foundry path
martinvol Jan 6, 2026
580ae33
Fixed issue with foundry 1.4
martinvol Jan 7, 2026
199646c
Got it to work locally, CI will most likely fail
martinvol Jan 12, 2026
063dd7b
fully works
martinvol Jan 13, 2026
36a2120
Run it on CI
martinvol Jan 13, 2026
bb77e23
Merge branch 'release/core-contracts/15' into martinvol/gethMigrations
martinvol Jan 13, 2026
50bf1f0
moved build to another yml file
martinvol Jan 13, 2026
54ebada
Add logging and speed things up
martinvol Jan 13, 2026
0fc17a5
fix paths
martinvol Jan 13, 2026
c2012f3
fix typo
martinvol Jan 13, 2026
0b7c250
remove cat to speed things up
martinvol Jan 13, 2026
a98e1d5
fixed the build
martinvol Jan 13, 2026
a1a3ad6
fixed tests
martinvol Jan 13, 2026
f9a28b2
fix tests
martinvol Jan 13, 2026
a94db19
ignore a test for now
martinvol Jan 13, 2026
4986589
commit yarn lock
martinvol Jan 13, 2026
656d425
deleted legacy L2 devchain
martinvol Jan 13, 2026
8c47f9e
bring back yarn during tests
martinvol Jan 13, 2026
1605bef
fixed leftoever file
martinvol Jan 13, 2026
ee244f9
fix CI?
martinvol Jan 13, 2026
e13e441
Attempt to fix the build for the release tests
martinvol Jan 14, 2026
37f7627
Merge branch 'release/core-contracts/15' into martinvol/gethMigrations
martinvol Jan 14, 2026
b3431a1
revert test to what's in CR15
martinvol Jan 14, 2026
cb3196a
fix anvil tests
martinvol Jan 19, 2026
bde840f
start anvil now takes parameters
martinvol Jan 19, 2026
f9230b0
Fix CI versions
martinvol Jan 19, 2026
67cc404
fixed ports
martinvol Jan 19, 2026
f283373
forgot to push constants
martinvol Jan 19, 2026
89aaeef
Merge branch 'release/core-contracts/15' into martinvol/gethMigrations
martinvol Jan 19, 2026
814bde0
removed missing constant
martinvol Jan 19, 2026
75e6397
fixed epoch manager
martinvol Jan 19, 2026
29a28b1
fixed more ports
martinvol Jan 19, 2026
51e37d1
one more port
martinvol Jan 19, 2026
398ad1b
disable test for CI
martinvol Jan 19, 2026
d8ec2f8
Fixed votes activation
martinvol Jan 20, 2026
27745fa
install cli with sudo
martinvol Jan 20, 2026
01186a0
Fixed cli version command
martinvol Jan 20, 2026
2ee0aa1
fixed test, I think they were never working
martinvol Jan 20, 2026
e7ec468
remove console logs EpochRewards
martinvol Jan 20, 2026
7ee8409
Moving OP contract generation to another contract
martinvol Jan 21, 2026
3d11c56
rolled back Epoch rewards
martinvol Jan 21, 2026
8c94793
Deleted unused or redundant add to registry
martinvol Jan 21, 2026
5a5919e
Forgot to add package.json
martinvol Jan 21, 2026
9f4950d
nits
martinvol Jan 21, 2026
806cece
more nits
martinvol Jan 21, 2026
8c7d2eb
Removed unused function from lib/web3-utils.ts
martinvol Jan 21, 2026
c8745ca
more nits
martinvol Jan 21, 2026
43f6c09
Update packages/protocol/scripts/foundry/create_and_migrate_anvil_dev…
martinvol Jan 21, 2026
0eee43a
nits
martinvol Jan 26, 2026
b946a5a
refactor so code is not needed anymore
martinvol Jan 26, 2026
683a1dd
Merge branch 'martinvol/gethMigrations' of github.com:celo-org/celo-m…
martinvol Jan 26, 2026
c47a739
Adding deleted unused code
martinvol Jan 26, 2026
01df42e
simplify script a lot
martinvol Jan 26, 2026
67cbf10
fixed tests
martinvol Jan 26, 2026
4456f4a
fixed tests
martinvol Jan 26, 2026
a6a3584
fixed all tests
martinvol Jan 26, 2026
397eda6
Merge branch 'martinvol/gethMigrations' of github.com:celo-org/celo-m…
martinvol Jan 26, 2026
1d18cde
nits
martinvol Jan 26, 2026
d189fc6
simplify EpochManager tests
martinvol Jan 26, 2026
62283fe
Clean up more migrations file
martinvol Jan 26, 2026
5e3fb0f
more cleanning
martinvol Jan 26, 2026
78f9695
removed duplicated entry package.json
martinvol Jan 26, 2026
ea7b5db
typo
martinvol Jan 27, 2026
ce3f0e2
moved to a better repo
martinvol Jan 27, 2026
0221619
nits
martinvol Jan 27, 2026
ae6c263
Merge release/core-contracts/16 into martinvol/gethMigrations
martinvol Mar 9, 2026
e030bb5
Update publish-contracts-abi-release workflow to Node 20
martinvol Mar 9, 2026
9875630
Restore npm-publish runner for publish-contracts-abi-release workflow
martinvol Mar 9, 2026
84121d2
Replace ForceTx with msg.sender and move mockIntrinsicGas to constants
martinvol Mar 9, 2026
036ef0f
Fix contractSuffixes spelling mismatch between JSON config and code
martinvol Mar 9, 2026
cf0f41d
Merge branch 'release/core-contracts/16' into martinvol/gethMigrations
martinvol Mar 9, 2026
dcbe303
Replace ForceTx with msg.sender and move mockIntrinsicGas to constants
martinvol Mar 9, 2026
9d9284b
Fix references to deleted create_and_migrate_anvil_l2_devchain.sh
martinvol Mar 11, 2026
110b60d
Prune dispute games (#11557)
Mc01 Dec 15, 2025
57fe2cf
Add scripts for withdrawal / deposit on sepolia & mainnet (#11585)
Mc01 Dec 15, 2025
7d741aa
OP Tooling (#11591)
Mc01 Jan 5, 2026
6e8f8bf
OP Tooling: Succinct (#11592)
Mc01 Jan 5, 2026
a644fb7
Use anvil builds generated in master (#11588)
martinvol Jan 5, 2026
a57cda7
Add ValidatorEpochRewardAllocated event and corresponding test (#1160…
pahor167 Jan 8, 2026
d6073b6
Add yarn script to run mocha tests (#11594)
m-chrzan Jan 8, 2026
4a4323f
Fixes the broken `yarn test:ts` tests (#11612)
m-chrzan Jan 14, 2026
b973a62
Merge release 14 to release 15 (#11621)
pahor167 Jan 19, 2026
c0dcab4
Remove remaining Truffle compatibility tests, replacing with new viem…
m-chrzan Feb 2, 2026
7698c39
Update of Delegation (#11617)
pahor167 Feb 3, 2026
2a29e53
feat(protocol): Fix Foundry release tooling to produce identical byte…
pahor167 Feb 3, 2026
30dcdb8
Remove ganache from package.json (#11644)
m-chrzan Feb 3, 2026
2f21269
Revert changes for minimal CR14 diff (#11651)
martinvol Feb 9, 2026
a46299c
Adding security checks for release scripts (#11662)
martinvol Mar 9, 2026
fc5060e
Revert "Revert changes for minimal CR14 diff (#11651)"
martinvol Apr 7, 2026
69b8775
fix(ci): correct Foundry cache paths in protocol_tests.yml
martinvol Mar 9, 2026
c45dcad
Merge branch 'release/core-contracts/16' into martinvol/gethMigrations
martinvol Apr 8, 2026
2fbac60
Merge remote-tracking branch 'origin/release/core-contracts/16' into …
martinvol Apr 8, 2026
2284222
fixed wrong merge
martinvol Apr 8, 2026
1741051
Fix libraries file name override in release-on-devchain.sh
martinvol Apr 8, 2026
dd272bf
Fix make-release-foundry.sh to pass --buildDirectory matching make-re…
martinvol Apr 8, 2026
bfa6bb2
Use distinct validator signers derived from a separate mnemonic
martinvol Apr 10, 2026
f0848ff
Move treasury balance to config, remove console2 import, fix workflow…
martinvol Apr 10, 2026
55924b0
Add current_block helper in activate_votes.sh, TODO for Foundry version
martinvol Apr 13, 2026
9e00e81
Remove unused beforeTestSetup from E2E_Governance tests
martinvol Apr 13, 2026
f621567
nit fixes
martinvol Apr 13, 2026
0cf35ed
remove --slow flag
martinvol Apr 13, 2026
559a34e
Move intrinsic gas to config and update to 75000
martinvol Apr 13, 2026
d1b6213
Fix typos, dead code, and minor issues from PR review
martinvol Apr 14, 2026
407e459
Fix type mismatches, duplicate functions, and unsafe port kills
martinvol Apr 15, 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
8 changes: 5 additions & 3 deletions .github/workflows/celo-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ jobs:
name: devchain-${{ env.RELEASE_TAG }}
path: packages/protocol/.tmp/devchain
- name: Install Foundry
# foundry-toolchain v1.7.0 https://github.com/foundry-rs/foundry-toolchain/releases/tag/v1.7.0
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773
with:
# TODO: Standardize Foundry version across workflows https://github.com/celo-org/celo-monorepo/issues/11714
version: 'v1.0.0'

- name: Install forge dependencies
Expand Down Expand Up @@ -235,8 +237,10 @@ jobs:
rebuild-package: 'true'
artifacts_to_cache: ${{ needs.install-dependencies.outputs.artifacts_to_cache }}
- name: Install Foundry
# foundry-toolchain v1.7.0 https://github.com/foundry-rs/foundry-toolchain/releases/tag/v1.7.0
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773
with:
# TODO: Standardize Foundry version across workflows https://github.com/celo-org/celo-monorepo/issues/11714
version: 'v1.0.0'
- name: Install forge dependencies
working-directory: packages/protocol
Expand All @@ -252,9 +256,7 @@ jobs:
# NOTE: This has not been fully tested as we don't have a license for certora
certora-test:
name: Certora test ${{ matrix.name }}
runs-on: ['self-hosted', 'org', '8-cpu']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:34b1c5e90f9613964160cdf6bc292b410362ec6d
runs-on: ['self-hosted', 'org', 'ubuntu22-node18']
timeout-minutes: 30
needs: install-dependencies
# Disable as certora license is not active
Expand Down
46 changes: 38 additions & 8 deletions .github/workflows/protocol-devchain-anvil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ on:
env:
# Increment these to force cache rebuilding
FOUNDRY_CACHE_KEY: 1
# Supported Foundry version defined at celo-org (GitHub organisation) level, for consistency across workflows.
SUPPORTED_FOUNDRY_VERSION: ${{ vars.SUPPORTED_FOUNDRY_VERSION }}
# TODO: Standardize Foundry version across workflows https://github.com/celo-org/celo-monorepo/issues/11714

permissions:
contents: read
Expand Down Expand Up @@ -98,9 +97,11 @@ jobs:
echo "Pull Request Number: ${{ env.PR_NUMBER }}"

- name: Install Foundry
# foundry-toolchain v1.7.0 https://github.com/foundry-rs/foundry-toolchain/releases/tag/v1.7.0
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773
with:
version: 'v1.0.0'
# TODO: Standardize Foundry version across workflows https://github.com/celo-org/celo-monorepo/issues/11714
version: 'v1.5.0'

- name: Install forge dependencies
run: forge install
Expand All @@ -127,21 +128,49 @@ jobs:
npm install --global yarn
source ~/.bashrc


- name: 'Install packages'
shell: bash
run: yarn

- name: Generate L2 migration and run migration tests
- name: Checkout Optimism repo
uses: actions/checkout@v4
if: success() || failure()
with:
repository: 'celo-org/optimism'
ref: 'celo/core-contracts-base'
path: celo-optimism
submodules: recursive

- name: Generate initial state for devchain
if: success() || failure()
run: yarn devchain:generate-initial-state --contracts-dir ${{ github.workspace }}/celo-optimism/packages/contracts-bedrock

- name: Install celocli
run: |
source ./scripts/foundry/constants.sh
sudo npm install -g @celo/celocli@latest --unsafe-perm
celocli --version

echo "Starting L2 from scratch to circumvent Anvil bug"
./scripts/foundry/create_and_migrate_anvil_l2_devchain.sh
- name: Generate migrations on local devchain
if: success() || failure()
run: |
LOAD_STATE=${{ github.workspace }}/celo-optimism/packages/contracts-bedrock/anvil-state.json ./scripts/foundry/create_and_migrate_anvil_devchain.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Publish generated devchain state file into artifact

This workflow now runs migrations via LOAD_STATE=... create_and_migrate_anvil_devchain.sh, but that script no longer exports a final snapshot into packages/protocol/.tmp (the previous devchain.json/l2-devchain.json writeout path was removed). Since the publish job uploads .tmp directly, the npm artifact can be published without a usable chain state file, breaking consumers that expect to start anvil from the package contents.

Useful? React with 👍 / 👎.


FOUNDRY_PROFILE=devchain forge test \
- name: Run migration tests against local op-geth devchain
run: |
source ./scripts/foundry/constants.sh

FOUNDRY_PROFILE=devchain forge test -vvv \
--match-path "test-sol/devchain/migration/*" \
--fork-url $ANVIL_RPC_URL

- name: Run e2e tests against local devchain
run: |
source ./scripts/foundry/constants.sh

FOUNDRY_PROFILE=devchain forge test -vvv \
--match-path "test-sol/devchain/e2e/*" \
--fork-url $ANVIL_RPC_URL

- name: Sanitize ref name
id: sanitize-ref-name
Expand Down Expand Up @@ -176,6 +205,7 @@ jobs:
id: artifact-name
run: echo "name=devchain-${{ env.PR_NUMBER }}-${{ steps.date.outputs.date }}" >> $GITHUB_OUTPUT


- name: Upload devchain as artifact
uses: actions/upload-artifact@v4
with:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/protocol_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
defaults:
run:
working-directory: packages/protocol
name: Lint checks
runs-on: ubuntu-latest
name: Run tests
runs-on: ['self-hosted', 'org', 'ubuntu22-node18']
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -55,7 +55,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Fail if there are test with wrong extension
if: success() || failure()
run: |
Expand All @@ -77,9 +76,12 @@ jobs:
path: packages/protocol/out
key: ${{ runner.os }}-foundry-out-${{ env.FOUNDRY_CACHE_KEY }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
# foundry-toolchain v1.7.0 https://github.com/foundry-rs/foundry-toolchain/releases/tag/v1.7.0
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773
Comment thread
Mc01 marked this conversation as resolved.
Comment thread
martinvol marked this conversation as resolved.
with:
version: 'v1.0.0' # TODO: revert back to env var
# TODO: Standardize Foundry version across workflows https://github.com/celo-org/celo-monorepo/issues/11714
version: 'v1.5.0'
Comment thread
martinvol marked this conversation as resolved.

- name: Install forge dependencies
run: forge install
- name: Compile Contracts
Expand Down Expand Up @@ -184,7 +186,7 @@ jobs:
- name: Restore script permissions
run: chmod +x scripts/foundry/*.sh
- name: Generate migrations and run devchain
run: ./scripts/foundry/create_and_migrate_anvil_l2_devchain.sh
run: ./scripts/foundry/create_and_migrate_anvil_devchain.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Install celocli before running devchain migration script

create_and_migrate_anvil_devchain.sh now calls activate_votes.sh, which executes celocli epochs:switch (packages/protocol/scripts/foundry/activate_votes.sh, line 46), but this job invokes the script directly without installing celocli first. On the ubuntu-latest runner used here, that causes the devchain setup step to fail before tests start; note that .github/workflows/protocol-devchain-anvil.yml added an explicit celocli install step for the same script path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Provide LOAD_STATE when launching the new devchain migration flow

This step now runs the L1/L2-combined migration script without LOAD_STATE, but the new migration code expects predeployed proxy addresses from .proxies.* and immediately interacts with them (for example, migrateFeeCurrencyDirectorysetImplementationOnProxyAndAddToRegistry reads proxy._getOwner()). Without loading a prepared state file, those proxy addresses are not guaranteed to exist and migration can revert before running any devchain tests; the dedicated devchain workflow already mitigates this by generating and passing anvil-state.json.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use a Foundry version that supports anvil --celo

This job now invokes create_and_migrate_anvil_devchain.sh, which starts Anvil with --celo, but the same job still installs Foundry v1.0.0. In Foundry v1.0.0's Anvil CLI (crates/anvil/src/cmd.rs), --celo is not an accepted network flag, so this step fails with an unknown option before migrations/tests execute. Pinning a Foundry release with Celo network support (or avoiding the new script here) is required for this workflow path to run.

Useful? React with 👍 / 👎.

- name: Run migration tests against local anvil devchain
run: |
source ./scripts/foundry/constants.sh
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ broadcast/
out-truffle-compat-0.8
out-truffle-compat

opencode.json
opencode.json
15 changes: 10 additions & 5 deletions packages/protocol/contracts-0.8/common/EpochManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,29 @@ contract EpochManager is
* @notice Used in place of the constructor to allow the contract to be upgradable via proxy.
* @param registryAddress The address of the registry core smart contract.
* @param newEpochDuration The duration of an epoch in seconds.
* @param sortedOraclesAddress The address of the sorted oracles core smart contract.
*/
function initialize(address registryAddress, uint256 newEpochDuration) external initializer {
function initialize(
address registryAddress,
uint256 newEpochDuration,
address sortedOraclesAddress
) external initializer {
_transferOwnership(msg.sender);
setRegistry(registryAddress);
setEpochDuration(newEpochDuration);
setOracleAddress(registry.getAddressForOrDie(SORTED_ORACLES_REGISTRY_ID));
setOracleAddress(sortedOraclesAddress);
}

/**
* @notice Initializes the EpochManager system, allowing it to start processing epoch
* and distributing the epoch rewards.
* @dev Can only be called by the EpochManagerEnabler contract.
* @dev Can only be called by Owner. This function is only meant to be called during deployment of a new network.
*/
function initializeSystem(
uint256 firstEpochNumber,
uint256 firstEpochBlock,
address[] memory firstElected
) external onlyEpochManagerEnabler {
) external onlyOwner {
Comment thread
martinvol marked this conversation as resolved.
require(
getCeloToken().balanceOf(registry.getAddressForOrDie(CELO_UNRELEASED_TREASURY_REGISTRY_ID)) >
0,
Expand Down Expand Up @@ -604,7 +609,7 @@ contract EpochManager is
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 0, 3);
return (1, 2, 0, 0);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "./interfaces/IEpochManagerEnablerInitializer.sol";

/**
* @title Contract Used to initialize the EpochManager system after L2 transition.
* @dev this contract is now deprecated.
*/
contract EpochManagerEnabler is
Initializable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ import { ILockedCelo } from "../../contracts/governance/interfaces/ILockedCelo.s
import { IValidators } from "../../contracts/governance/interfaces/IValidators.sol";

// Identity imports
import { IAttestations } from "../../contracts/identity/interfaces/IAttestations.sol";
import { IEscrow } from "../../contracts/identity/interfaces/IEscrow.sol";
import { IFederatedAttestations } from "../../contracts/identity/interfaces/IFederatedAttestations.sol";
import { IOdisPayments } from "../../contracts/identity/interfaces/IOdisPayments.sol";
import { IRandom } from "../../contracts/identity/interfaces/IRandom.sol";

// Stability imports
import { ISortedOracles } from "../../contracts/stability/interfaces/ISortedOracles.sol";
Expand All @@ -47,10 +45,6 @@ contract UsingRegistryV2NoMento {
keccak256(abi.encodePacked("CeloUnreleasedTreasury"));
bytes32 internal constant GOLD_TOKEN_REGISTRY_ID = keccak256(abi.encodePacked("GoldToken"));
bytes32 internal constant CELO_TOKEN_REGISTRY_ID = keccak256(abi.encodePacked("CeloToken"));
bytes32 internal constant DOUBLE_SIGNING_SLASHER_REGISTRY_ID =
keccak256(abi.encodePacked("DoubleSigningSlasher"));
bytes32 internal constant DOWNTIME_SLASHER_REGISTRY_ID =
keccak256(abi.encodePacked("DowntimeSlasher"));
bytes32 internal constant ELECTION_REGISTRY_ID = keccak256(abi.encodePacked("Election"));
bytes32 internal constant EPOCH_REWARDS_REGISTRY_ID = keccak256(abi.encodePacked("EpochRewards"));
bytes32 internal constant EPOCH_MANAGER_ENABLER_REGISTRY_ID =
Expand All @@ -63,15 +57,12 @@ contract UsingRegistryV2NoMento {
keccak256(abi.encodePacked("FeeCurrencyDirectory"));
bytes32 internal constant FEE_HANDLER_REGISTRY_ID = keccak256(abi.encodePacked("FeeHandler"));
bytes32 internal constant FREEZER_REGISTRY_ID = keccak256(abi.encodePacked("Freezer"));
bytes32 internal constant GAS_PRICE_MINIMUM_REGISTRY_ID =
keccak256(abi.encodePacked("GasPriceMinimum"));
bytes32 internal constant GOVERNANCE_REGISTRY_ID = keccak256(abi.encodePacked("Governance"));
bytes32 internal constant GOVERNANCE_SLASHER_REGISTRY_ID =
keccak256(abi.encodePacked("GovernanceSlasher"));
bytes32 internal constant LOCKED_GOLD_REGISTRY_ID = keccak256(abi.encodePacked("LockedGold"));
bytes32 internal constant LOCKED_CELO_REGISTRY_ID = keccak256(abi.encodePacked("LockedCelo"));
bytes32 internal constant ODIS_PAYMENT_REGISTRY_ID = keccak256(abi.encodePacked("OdisPayments"));
bytes32 internal constant RANDOM_REGISTRY_ID = keccak256(abi.encodePacked("Random"));
bytes32 internal constant SCORE_MANAGER_REGISTRY_ID = keccak256(abi.encodePacked("ScoreManager"));
bytes32 internal constant SORTED_ORACLES_REGISTRY_ID =
keccak256(abi.encodePacked("SortedOracles"));
Expand Down Expand Up @@ -161,10 +152,6 @@ contract UsingRegistryV2NoMento {
return IOdisPayments(registryContract.getAddressForOrDie(ODIS_PAYMENT_REGISTRY_ID));
}

function getRandom() internal view returns (IRandom) {
return IRandom(registryContract.getAddressForOrDie(RANDOM_REGISTRY_ID));
}

function getScoreReader() internal view returns (IScoreReader) {
return IScoreReader(registryContract.getAddressForOrDie(SCORE_MANAGER_REGISTRY_ID));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
pragma solidity >=0.5.13 <0.9.0;

interface IEpochManagerInitializer {
function initialize(address registryAddress, uint256 newEpochDuration) external;
function initialize(
address registryAddress,
uint256 newEpochDuration,
address sortedOraclesAddress
) external;
}
2 changes: 2 additions & 0 deletions packages/protocol/contracts/governance/EpochRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,10 @@ contract EpochRewards is
) internal view returns (FixidityLib.Fraction memory) {
uint256 targetSupply = getTargetGoldTotalSupply();
uint256 allocatedSupply = ICeloToken(address(getCeloToken())).allocatedSupply();

uint256 remainingSupply = GOLD_SUPPLY_CAP.sub(allocatedSupply.add(targetGoldSupplyIncrease));
uint256 targetRemainingSupply = GOLD_SUPPLY_CAP.sub(targetSupply);

FixidityLib.Fraction memory remainingToTargetRatio = FixidityLib
.newFixed(remainingSupply)
.divide(FixidityLib.newFixed(targetRemainingSupply));
Expand Down
4 changes: 4 additions & 0 deletions packages/protocol/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# docs: https://getfoundry.sh/config/reference/default-config

[lint]
lint_on_build = false

[profile.default]
src = 'contracts-0.8'
out = 'out'
Expand Down
25 changes: 0 additions & 25 deletions packages/protocol/governanceConstitution.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
"Accounts": {
"default": 600000000000000000000000
},
"BlockchainParameters": {
"default": 900000000000000000000000,
"setBlockGasLimit": 800000000000000000000000,
"setIntrinsicGasForAlternativeFeeCurrency": 800000000000000000000000
},
"DoubleSigningSlasher": {
"default": 700000000000000000000000,
"setSlashingIncentives": 700000000000000000000000
},
"DowntimeSlasher": {
"default": 700000000000000000000000,
"setSlashingIncentives": 700000000000000000000000,
"setSlashableDowntime": 700000000000000000000000
},
"Election": {
"default": 800000000000000000000000,
"setRegistry": 900000000000000000000000,
Expand Down Expand Up @@ -45,13 +31,6 @@
"freeze": 600000000000000000000000,
"unfreeze": 600000000000000000000000
},
"GasPriceMinimum": {
"default": 700000000000000000000000,
"setRegistry": 900000000000000000000000,
"setAdjustmentSpeed": 700000000000000000000000,
"setTargetDensity": 700000000000000000000000,
"setGasPriceMinimumFloor": 700000000000000000000000
},
"GoldToken": {
"default": 900000000000000000000000,
"transfer": 600000000000000000000000,
Expand Down Expand Up @@ -93,10 +72,6 @@
"_setAndInitializeImplementation": 900000000000000000000000,
"_setImplementation": 900000000000000000000000
},
"Random": {
"default": 700000000000000000000000,
"setRandomnessBlockRetentionWindow": 700000000000000000000000
},
"Registry": {
"default": 900000000000000000000000,
"setAddressFor": 900000000000000000000000
Expand Down
Loading
Loading