From 7dfa6bf8062e09a4cf7d0c802f5336431142500e Mon Sep 17 00:00:00 2001 From: Karim Date: Thu, 30 May 2024 17:26:30 +0100 Subject: [PATCH] Minor audit fixes (#245) * Minor fixes * Replace `Ownable` with `Ownable2StepUpgradeable` --- erc20-bridge-token/contracts/BridgeToken.sol | 4 ++-- erc20-bridge-token/contracts/BridgeTokenFactory.sol | 2 +- erc20-bridge-token/contracts/ProofConsumer.sol | 2 -- erc20-bridge-token/contracts/SelectivePausableUpgradable.sol | 2 -- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/erc20-bridge-token/contracts/BridgeToken.sol b/erc20-bridge-token/contracts/BridgeToken.sol index 91968a38..51cec0fb 100644 --- a/erc20-bridge-token/contracts/BridgeToken.sol +++ b/erc20-bridge-token/contracts/BridgeToken.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.24; import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; @@ -10,7 +10,7 @@ contract BridgeToken is Initializable, UUPSUpgradeable, ERC20Upgradeable, - OwnableUpgradeable + Ownable2StepUpgradeable { string private _name; string private _symbol; diff --git a/erc20-bridge-token/contracts/BridgeTokenFactory.sol b/erc20-bridge-token/contracts/BridgeTokenFactory.sol index e9f2e726..a602f12c 100644 --- a/erc20-bridge-token/contracts/BridgeTokenFactory.sol +++ b/erc20-bridge-token/contracts/BridgeTokenFactory.sol @@ -184,7 +184,7 @@ contract BridgeTokenFactory is function withdraw( string memory token, - uint256 amount, + uint128 amount, string memory recipient ) external whenNotPaused(PAUSED_WITHDRAW) { _checkWhitelistedToken(token, msg.sender); diff --git a/erc20-bridge-token/contracts/ProofConsumer.sol b/erc20-bridge-token/contracts/ProofConsumer.sol index 050efd69..5e3a8a8a 100644 --- a/erc20-bridge-token/contracts/ProofConsumer.sol +++ b/erc20-bridge-token/contracts/ProofConsumer.sol @@ -1,8 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.24; -import "@openzeppelin/contracts/access/Ownable.sol"; - import "rainbow-bridge-sol/nearprover/contracts/INearProver.sol"; import "rainbow-bridge-sol/nearprover/contracts/ProofDecoder.sol"; import "rainbow-bridge-sol/nearbridge/contracts/Borsh.sol"; diff --git a/erc20-bridge-token/contracts/SelectivePausableUpgradable.sol b/erc20-bridge-token/contracts/SelectivePausableUpgradable.sol index 959c5c75..f1f5532b 100644 --- a/erc20-bridge-token/contracts/SelectivePausableUpgradable.sol +++ b/erc20-bridge-token/contracts/SelectivePausableUpgradable.sol @@ -38,8 +38,6 @@ abstract contract SelectivePausableUpgradable is Initializable, ContextUpgradeab */ event Paused(address account, uint flags); - uint private _pausedFlags; - /** * @dev Initializes the contract in unpaused state. */