From 0bcd55325ef4e24bd73bd2b1c1d46cabc8f1df82 Mon Sep 17 00:00:00 2001 From: Sir-Deon Date: Fri, 5 Apr 2024 11:53:13 +0100 Subject: [PATCH 1/4] worked on payment --- contracts/Treasury.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/Treasury.sol b/contracts/Treasury.sol index da00f31..be209d3 100644 --- a/contracts/Treasury.sol +++ b/contracts/Treasury.sol @@ -111,12 +111,12 @@ contract Treasury is ITreasury, AccessControl, ReentrancyGuard { } // Control functuons - function pauseVault() external nonReentrant { + function pauseTreasury() external nonReentrant { require(hasRole(ADMIN_ROLE, msg.sender), "Not admin"); paused = true; } - function unPauseVault() external nonReentrant { + function unPauseTreasury() external nonReentrant { require(hasRole(ADMIN_ROLE, msg.sender), "Not admin"); paused = false; } From 1b728db168a935f502e43d6f8276dee34186f38e Mon Sep 17 00:00:00 2001 From: Sir-Deon Date: Fri, 5 Apr 2024 11:53:28 +0100 Subject: [PATCH 2/4] worked on payment --- contracts/Treasury.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/Treasury.sol b/contracts/Treasury.sol index be209d3..b7a45aa 100644 --- a/contracts/Treasury.sol +++ b/contracts/Treasury.sol @@ -115,6 +115,7 @@ contract Treasury is ITreasury, AccessControl, ReentrancyGuard { require(hasRole(ADMIN_ROLE, msg.sender), "Not admin"); paused = true; } + function unPauseTreasury() external nonReentrant { require(hasRole(ADMIN_ROLE, msg.sender), "Not admin"); From 1ad4dbc1942aaf0cbee57ac7128b8622a95b37a5 Mon Sep 17 00:00:00 2001 From: Sir-Deon Date: Fri, 5 Apr 2024 11:53:44 +0100 Subject: [PATCH 3/4] updated treasury --- contracts/Treasury.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/Treasury.sol b/contracts/Treasury.sol index b7a45aa..48e568a 100644 --- a/contracts/Treasury.sol +++ b/contracts/Treasury.sol @@ -116,7 +116,6 @@ contract Treasury is ITreasury, AccessControl, ReentrancyGuard { paused = true; } - function unPauseTreasury() external nonReentrant { require(hasRole(ADMIN_ROLE, msg.sender), "Not admin"); paused = false; From d8a7cdfa2f847626e737a2d40943d70488e1d20c Mon Sep 17 00:00:00 2001 From: Sir-Deon Date: Fri, 5 Apr 2024 12:24:11 +0100 Subject: [PATCH 4/4] updated treasury --- contracts/Treasury.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contracts/Treasury.sol b/contracts/Treasury.sol index 48e568a..a8749db 100644 --- a/contracts/Treasury.sol +++ b/contracts/Treasury.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/ITreasury.sol"; @@ -23,7 +22,6 @@ contract Treasury is ITreasury, AccessControl, ReentrancyGuard { address indexed _token, uint256 _amount ); - event UnauthorizedAccess(address indexed _user, bool status); bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant VAULT_ROLE = keccak256("VAULT_ROLE"); @@ -66,7 +64,7 @@ contract Treasury is ITreasury, AccessControl, ReentrancyGuard { uint256 _amount, string memory _asset ) external isPaused nonReentrant { - require(hasRole(VAULT_ROLE, msg.sender), " Not vault"); + require(hasRole(VAULT_ROLE, msg.sender), "Not vault"); require( IERC20(currencies[_asset]).balanceOf(address(this)) >= _amount, "Insufficient balance"