Skip to content

Commit

Permalink
chore: revert format
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Dec 5, 2024
1 parent 7cf5d7a commit bd1aac2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 56 deletions.
43 changes: 11 additions & 32 deletions src/mainchain/MainchainGatewayV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ contract MainchainGatewayV3 is
}
}

function initializeV2(
address bridgeManagerContract
) external reinitializer(2) {
function initializeV2(address bridgeManagerContract) external reinitializer(2) {
_setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);
}

Expand All @@ -132,19 +130,14 @@ contract MainchainGatewayV3 is
_totalOperatorWeight = totalWeight;
}

function initializeV4(
address payable /* wethUnwrapper_ */
) external reinitializer(4) {
/**
* @deprecated
function initializeV4(address payable /* wethUnwrapper_ */) external reinitializer(4) {
/** @deprecated
*
* wethUnwrapper = WethUnwrapper(wethUnwrapper_);
*/
}

function initializeV5(
address migrator
) external reinitializer(5) {
function initializeV5(address migrator) external reinitializer(5) {
_setWrappedNativeToken(address(wrappedNativeToken));
_setMigrator(migrator);
}
Expand All @@ -164,18 +157,14 @@ contract MainchainGatewayV3 is
/**
* @inheritdoc IMainchainGatewayV3
*/
function setWrappedNativeTokenContract(
IWETH _wrappedToken
) external virtual onlyProxyAdmin {
function setWrappedNativeTokenContract(IWETH _wrappedToken) external virtual onlyProxyAdmin {
_setWrappedNativeTokenContract(_wrappedToken);
}

/**
* @inheritdoc IMainchainGatewayV3
*/
function requestDepositFor(
Transfer.Request calldata _request
) external payable virtual whenNotPaused {
function requestDepositFor(Transfer.Request calldata _request) external payable virtual whenNotPaused {
_requestDepositFor(_request, msg.sender);
}

Expand All @@ -189,9 +178,7 @@ contract MainchainGatewayV3 is
/**
* @inheritdoc IMainchainGatewayV3
*/
function unlockWithdrawal(
Transfer.Receipt calldata receipt
) external onlyRole(WITHDRAWAL_UNLOCKER_ROLE) {
function unlockWithdrawal(Transfer.Receipt calldata receipt) external onlyRole(WITHDRAWAL_UNLOCKER_ROLE) {
bytes32 _receiptHash = receipt.hash();
if (withdrawalHash[receipt.id] != receipt.hash()) {
revert ErrInvalidReceipt();
Expand Down Expand Up @@ -250,9 +237,7 @@ contract MainchainGatewayV3 is
/**
* @inheritdoc IMainchainGatewayV3
*/
function getRoninToken(
address mainchainToken
) public view returns (MappedToken memory token) {
function getRoninToken(address mainchainToken) public view returns (MappedToken memory token) {
token = _roninToken[mainchainToken];
if (token.tokenAddr == address(0)) revert ErrUnsupportedToken();
}
Expand Down Expand Up @@ -457,9 +442,7 @@ contract MainchainGatewayV3 is
* Emits the `WrappedNativeTokenContractUpdated` event.
*
*/
function _setWrappedNativeTokenContract(
IWETH _wrappedToken
) internal {
function _setWrappedNativeTokenContract(IWETH _wrappedToken) internal {
wrappedNativeToken = _wrappedToken;
emit WrappedNativeTokenContractUpdated(_wrappedToken);
}
Expand Down Expand Up @@ -496,9 +479,7 @@ contract MainchainGatewayV3 is
/**
* @dev Returns the weight of an address.
*/
function _getWeight(
address addr
) internal view returns (uint256) {
function _getWeight(address addr) internal view returns (uint256) {
return _operatorWeight[addr];
}

Expand Down Expand Up @@ -557,9 +538,7 @@ contract MainchainGatewayV3 is
return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;
}

function supportsInterface(
bytes4 interfaceId
) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) {
function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) {
return
interfaceId == type(IMainchainGatewayV3).interfaceId || interfaceId == type(IBridgeManagerCallback).interfaceId || super.supportsInterface(interfaceId);
}
Expand Down
32 changes: 8 additions & 24 deletions src/ronin/gateway/RoninGatewayV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ contract RoninGatewayV3 is
delete ____deprecated2;
}

function initializeV3(
address bridgeAdmin
) external reinitializer(3) {
function initializeV3(address bridgeAdmin) external reinitializer(3) {
_setContract(ContractType.BRIDGE_MANAGER, bridgeAdmin);
}

Expand All @@ -152,18 +150,14 @@ contract RoninGatewayV3 is
/**
* @inheritdoc IRoninGatewayV3
*/
function depositFor(
Transfer.Receipt calldata _receipt
) external whenNotPaused onlyBridgeOperator {
function depositFor(Transfer.Receipt calldata _receipt) external whenNotPaused onlyBridgeOperator {
_depositFor(_receipt, msg.sender, minimumVoteWeight());
}

/**
* @inheritdoc IRoninGatewayV3
*/
function tryBulkAcknowledgeMainchainWithdrew(
uint256[] calldata _withdrawalIds
) external onlyBridgeOperator returns (bool[] memory _executedReceipts) {
function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) external onlyBridgeOperator returns (bool[] memory _executedReceipts) {
address governor = msg.sender;
uint256 minVoteWeight = minimumVoteWeight();

Expand Down Expand Up @@ -198,9 +192,7 @@ contract RoninGatewayV3 is
/**
* @inheritdoc IRoninGatewayV3
*/
function tryBulkDepositFor(
Transfer.Receipt[] calldata receipts
) external whenNotPaused onlyBridgeOperator returns (bool[] memory _executedReceipts) {
function tryBulkDepositFor(Transfer.Receipt[] calldata receipts) external whenNotPaused onlyBridgeOperator returns (bool[] memory _executedReceipts) {
uint length = receipts.length;
_executedReceipts = new bool[](length);
uint256 minVoteWeight = minimumVoteWeight();
Expand Down Expand Up @@ -239,9 +231,7 @@ contract RoninGatewayV3 is
/**
* @inheritdoc IRoninGatewayV3
*/
function requestWithdrawalSignatures(
uint256 _withdrawalId
) external whenNotPaused {
function requestWithdrawalSignatures(uint256 _withdrawalId) external whenNotPaused {
if (mainchainWithdrew(_withdrawalId)) revert ErrWithdrawnOnMainchainAlready();

Transfer.Receipt memory _receipt = withdrawal[_withdrawalId];
Expand Down Expand Up @@ -339,9 +329,7 @@ contract RoninGatewayV3 is
/**
* @inheritdoc IRoninGatewayV3
*/
function mainchainWithdrew(
uint256 _withdrawalId
) public view returns (bool) {
function mainchainWithdrew(uint256 _withdrawalId) public view returns (bool) {
return mainchainWithdrewVote[_withdrawalId].status == VoteStatus.Executed;
}

Expand Down Expand Up @@ -559,15 +547,11 @@ contract RoninGatewayV3 is
/**
* @dev Returns minimum trusted vote weight.
*/
function _minimumTrustedVoteWeight(
uint256 _totalTrustedWeight
) internal view virtual returns (uint256) {
function _minimumTrustedVoteWeight(uint256 _totalTrustedWeight) internal view virtual returns (uint256) {
return (_trustedNum * _totalTrustedWeight + _trustedDenom - 1) / _trustedDenom;
}

function supportsInterface(
bytes4 interfaceId
) public view override(AccessControlEnumerable, ERC1155Receiver) returns (bool) {
function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, ERC1155Receiver) returns (bool) {
return AccessControlEnumerable.supportsInterface(interfaceId) || ERC1155Receiver.supportsInterface(interfaceId);
}
}

0 comments on commit bd1aac2

Please sign in to comment.