diff --git a/helix-contract/contracts/ln/HelixLnBridgeV3.sol b/helix-contract/contracts/ln/HelixLnBridgeV3.sol index 809a1a1..65b3b8a 100644 --- a/helix-contract/contracts/ln/HelixLnBridgeV3.sol +++ b/helix-contract/contracts/ln/HelixLnBridgeV3.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.17; import "@zeppelin-solidity/contracts/proxy/utils/Initializable.sol"; import "./base/LnBridgeSourceV3.sol"; import "./base/LnBridgeTargetV3.sol"; -import "./interface/ILowLevelMessager.sol"; +import "../interfaces/IMessager.sol"; contract HelixLnBridgeV3 is Initializable, LnBridgeSourceV3, LnBridgeTargetV3 { struct MessagerService { diff --git a/helix-contract/contracts/ln/base/LnBridgeSourceV3.sol b/helix-contract/contracts/ln/base/LnBridgeSourceV3.sol index ea07ae2..69de8a2 100644 --- a/helix-contract/contracts/ln/base/LnBridgeSourceV3.sol +++ b/helix-contract/contracts/ln/base/LnBridgeSourceV3.sol @@ -2,13 +2,13 @@ pragma solidity ^0.8.17; import "@zeppelin-solidity/contracts/security/Pausable.sol"; -import "./LnAccessController.sol"; -import "./TokenTransferHelper.sol"; +import "../../utils/AccessController.sol"; +import "../../utils/TokenTransferHelper.sol"; /// @title LnBridgeSourceV3 /// @notice LnBridgeSourceV3 is a contract to help user lock token and then trigger remote chain relay /// @dev See https://github.com/helix-bridge/contracts/tree/master/helix-contract -contract LnBridgeSourceV3 is Pausable, LnAccessController { +contract LnBridgeSourceV3 is Pausable, AccessController { uint256 constant public SLASH_EXPIRE_TIME = 60 * 60; uint256 constant public MAX_TRANSFER_AMOUNT = type(uint112).max; // liquidity fee base rate diff --git a/helix-contract/contracts/ln/base/TokenTransferHelper.sol b/helix-contract/contracts/ln/base/TokenTransferHelper.sol deleted file mode 100644 index bd94b59..0000000 --- a/helix-contract/contracts/ln/base/TokenTransferHelper.sol +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.17; - -import "@zeppelin-solidity/contracts/token/ERC20/IERC20.sol"; - -library TokenTransferHelper { - function safeTransfer( - address token, - address receiver, - uint256 amount - ) internal { - (bool success, bytes memory data) = token.call(abi.encodeWithSelector( - IERC20.transfer.selector, - receiver, - amount - )); - require(success && (data.length == 0 || abi.decode(data, (bool))), "lnBridgeHelper:transfer token failed"); - } - - function safeTransferFrom( - address token, - address sender, - address receiver, - uint256 amount - ) internal { - (bool success, bytes memory data) = token.call(abi.encodeWithSelector( - IERC20.transferFrom.selector, - sender, - receiver, - amount - )); - require(success && (data.length == 0 || abi.decode(data, (bool))), "lnBridgeHelper:transferFrom token failed"); - } - - function safeTransferNative( - address receiver, - uint256 amount - ) internal { - (bool success,) = payable(receiver).call{value: amount}(""); - require(success, "lnBridgeHelper:transfer native token failed"); - } -} -