From cfba4ed1e4745aeb740507edf4ecd5fd862889f2 Mon Sep 17 00:00:00 2001 From: Roberto Cantu Date: Tue, 14 May 2024 13:41:18 -0500 Subject: [PATCH] safeTransferFrom -> safeTransfer; add treasury() getter --- .../components/staking/GeneralFortaStakingVault.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/components/staking/GeneralFortaStakingVault.sol b/contracts/components/staking/GeneralFortaStakingVault.sol index 6c96faf0..cfd8b4db 100644 --- a/contracts/components/staking/GeneralFortaStakingVault.sol +++ b/contracts/components/staking/GeneralFortaStakingVault.sol @@ -27,11 +27,6 @@ contract GeneralFortaStakingVault is ERC4626Upgradeable, AccessControlUpgradeabl string public constant version = "0.1.0"; - /// @custom:oz-upgrades-unsafe-allow constructor - constructor() initializer { - _disableInitializers(); - } - /** * @notice Initializer method, access point to initialize inheritance tree. * @param __admin Granted DEFAULT_ADMIN_ROLE. @@ -62,10 +57,15 @@ contract GeneralFortaStakingVault is ERC4626Upgradeable, AccessControlUpgradeabl uint256 stakeValue ) external onlyRole(SLASHER_ROLE) { if (stakeValue == 0) revert ZeroAmount("stakeValue"); - SafeERC20.safeTransferFrom(IERC20(asset()), address(this), _treasury, stakeValue); + SafeERC20.safeTransfer(IERC20(asset()), _treasury, stakeValue); emit Slashed(_msgSender(), stakeValue); } + /// Returns treasury address (slashed tokens destination) + function treasury() public view returns (address) { + return _treasury; + } + /** * @notice Sets destination of slashed tokens. Restricted to DEFAULT_ADMIN_ROLE * @param newTreasury address.