From 60cc71cc144d21b86aeb24543b602367fb152c14 Mon Sep 17 00:00:00 2001 From: Matthew Krak Date: Tue, 10 Dec 2024 10:49:49 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Fix=20license=20in=20oft-evm=20f?= =?UTF-8?q?or=20MintBurnOFTAdapter=20and=20periphery=20(#1125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/brave-buckets-approve.md | 5 +++ .../oft-evm/contracts/MintBurnOFTAdapter.sol | 2 +- .../interfaces/IMintableBurnable.sol | 2 +- .../test/mocks/ElevatedMinterBurnerMock.sol | 1 + .../oft-evm/test/mocks/MintBurnERC20Mock.sol | 33 +++++++++++++++++-- 5 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .changeset/brave-buckets-approve.md diff --git a/.changeset/brave-buckets-approve.md b/.changeset/brave-buckets-approve.md new file mode 100644 index 000000000..5b9cc69b5 --- /dev/null +++ b/.changeset/brave-buckets-approve.md @@ -0,0 +1,5 @@ +--- +"@layerzerolabs/oft-evm": minor +--- + +changed license for MintBurnOFTAdapter and periphery contracts to MIT from UNLICENSED diff --git a/packages/oft-evm/contracts/MintBurnOFTAdapter.sol b/packages/oft-evm/contracts/MintBurnOFTAdapter.sol index 067b15646..518444f9a 100644 --- a/packages/oft-evm/contracts/MintBurnOFTAdapter.sol +++ b/packages/oft-evm/contracts/MintBurnOFTAdapter.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; // External imports diff --git a/packages/oft-evm/contracts/interfaces/IMintableBurnable.sol b/packages/oft-evm/contracts/interfaces/IMintableBurnable.sol index 43c5a9181..245a39b74 100644 --- a/packages/oft-evm/contracts/interfaces/IMintableBurnable.sol +++ b/packages/oft-evm/contracts/interfaces/IMintableBurnable.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: MIT pragma solidity ^0.8.22; /// @title Interface for mintable and burnable tokens diff --git a/packages/oft-evm/test/mocks/ElevatedMinterBurnerMock.sol b/packages/oft-evm/test/mocks/ElevatedMinterBurnerMock.sol index a334a7c3e..04225bc0c 100644 --- a/packages/oft-evm/test/mocks/ElevatedMinterBurnerMock.sol +++ b/packages/oft-evm/test/mocks/ElevatedMinterBurnerMock.sol @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/packages/oft-evm/test/mocks/MintBurnERC20Mock.sol b/packages/oft-evm/test/mocks/MintBurnERC20Mock.sol index 981217cce..4436b0a33 100644 --- a/packages/oft-evm/test/mocks/MintBurnERC20Mock.sol +++ b/packages/oft-evm/test/mocks/MintBurnERC20Mock.sol @@ -1,19 +1,46 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { IMintableBurnable } from "../../contracts/interfaces/IMintableBurnable.sol"; -// @dev WARNING: This is for testing purposes only +/** + * @title MintBurnERC20Mock + * + * @dev WARNING: This contract is for testing purposes only. + * In a production scenario, the `mint` and `burn` methods + * should be guarded by appropriate access control mechanisms. + */ contract MintBurnERC20Mock is ERC20, IMintableBurnable { + /// @notice Constructor to initialize the ERC20 token with a name and symbol. constructor(string memory name, string memory symbol) ERC20(name, symbol) {} + /** + * @notice Burns a specific amount of tokens from a given address. + * + * @dev WARNING: In production, this function should have access control. + * + * @param _from The address from which tokens will be burned. + * @param _amount The amount of tokens to burn. + * + * @return A boolean indicating the success of the burn operation. + */ function burn(address _from, uint256 _amount) external returns (bool) { _burn(_from, _amount); return true; } + /** + * @notice Mints a specific amount of tokens to a given address. + * + * @dev WARNING: In production, this function should have access control. + * + * @param _to The address to which tokens will be minted. + * @param _amount The amount of tokens to mint. + * + * @return A boolean indicating the success of the mint operation. + */ function mint(address _to, uint256 _amount) external returns (bool) { _mint(_to, _amount); return true;