Skip to content

remove token from Enter #47

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

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
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
24 changes: 11 additions & 13 deletions src/Passage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ contract Passage {
/// @notice Thrown when attempting to withdraw funds if not withdrawal admin.
error OnlyWithdrawalAdmin();

/// @notice Emitted when tokens enter the rollup.
/// @param token - The address of the token entering the rollup.
/// @param rollupRecipient - The recipient of the token on the rollup.
/// @param amount - The amount of the token entering the rollup.
event Enter(uint256 indexed rollupChainId, address indexed token, address indexed rollupRecipient, uint256 amount);
/// @notice Emitted when Ether enters the rollup.
/// @param rollupRecipient - The recipient of Ether on the rollup.
/// @param amount - The amount of Ether entering the rollup.
event Enter(uint256 indexed rollupChainId, address indexed rollupRecipient, uint256 amount);

/// @notice Emitted when the admin withdraws tokens from the contract.
event Withdrawal(address indexed token, address indexed recipient, uint256 amount);
Expand All @@ -41,19 +40,18 @@ contract Passage {
enter(defaultRollupChainId, msg.sender);
}

/// @notice Allows native Ether to enter the rollup.
/// @param rollupRecipient - The recipient of the Ether on the rollup.
/// @custom:emits Enter indicating the amount of Ether to mint on the rollup & its recipient.
function enter(address rollupRecipient) public payable {
enter(defaultRollupChainId, rollupRecipient);
}

/// @notice Allows native Ether to enter the rollup.
/// @param rollupChainId - The rollup chain to enter.
/// @param rollupRecipient - The recipient of the Ether on the rollup.
/// @custom:emits Enter indicating the amount of Ether to mint on the rollup & its recipient.
function enter(uint256 rollupChainId, address rollupRecipient) public payable {
emit Enter(rollupChainId, address(0), rollupRecipient, msg.value);
emit Enter(rollupChainId, rollupRecipient, msg.value);
}

/// @notice Allows native Ether to enter the default rollup.
/// @dev see `enter` above for docs.
function enter(address rollupRecipient) external payable {
enter(defaultRollupChainId, rollupRecipient);
}

/// @notice Allows the admin to withdraw ETH or ERC20 tokens from the contract.
Expand Down