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: potential second minter blocks burnLockedUSDC #93

Merged
merged 3 commits into from
Jul 3, 2024

Conversation

excaliborr
Copy link
Contributor

🤖 Linear

Closes OPT-XXX

Comment on lines 40 to 49
bytes memory _cachedBytes = abi.encode(_usdcImplementation);
_cachedBytes = bytes.concat(USDC_PROXY_CREATION_CODE, _cachedBytes);
(address _usdcProxy) = _deployCreate(_cachedBytes);
emit USDCProxyDeployed(_usdcProxy);

// Deploy L2 Adapter
address _l2Messenger = 0x4200000000000000000000000000000000000007;
bytes memory _l2AdapterCArgs = abi.encode(_usdcProxy, _l2Messenger, _l1Adapter, _l2AdapterOwner);
bytes memory _l2AdapterInitCode = bytes.concat(type(L2OpUSDCBridgeAdapter).creationCode, _l2AdapterCArgs);
(address _l2Adapter) = _deployCreate(_l2AdapterInitCode);
_cachedBytes = abi.encode(_usdcProxy, _l2Messenger, _l1Adapter, _l2AdapterOwner);
_cachedBytes = bytes.concat(type(L2OpUSDCBridgeAdapter).creationCode, _cachedBytes);
(address _l2Adapter) = _deployCreate(_cachedBytes);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these changes? Don't you feel the readability gets a bit worse?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah this was not supposed to get pushed, I was testing something

Copy link
Member

Choose a reason for hiding this comment

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

oh! I kinda like it.

adapter.forTest_setBurnCaller(_circle);
adapter.forTest_setMessengerStatus(IL1OpUSDCBridgeAdapter.Status.Deprecated);

vm.mockCall(_usdc, abi.encodeWithSignature('burn(address,uint256)', address(adapter), _balanceOf), abi.encode(true));
Copy link
Contributor

Choose a reason for hiding this comment

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

waring, could you add a solhint ignore?

adapter.forTest_setBurnCaller(_circle);
adapter.forTest_setMessengerStatus(IL1OpUSDCBridgeAdapter.Status.Deprecated);

vm.mockCall(_usdc, abi.encodeWithSignature('burn(address,uint256)', address(adapter), _balanceOf), abi.encode(true));
Copy link
Member

Choose a reason for hiding this comment

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

⚠️linter

Copy link
Contributor

@0xDiscotech 0xDiscotech left a comment

Choose a reason for hiding this comment

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

Good job!

@excaliborr excaliborr merged commit e20a7d8 into dev Jul 3, 2024
4 checks passed
@excaliborr excaliborr deleted the fix/burn-amount-check branch July 3, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants