Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions src/CustomToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (CustomToken.sol)

pragma solidity 0.8.29;

// Main functionality.
Expand All @@ -10,7 +12,7 @@ import {Initializable} from "@openzeppelin-contracts-upgradeable/proxy/utils/Ini
import {AccessControlUpgradeable} from "@openzeppelin-contracts-upgradeable/access/AccessControlUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin-contracts-upgradeable/utils/PausableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin-contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import {IVersioned} from "./etc/IVersioned.sol";
import {Versioned} from "./etc/Versioned.sol";

/// @title Custom Token
/// @author See https://github.com/agglayer/vault-bridge
Expand All @@ -23,7 +25,7 @@ abstract contract CustomToken is
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC20PermitUpgradeable,
IVersioned
Versioned
{
/// @dev Storage of Custom Token contract.
/// @dev It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions when using with upgradeable contracts.
Expand Down Expand Up @@ -177,6 +179,7 @@ abstract contract CustomToken is
onlyLxlyBridgeAndNativeConverter
nonReentrant
{
// @remind Redocument.
// When we migrate backing to Lx, we end up sending tokens to address(0) here.
// These need to be claimable so the bridge accounting is correct and we allow it here by not reverting.
if (account == address(0)) return;
Expand Down
13 changes: 4 additions & 9 deletions src/MigrationManager.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (MigrationManager.sol)

pragma solidity 0.8.29;

/// @dev Main functionality.
Expand All @@ -10,7 +12,7 @@ import {AccessControlUpgradeable} from "@openzeppelin-contracts-upgradeable/acce
import {PausableUpgradeable} from "@openzeppelin-contracts-upgradeable/utils/PausableUpgradeable.sol";
import {ReentrancyGuardTransientUpgradeable} from
"@openzeppelin-contracts-upgradeable/utils/ReentrancyGuardTransientUpgradeable.sol";
import {IVersioned} from "./etc/IVersioned.sol";
import {Versioned} from "./etc/Versioned.sol";

/// @dev Libraries.
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand All @@ -32,7 +34,7 @@ contract MigrationManager is
AccessControlUpgradeable,
PausableUpgradeable,
ReentrancyGuardTransientUpgradeable,
IVersioned
Versioned
{
// Libraries.
using SafeERC20 for IERC20;
Expand Down Expand Up @@ -300,11 +302,4 @@ contract MigrationManager is
function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) nonReentrant {
_unpause();
}

// -----================= ::: INFO ::: =================-----

/// @inheritdoc IVersioned
function version() external pure returns (string memory) {
return "0.5.0";
}
}
6 changes: 4 additions & 2 deletions src/NativeConverter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (NativeConverter.sol)

pragma solidity 0.8.29;

// Other functionality.
Expand All @@ -7,7 +9,7 @@ import {AccessControlUpgradeable} from "@openzeppelin-contracts-upgradeable/acce
import {PausableUpgradeable} from "@openzeppelin-contracts-upgradeable/utils/PausableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin-contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import {ERC20PermitUser} from "./etc/ERC20PermitUser.sol";
import {IVersioned} from "./etc/IVersioned.sol";
import {Versioned} from "./etc/Versioned.sol";

// Libraries.
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand All @@ -31,7 +33,7 @@ abstract contract NativeConverter is
PausableUpgradeable,
ReentrancyGuardUpgradeable,
ERC20PermitUser,
IVersioned
Versioned
{
// Libraries.
using SafeERC20 for IERC20;
Expand Down
6 changes: 4 additions & 2 deletions src/VaultBridgeToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (VaultBridgeToken.sol)

pragma solidity 0.8.29;

// @remind UPDATE DOCUMENTATION.
Expand All @@ -16,7 +18,7 @@ import {PausableUpgradeable} from "@openzeppelin-contracts-upgradeable/utils/Pau
import {ReentrancyGuardTransientUpgradeable} from
"@openzeppelin-contracts-upgradeable/utils/ReentrancyGuardTransientUpgradeable.sol";
import {ERC20PermitUser} from "./etc/ERC20PermitUser.sol";
import {IVersioned} from "./etc/IVersioned.sol";
import {Versioned} from "./etc/Versioned.sol";

// Libraries.
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand Down Expand Up @@ -44,7 +46,7 @@ abstract contract VaultBridgeToken is
IERC4626,
ERC20PermitUpgradeable,
ERC20PermitUser,
IVersioned
Versioned
{
// Libraries.
using SafeERC20 for IERC20;
Expand Down
12 changes: 2 additions & 10 deletions src/VaultBridgeTokenInitializer.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (VaultBridgeTokenInitializer.sol)

pragma solidity 0.8.29;

// Main functionality.
import {IVaultBridgeTokenInitializer} from "./etc/IVaultBridgeTokenInitializer.sol";
import {VaultBridgeToken} from "./VaultBridgeToken.sol";

// Other functionality.
import {IVersioned} from "./etc/IVersioned.sol";

// Libraries.
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

Expand Down Expand Up @@ -92,11 +91,4 @@ contract VaultBridgeTokenInitializer is IVaultBridgeTokenInitializer, VaultBridg
IERC20(initParams.underlyingToken).forceApprove(initParams.yieldVault, type(uint256).max);
_approve(address(this), address(initParams.lxlyBridge), type(uint256).max);
}

// -----================= ::: INFO ::: =================-----

/// @inheritdoc IVersioned
function version() external pure returns (string memory) {
return "0.5.0";
}
}
12 changes: 2 additions & 10 deletions src/VaultBridgeTokenPart2.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (VaultBridgeTokenPart2.sol)

pragma solidity 0.8.29;

// Main functionality.
import {VaultBridgeToken} from "./VaultBridgeToken.sol";
import {IERC4626} from "@openzeppelin/contracts/interfaces/IERC4626.sol";

// Other functionality.
import {IVersioned} from "./etc/IVersioned.sol";

// Libraries.
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down Expand Up @@ -351,11 +350,4 @@ contract VaultBridgeTokenPart2 is VaultBridgeToken {
function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) nonReentrant {
_unpause();
}

// -----================= ::: INFO ::: =================-----

/// @inheritdoc IVersioned
function version() external pure override returns (string memory) {
return "0.5.0";
}
}
11 changes: 3 additions & 8 deletions src/custom-tokens/GenericCustomToken.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (custom-tokens/GenericCustomToken.sol)

pragma solidity 0.8.29;

// Main functionality.
import {CustomToken} from "../CustomToken.sol";

// Other functionality.
import {IVersioned} from "../etc/IVersioned.sol";
import {Versioned} from "../etc/Versioned.sol";

/// @title Generic Custom Token
/// @author See https://github.com/agglayer/vault-bridge
Expand All @@ -28,11 +30,4 @@ contract GenericCustomToken is CustomToken {
// Initialize the base implementation.
__CustomToken_init(owner_, name_, symbol_, originalUnderlyingTokenDecimals_, lxlyBridge_, nativeConverter_);
}

// -----================= ::: INFO ::: =================-----

/// @inheritdoc IVersioned
function version() external pure virtual returns (string memory) {
return "0.5.0";
}
}
11 changes: 3 additions & 8 deletions src/custom-tokens/GenericNativeConverter.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (custom-tokens/GenericNativeConverter.sol)

pragma solidity 0.8.29;

// Main functionality.
import {NativeConverter} from "../NativeConverter.sol";

// Other functionality.
import {IVersioned} from "../etc/IVersioned.sol";
import {Versioned} from "../etc/Versioned.sol";

/// @title Generic Native Converter
/// @author See https://github.com/agglayer/vault-bridge
Expand Down Expand Up @@ -39,11 +41,4 @@ contract GenericNativeConverter is NativeConverter {
migrationManager_
);
}

// -----================= ::: INFO ::: =================-----

/// @inheritdoc IVersioned
function version() external pure virtual returns (string memory) {
return "0.5.0";
}
}
8 changes: 2 additions & 6 deletions src/custom-tokens/WETH/WETH.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (custom-tokens/WETH/WETH.sol)

pragma solidity 0.8.29;

import {CustomToken} from "../../CustomToken.sol";
import {IWETH9} from "../../etc/IWETH9.sol";
import {IVersioned} from "../../etc/IVersioned.sol";
import {ILxLyBridge} from "../../etc/ILxLyBridge.sol";

/// @title WETH
Expand Down Expand Up @@ -95,9 +96,4 @@ contract WETH is CustomToken {
payable(msg.sender).transfer(value);
emit Withdrawal(msg.sender, value);
}

/// @inheritdoc IVersioned
function version() public pure returns (string memory) {
return "0.5.0";
}
}
8 changes: 2 additions & 6 deletions src/custom-tokens/WETH/WETHNativeConverter.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (custom-tokens/WETH/WETHNativeConverter.sol)

pragma solidity 0.8.29;

import {NativeConverter, Math} from "../../NativeConverter.sol";
import {WETH} from "./WETH.sol";
import {IVersioned} from "../../etc/IVersioned.sol";
import {MigrationManager} from "../../MigrationManager.sol";
import {ILxLyBridge} from "../../etc/ILxLyBridge.sol";

Expand Down Expand Up @@ -159,9 +160,4 @@ contract WETHNativeConverter is NativeConverter {
// Emit the event.
emit NonMigratableGasBackingPercentageSet(nonMigratableGasBackingPercentage_);
}

/// @inheritdoc IVersioned
function version() external pure virtual returns (string memory) {
return "0.5.0";
}
}
2 changes: 2 additions & 0 deletions src/custom-tokens/vbUSDC/VbUSDC.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbUSDC/VbUSDC.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/custom-tokens/vbUSDC/VbUSDCNativeConverter.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbUSDC/VbUSDCNativeConverter.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/custom-tokens/vbUSDS/VbUSDS.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbUSDS/VbUSDS.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/custom-tokens/vbUSDS/VbUSDSNativeConverter.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbUSDS/VbUSDSNativeConverter.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/custom-tokens/vbUSDT/VbUSDT.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbUSDT/VbUSDT.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/custom-tokens/vbUSDT/VbUSDTNativeConverter.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbUSDT/VbUSDTNativeConverter.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/custom-tokens/vbWBTC/VbWBTC.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbWBTC/VbWBTC.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/custom-tokens/vbWBTC/VbWBTCNativeConverter.sol.generic
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (custom-tokens/VbWBTC/VbWBTCNativeConverter.sol.generic)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
2 changes: 2 additions & 0 deletions src/etc/ERC20PermitUser.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (etc/ERC20PermitUser.sol)

pragma solidity 0.8.29;

/// @title ERC-20 Permit User
Expand Down
2 changes: 2 additions & 0 deletions src/etc/IBridgeMessageReceiver.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (etc/IBridgeMessageReceiver.sol)

pragma solidity 0.8.29;

/// @author See https://github.com/agglayer/vault-bridge
Expand Down
2 changes: 2 additions & 0 deletions src/etc/ILxLyBridge.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (etc/ILxLyBridge.sol)

pragma solidity 0.8.29;

/// @author See https://github.com/agglayer/vault-bridge
Expand Down
2 changes: 2 additions & 0 deletions src/etc/IVaultBridgeTokenInitializer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (etc/IVaultBridgeTokenInitializer.sol)

pragma solidity 0.8.29;

// Main functionality.
Expand Down
4 changes: 3 additions & 1 deletion src/etc/IWETH9.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.5.0) (etc/IWETH9.sol)

pragma solidity 0.8.29;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
Expand Down
8 changes: 6 additions & 2 deletions src/etc/IVersioned.sol → src/etc/Versioned.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// SPDX-License-Identifier: LicenseRef-PolygonLabs-Open-Attribution OR LicenseRef-PolygonLabs-Source-Available
// Vault Bridge (last updated v0.6.0) (etc/Versioned.sol)

pragma solidity 0.8.29;

/// @author See https://github.com/agglayer/vault-bridge
interface IVersioned {
abstract contract Versioned {
/// @notice The version of the contract.
function version() external pure returns (string memory);
function version() external pure returns (string memory) {
return "0.6.0";
}
}
Loading