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

fix: spearbit audit #139

Merged
merged 57 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
85b002f
fix: refactor message hash (#106)
hexshire Jul 15, 2024
004baf3
fix: add blacklist check on target address (#109)
excaliborr Jul 16, 2024
12a94f0
fix: rename l2 contract (#110)
hexshire Jul 16, 2024
2c89ed6
feat: add burned amount value on migration complete event (#107)
0xDiscotech Jul 16, 2024
0461cab
fix: add events (#113)
hexshire Jul 17, 2024
58bef50
refactor: user nonces (#108)
0xDiscotech Jul 22, 2024
3c707af
fix: deploy through portal (#115)
excaliborr Jul 22, 2024
006a27c
fix: edgecase where user is blacklisted with an inflight message (#105)
excaliborr Jul 23, 2024
dc00d18
fix: deploy l2 implementation first (#114)
excaliborr Jul 23, 2024
5ec5891
fix: create2 address has dirty bytes (#117)
excaliborr Jul 24, 2024
d3d4aa4
fix: use encodeCall and docs (#116)
excaliborr Jul 24, 2024
7a4adfa
fix: bridged usdc token naming (#118)
excaliborr Jul 24, 2024
56f49a3
fix: address zero sanity check (#120)
excaliborr Jul 24, 2024
39a260f
fix: relay old failed messages after migration (#111)
hexshire Jul 25, 2024
a198ce8
fix: eip-712 compliance (#121)
excaliborr Jul 25, 2024
8a379d6
fix: event parameters (#124)
excaliborr Jul 26, 2024
601ec75
refactor: upgradeable adapters (#122)
0xDiscotech Jul 29, 2024
3bf97c5
refactor: blacklisted funds logic (#125)
hexshire Jul 29, 2024
35dccc4
docs: improve readme (#127)
excaliborr Jul 29, 2024
c868999
docs: enhance readme (#128)
0xDiscotech Jul 29, 2024
2fa5cda
chore: add initialize function on interface (#130)
0xDiscotech Jul 29, 2024
e63941d
chore: unify modifiers (#131)
0xDiscotech Jul 30, 2024
5b94ef9
chore: update deployment flow image (#132)
0xDiscotech Jul 30, 2024
d443487
fix: invariant tests (#129)
hexshire Jul 31, 2024
0155cca
test: add new logic test cases
hexshire Jul 31, 2024
74fa428
fix: refund blacklisted funds after migration test
hexshire Jul 31, 2024
a55f2cf
test: withdraw blacklisted funds
hexshire Jul 31, 2024
f8423b2
chore: add replayed funds sent back to l1 event on l2 adapter receive…
0xDiscotech Jul 31, 2024
19b88a2
fix: natspec and comments typos (#138)
0xDiscotech Aug 1, 2024
f84d3cf
Merge branch 'audit/spearbit' into fix/echidna
hexshire Aug 1, 2024
d2d9d5c
chore: script commands and arbitrary scripts (#137)
excaliborr Aug 1, 2024
456c933
Merge branch 'audit/spearbit' into fix/echidna
hexshire Aug 1, 2024
84aca83
test: fix test
hexshire Aug 1, 2024
014e0b7
Merge branch 'fix/echidna' of github.com:defi-wonderland/opUSDC into …
hexshire Aug 1, 2024
573513f
test: blacklisted funds on l2
hexshire Aug 1, 2024
b12bc4c
fix: prop 12 on l2
simon-something Aug 1, 2024
4e9ecf3
fix: constraints 12
simon-something Aug 1, 2024
e0d8ba9
test: fill empty catch branches
hexshire Aug 2, 2024
7df9958
fix: exclude l1 blacklist from l2 test
simon-something Aug 2, 2024
3af5731
fix: resume bridging when needed
simon-something Aug 2, 2024
65e6e5d
chore: typo
simon-something Aug 2, 2024
4ea10ee
fix: status for incoming msg
simon-something Aug 2, 2024
7ee93ff
feat: corpus (temp to migrate to corpus repo)
simon-something Aug 2, 2024
a0ff97a
fix: wrong selector count + corpus
simon-something Aug 2, 2024
e63459b
test: fix migrate to native test
hexshire Aug 2, 2024
f3b6eff
feat: symb exec prop 19 (#135)
simon-something Aug 2, 2024
1fd35f9
Merge branch 'audit/spearbit' into fix/echidna
hexshire Aug 2, 2024
eb625f9
test: add new logic tests to echidna (#136)
simon-something Aug 2, 2024
f95bd80
fix: var naming (#142)
excaliborr Aug 6, 2024
075b168
chore: cancel nonce event (#143)
excaliborr Aug 7, 2024
8efdc98
chore: naming convention changed (#144)
excaliborr Aug 7, 2024
79f128e
docs: deploying & migrating section (#141)
excaliborr Aug 7, 2024
71ac5a2
docs: needed items from circle at migration (#145)
excaliborr Aug 8, 2024
2a628f7
docs: update readme (#147)
zainbacchus Aug 9, 2024
174be47
docs: spearbit report (#148)
excaliborr Aug 13, 2024
8ed9c12
fix: ci (#149)
excaliborr Aug 13, 2024
859db9d
fix: report (#150)
excaliborr Aug 13, 2024
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Bridged USDC Standard for the OP Stack

> ⚠️ This code has not been audited yet and is not production ready at this time, tread with caution.

USDC is one of the most bridged assets across the crypto ecosystem, and USDC is often bridged to new chains prior to any action from Circle. This can create a challenge when Bridged USDC achieves substantial marketshare, but Native USDC is preferred by the ecosystem, leading to fragmentation between multiple representations of USDC. Circle introduced the (Bridged USDC Standard)[https://www.circle.com/blog/bridged-usdc-standard] to ensure that chains can easily deploy a form of USDC that is capable of being upgraded in-place by Circle to Native USDC, if and when appropriate, and prevent the fragmentation problem.
USDC is one of the most bridged assets across the crypto ecosystem, and USDC is often bridged to new chains prior to any action from Circle. This can create a challenge when Bridged USDC achieves substantial marketshare, but Native USDC is preferred by the ecosystem, leading to fragmentation between multiple representations of USDC. Circle introduced the [Bridged USDC Standard](https://www.circle.com/blog/bridged-usdc-standard) to ensure that chains can easily deploy a form of USDC that is capable of being upgraded in-place by Circle to Native USDC, if and when appropriate, and prevent the fragmentation problem.

Bridged USDC Standard for the OP Stack allows for an efficient and modular solution for expanding the Bridged USDC Standard across the Superchain ecosystem. Utilizing the cross chain messaging of the canonical OP Stack bridge the adapter allows for easy access to Bridged USDC liquidity across OP Stack chains.

Expand Down Expand Up @@ -32,6 +30,9 @@ _`L2OpUSDCBridgeAdapter`_ - Contract that allows for the transfer of USDC from t
![image](https://github.com/user-attachments/assets/291aae4c-e9fb-43a5-a11d-71bb3fc78311)


## Security
Bridged USDC Standard for the OP Stack has undergone audits from [Spearbit](https://spearbit.com/) and is recommended for production use. The audit report is available [here](./audits/spearbit.pdf).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Bridged USDC Standard for the OP Stack has undergone audits from [Spearbit](https://spearbit.com/) and is recommended for production use. The audit report is available [here](./audits/spearbit.pdf).
Bridged USDC Standard for the OP Stack has undergone an audit from [Spearbit](https://spearbit.com/) and is recommended for production use. The audit report is available [here](./audits/spearbit.pdf).


## Setup

1. Install Foundry by following the instructions from [their repository](https://github.com/foundry-rs/foundry#installation).
Expand Down
Binary file added audits/spearbit.pdf
Binary file not shown.
10 changes: 5 additions & 5 deletions test/utils/SigUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ contract SigUtils {
* @param _message The bridge message struct to hash
* @return _hash The hash of the bridge message struct
*/
function getTypedBridgeMessageHash(IOpUSDCBridgeAdapter.BridgeMessage memory _message)
public
view
returns (bytes32 _hash)
{
// forgefmt: disable-start
function getTypedBridgeMessageHash(
IOpUSDCBridgeAdapter.BridgeMessage memory _message
) public view returns (bytes32 _hash) {
_hash = keccak256(abi.encodePacked('\x19\x01', _DOMAIN_SEPARATOR, getBridgeMessageHash(_message)));
}
// forgefmt: disable-end

/**
* @notice Hashes the bridge message struct
Expand Down