Skip to content

Commit

Permalink
Merge pull request #68 from The-Poolz/issue-66
Browse files Browse the repository at this point in the history
add latest openzeppelin support
  • Loading branch information
YouStillAlive authored Jun 27, 2024
2 parents 29c41e4 + 135f22e commit 5c188d5
Show file tree
Hide file tree
Showing 7 changed files with 6,146 additions and 9,658 deletions.
2 changes: 1 addition & 1 deletion contracts/Vault/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ contract Vault is IVault, ERC20Helper {

function withdraw(address to, uint _amount) external override onlyManager {
require(tokenBalance() >= _amount, "Vault: Not enough balance");
TransferToken(tokenAddress, to, _amount);
transferToken(IERC20(tokenAddress), to, _amount);
}
}
3 changes: 3 additions & 0 deletions contracts/VaultManager/SignCheck.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import "@ironblocks/firewall-consumer/contracts/FirewallConsumer.sol";

abstract contract SignCheck is FirewallConsumer {
using ECDSA for bytes32;
using MessageHashUtils for bytes32;

mapping(address => uint) public nonces;

function _checkData(
Expand Down
4 changes: 3 additions & 1 deletion contracts/VaultManager/VaultManager.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./SignCheck.sol";
import "./VaultControl.sol";
import "@ironblocks/firewall-consumer/contracts/FirewallConsumer.sol";
Expand All @@ -11,6 +11,8 @@ contract VaultManager is
SignCheck,
ReentrancyGuard
{
constructor() Ownable(_msgSender()) {}

/*
* @dev Will be used by the Trustee to deposit tokens to the vault.
* @param _from Trustee is responsible to provide the correct _from address.
Expand Down
18 changes: 7 additions & 11 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ import 'solidity-coverage'

const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.19",
settings: {
evmVersion: "istanbul",
optimizer: {
enabled: true,
runs: 200,
},
},
version: "0.8.20",
settings: {
evmVersion: "istanbul",
optimizer: {
enabled: true,
runs: 200,
},
],
},
},
};

Expand Down
Loading

0 comments on commit 5c188d5

Please sign in to comment.