Skip to content

Commit

Permalink
safeTransferFrom -> safeTransfer; add treasury() getter
Browse files Browse the repository at this point in the history
  • Loading branch information
RCantu92 committed May 14, 2024
1 parent a84ab30 commit cfba4ed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contracts/components/staking/GeneralFortaStakingVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit cfba4ed

Please sign in to comment.