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

[Cantina Finding #4]Implemented the changes suggested as general informational issues #167

Open
wants to merge 3 commits into
base: base-bridge
Choose a base branch
from

Conversation

voith
Copy link
Member

@voith voith commented Feb 23, 2025

This change is Reviewable

address _sender
) CCIPReceiver(_router) {
mainnetChainSelector = _mainnetChainSelector;
/// @dev Constructor to initialize the BaseGovernanceReceiver contract.
Copy link

Choose a reason for hiding this comment

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

it's still referring to the BaseGovernanceReceiver while it should say GovernanceReceiver

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I'll fix this 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

done

* @param _receiver The address of the receiver contract on the destination chain.
* @dev Only the Timelock contract can call this function.
*/
/// @inheritdoc IGovernanceCCIPRelay
function setDestinationReceiver(address _receiver) external onlyTimeLock {
Copy link

Choose a reason for hiding this comment

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

@voith it's not early returning as suggested in the finding https://cantina.xyz/code/8b6d2575-95bc-4380-8f2a-314e44776822/findings/4

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets discuss this in #169 (comment)

/// @notice The chain selector for Ethereum Mainnet.
uint64 public mainnetChainSelector;
/// @inheritdoc IGovernanceCCIPReceiver
uint64 public constant mainnetChainSelector = 5009297550715157269;
Copy link

Choose a reason for hiding this comment

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

@voith this is a constant, replace the name in uppercase following the Solidity style recommendations

Copy link
Member Author

Choose a reason for hiding this comment

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

done

address public mainnetSender;
contract GovernanceCCIPReceiver is IGovernanceCCIPReceiver, CCIPReceiver {
/// @inheritdoc IGovernanceCCIPReceiver
address public immutable mainnetSender;
Copy link

Choose a reason for hiding this comment

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

@voith this is an immutable variable, replace the name in uppercase following the Solidity style recommendations

Copy link
Member Author

Choose a reason for hiding this comment

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

done

/// @notice The address of the Timelock contract that can call this contract.
address public timelock;
/// @inheritdoc IGovernanceCCIPRelay
address public immutable timelock;
Copy link

Choose a reason for hiding this comment

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

@voith this is an immutable variable, replace the name in uppercase following the Solidity style recommendations

Copy link
Member Author

Choose a reason for hiding this comment

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

done

* @param _destinationChainSelector The chain selector for the destination chain.
* @param _receiver The address of the receiver contract on the destination chain.
*/
/// @dev Constructor to initialize the GovernanceRelay contract.
Copy link

Choose a reason for hiding this comment

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

@voith the contract name is GovernanceCCIPRelay and not GovernanceRelay

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -15,7 +15,7 @@ contract GovernanceCCIPRelay is IGovernanceCCIPRelay {
IRouterClient public immutable ccipRouter;
Copy link

Choose a reason for hiding this comment

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

@voith this one is also immutable so it should be renamed CCIP_ROUTER

Copy link
Member Author

Choose a reason for hiding this comment

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

Lol, I thought you left that intentionally because it makes this call ccipRouter.ccipSend.
I've never seen CCIP_ROUTER .ccipSend before. But I'm no style guide expert, so I'll fix this.

Copy link

Choose a reason for hiding this comment

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

Usually, it's quite useful to follow that style guide because you visually see immediately whether something can change or not.

I don't see anything strange on my side to see constant/immutable variables (defined as contracts) that perform function's calls.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

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.

2 participants