Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UNTRACKED] V2 #57

Merged
merged 40 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3818bed
STABLE-6895 (Part 1): Add initial BaseTokenMessenger implementation a…
ams9198 Sep 4, 2024
a6ff5ee
STABLE-6895: Part 2/3, implement depositForBurnWithHook relay-side (…
ams9198 Sep 6, 2024
8b7aa90
Stable 7247 evm contract deploy process refactor (#14)
epoon-circle Sep 11, 2024
727af10
Stable 7269 eccp update foundry version forge std (#12)
epoon-circle Sep 11, 2024
b0e480e
Stable 7269 bugfix new v2 tests abicoder version (#17)
epoon-circle Sep 11, 2024
5ba32e2
STABLE-6926: (Part 1) Add depositForBurn + tests on relay side (#15)
ams9198 Sep 11, 2024
6f02d5d
STABLE-6926: (Part 2) Implement MessageTransmitterV2 message relay (#18)
ams9198 Sep 13, 2024
6d7d118
Stable 7248 update cctpv2 deploy using create2 (#16)
epoon-circle Sep 18, 2024
220b071
STABLE-6895 (Part 4) / STABLE-6926: Add deterministic nonce handling …
ams9198 Sep 18, 2024
bb17db2
[No ticket] Fast-follow to PR 19: improve fuzz tests (#20)
ams9198 Sep 20, 2024
caa5c52
STABLE-6895: Finish hooks implementation (#22)
ams9198 Sep 23, 2024
abb8c94
typo fix (#11)
walkerq Sep 23, 2024
eeea48f
STABLE-7292: Implement handleReceiveUnfinalizedMessage (#25)
ams9198 Oct 2, 2024
bafdb8d
STABLE-6894: Part 1, add proxy contract (#29)
ams9198 Oct 4, 2024
1aa77d7
STABLE-7589: Add Denylist to TokenMessenger (#31)
ams9198 Oct 11, 2024
40a2e35
STABLE-6894: Part 2, complete proxy implementation (#30)
ams9198 Oct 16, 2024
7ff0dee
[No ticket] Add missing Initializable.sol tests (#32)
ams9198 Oct 18, 2024
940b15c
[No ticket] Update DenylisterUpdated event to take additional argumen…
ams9198 Oct 18, 2024
4b918db
[No ticket] Allow passing no remote token messengers on initializatio…
ams9198 Oct 21, 2024
c0ac86b
STABLE-7553: Add e2e cross-chain transfer test for v2 (#36)
ams9198 Oct 24, 2024
5de4cdf
[No ticket] [Looking for feedback] Small cleanups to the repo (#34)
ams9198 Oct 24, 2024
813d9bc
[No ticket] Fix AdminUpgradability file path in v2 integration test (…
ams9198 Oct 24, 2024
d4a4023
[No ticket] Add AddressUtilsExternal library with external functions …
ams9198 Oct 24, 2024
0790159
[STABLE-7280] Natspec updates; refactored the finality thresholds to …
ams9198 Oct 24, 2024
0d3fa11
STABLE-7553 (Part 2): Add basic integration test for TokenMessengerV2…
ams9198 Oct 31, 2024
2e28bff
[STABLE-7170] Add sample CCTP v2 wrapper contract (#42)
ams9198 Nov 4, 2024
47dcbca
STABLE-7554: Internal audit changes (#44)
ams9198 Nov 5, 2024
e5e3b5a
Update Create2Factory deployAndMultiCall (#45)
epoon-circle Nov 6, 2024
5ee9bbd
STABLE-7659 (follow-up): Add storage gaps (#46)
ams9198 Nov 7, 2024
897f7f8
Stable 7722 v2 deployment scripts (#43)
epoon-circle Nov 13, 2024
2ae9be3
[STABLE-7559]: Migrate from Slither to Mythril for static analysis (#47)
tongshi Nov 21, 2024
45dc747
feat(ci): olympix scan integration (#49)
pthakur-circle Dec 5, 2024
cc83ccb
[No ticket] Allow fee collection on finalized message codepath (#48)
ams9198 Dec 6, 2024
c0d6707
Allow users of this repository as a submodule to override the foundry…
jhilaire-circle Dec 20, 2024
6c405f1
STABLE-7871: (Part 1) Audit fixes (#51)
ams9198 Dec 23, 2024
88c699f
STABLE-7871 (Part 2): Update CCTPHookWrapper (#52)
ams9198 Jan 7, 2025
7d70310
STABLE-7178 (cont.): Bump TypedMemView to v2.1.2 (#54)
ams9198 Jan 7, 2025
8a25c1a
[STABLE-8131] Calculate tokenMessengerV2 proxy address instead of par…
dlee-circle Jan 15, 2025
8cf3673
STABLE-8092: Update deployment scripts to use CREATE2 for implementat…
ams9198 Jan 17, 2025
c0b9ea7
[Untracked] Copyright and security file (#59)
grantmike Jan 23, 2025
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
13 changes: 13 additions & 0 deletions .github/workflows/ci-olympix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Olympix Scan"
on:
pull_request:
branches: [ "master" ]
workflow_dispatch:
schedule:
- cron: '31 14 * * 1' # Every Monday 2:31PM UTC

jobs:
run_olympix:
if: ${{ github.repository_owner == 'circlefin' }}
uses: circlefin/security-seceng-templates/.github/workflows/olympix_scan.yml@v1

57 changes: 54 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
with:
submodules: 'true'

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Node
uses: actions/setup-node@v4

Expand All @@ -30,10 +35,56 @@ jobs:
- name: Run Integration Tests
run: make anvil-test

- name: Run Slither
uses: crytic/[email protected]
- name: Run v2 Integration Tests
run: make anvil-test-v2

analyze-message-transmitter:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Set up Python
uses: actions/setup-python@v5
with:
fail-on: none
python-version: '3.10'

- name: Run Static Analysis on Message Transmitter
run: make analyze-message-transmitter

analyze-message-transmitter-v2:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Run Static Analysis on Message Transmitter V2
run: make analyze-message-transmitter-v2

analyze-token-messenger-minter:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Run Static Analysis on Token Messenger Minter
run: make analyze-token-messenger-minter

scan:
needs: lint-and-test
Expand Down
22 changes: 12 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"editor.formatOnSave": true,
"solidity.compilerOptimization": 200,
"solidity.enabledAsYouTypeCompilationErrorCheck": true,
"solidity.compileUsingRemoteVersion": "v0.7.6+commit.7338295f",
"solidity.formatter": "prettier",
"solidity.linter": "solhint",
"solidity.validationDelay": 1500,
"[solidity]": {
"editor.tabSize": 4,
}
"editor.formatOnSave": true,
"solidity.compilerOptimization": 200,
"solidity.enabledAsYouTypeCompilationErrorCheck": true,
"solidity.compileUsingRemoteVersion": "v0.7.6+commit.7338295f",
"solidity.formatter": "prettier",
"solidity.linter": "solhint",
"solidity.validationDelay": 1500,
"[solidity]": {
"editor.tabSize": 4,
},
"security.olympix.project.includePath": "/src",
"security.olympix.project.testsPath": "/test"
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG FOUNDRY_VERSION=nightly-3fa02706ca732c994715ba42d923605692062375
# Use fixed foundry image

FROM ghcr.io/foundry-rs/foundry:nightly-4a8c7d0e26a1befa526222e22737740f80a7f1c5
FROM ghcr.io/foundry-rs/foundry:${FOUNDRY_VERSION}

# Copy our source code into the container
WORKDIR /app
Expand Down
69 changes: 60 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,59 @@ build:
test:
@${FOUNDRY} "forge test -vv"

simulate:
forge script scripts/deploy.s.sol:DeployScript --rpc-url ${RPC_URL} --sender ${SENDER}
simulate-deploy:
forge script scripts/v1/deploy.s.sol:DeployScript --rpc-url ${RPC_URL} --sender ${SENDER}

deploy:
forge script scripts/deploy.s.sol:DeployScript --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast
forge script scripts/v1/deploy.s.sol:DeployScript --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast

simulate-deploy-implementations-v2:
forge script scripts/v2/DeployImplementationsV2.s.sol:DeployImplementationsV2Script --rpc-url ${RPC_URL} --sender ${SENDER}

deploy-implementations-v2:
forge script scripts/v2/DeployImplementationsV2.s.sol:DeployImplementationsV2Script --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast

simulate-deploy-create2-factory:
forge script scripts/DeployCreate2Factory.s.sol:DeployCreate2FactoryScript --rpc-url ${RPC_URL} --sender ${SENDER}

deploy-create2-factory:
forge script scripts/DeployCreate2Factory.s.sol:DeployCreate2FactoryScript --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast

simulate-deploy-proxies-v2:
forge script scripts/v2/DeployProxiesV2.s.sol:DeployProxiesV2Script --rpc-url ${RPC_URL} --sender ${SENDER}

deploy-proxies-v2:
forge script scripts/v2/DeployProxiesV2.s.sol:DeployProxiesV2Script --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast

simulate-setup-remote-resources-v2:
forge script scripts/v2/SetupRemoteResourcesV2.s.sol:SetupRemoteResourcesV2Script --rpc-url ${RPC_URL} --sender ${SENDER}

setup-remote-resources-v2:
forge script scripts/v2/SetupRemoteResourcesV2.s.sol:SetupRemoteResourcesV2Script --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast

simulate-rotate-keys-v2:
forge script scripts/v2/RotateKeysV2.s.sol:RotateKeysV2Script --rpc-url ${RPC_URL} --sender ${SENDER}

rotate-keys-v2:
forge script scripts/v2/RotateKeysV2.s.sol:RotateKeysV2Script --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast

simulate-deploy-address-utils-external:
forge script scripts/v2/DeployAddressUtilsExternal.s.sol:DeployAddressUtilsExternalScript --rpc-url ${RPC_URL} --sender ${SENDER}

deploy-address-utils-external:
forge script scripts/v2/DeployAddressUtilsExternal.s.sol:DeployAddressUtilsExternalScript --rpc-url ${RPC_URL} --sender ${SENDER} --broadcast

anvil:
docker rm -f anvil || true
@${ANVIL} "anvil --host 0.0.0.0 -a 13 --code-size-limit 250000"
@${ANVIL} "anvil --host 0.0.0.0 -a 13 --code-size-limit 250000"

anvil-test: anvil
pip3 install -r requirements.txt
python3 anvil/crosschainTransferIT.py
python anvil/crosschainTransferIT.py

anvil-test-v2: anvil
pip3 install -r requirements.txt
python anvil/crosschainTransferITV2.py

deploy-local:
@docker exec anvil forge script anvil/scripts/${contract}.s.sol:${contract}Script --rpc-url http://localhost:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast
Expand All @@ -31,10 +71,21 @@ cast-call:

cast-send:
@docker exec anvil cast send ${contract_address} "${function}" --rpc-url http://localhost:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

clean:
@${FOUNDRY} "forge clean"

analyze:
pip3 install -r requirements.txt
slither .
analyze-message-transmitter:
pip3 install mythril==0.24.8
myth -v4 analyze src/MessageTransmitter.sol --solc-json mythril.config.json --solv 0.7.6

analyze-message-transmitter-v2:
pip3 install mythril==0.24.8
myth -v4 analyze src/v2/MessageTransmitterV2.sol --solc-json mythril.config.json --solv 0.7.6

analyze-token-messenger-minter:
pip3 install mythril==0.24.8
myth -v4 analyze src/TokenMessenger.sol --solc-json mythril.config.json --solv 0.7.6
myth -v4 analyze src/TokenMinter.sol --solc-json mythril.config.json --solv 0.7.6
myth -v4 analyze src/v2/TokenMessengerV2.sol --solc-json mythril.config.json --solv 0.7.6
myth -v4 analyze src/v2/TokenMinterV2.sol --solc-json mythril.config.json --solv 0.7.6
Loading
Loading