Verified contractPartialBUSL-1.1
PlasmaVaultBase
Address0x80f451017066494de93943c36ce453fb98ae0b29
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.30
- Same code
2 more contracts
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- License
- BUSL-1.1
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,255,248
- Creation transaction
- 0xd6f9fd4c91…cfcc4bd924
- Main copy (most transactions)
- 0x233074f6…a1a18c7b
79 files
The source code is large: one file is shown at a time. Choose a file in the list.
- lib/ipor-fusion/contracts/vaults/PlasmaVaultBase.solmain9.96 KB
- lib/ipor-fusion/contracts/fuses/IFuseCommon.sol277 B
- lib/ipor-fusion/contracts/handlers/pre_hooks/IPreHook.sol1.13 KB
- lib/ipor-fusion/contracts/handlers/pre_hooks/PreHooksHandler.sol1.91 KB
- lib/ipor-fusion/contracts/handlers/pre_hooks/PreHooksLib.sol7.69 KB
- lib/ipor-fusion/contracts/interfaces/IIporFusionAccessManager.sol4.46 KB
- lib/ipor-fusion/contracts/interfaces/IPlasmaVault.sol3.03 KB
- lib/ipor-fusion/contracts/interfaces/IPlasmaVaultBase.sol3.01 KB
- lib/ipor-fusion/contracts/interfaces/IPlasmaVaultGovernance.sol11.88 KB
- lib/ipor-fusion/contracts/interfaces/IPlasmaVaultVotesPlugin.sol2.43 KB
- lib/ipor-fusion/contracts/interfaces/IRewardsClaimManager.sol6.34 KB
- lib/ipor-fusion/contracts/libraries/AssetDistributionProtectionLib.sol10.07 KB
- lib/ipor-fusion/contracts/libraries/CallbackHandlerLib.sol7.48 KB
- lib/ipor-fusion/contracts/libraries/FuseStorageLib.sol17.81 KB
- lib/ipor-fusion/contracts/libraries/FusesLib.sol23.88 KB
- lib/ipor-fusion/contracts/libraries/PlasmaVaultConfigLib.sol17.15 KB
- lib/ipor-fusion/contracts/libraries/PlasmaVaultLib.sol41.13 KB
- lib/ipor-fusion/contracts/libraries/PlasmaVaultStorageLib.sol51.7 KB
- lib/ipor-fusion/contracts/libraries/Roles.sol6.45 KB
- lib/ipor-fusion/contracts/libraries/errors/Errors.sol730 B
- lib/ipor-fusion/contracts/libraries/math/IporMath.sol5.12 KB
- lib/ipor-fusion/contracts/managers/access/AccessManagedUpgradeable.sol6.97 KB
- lib/ipor-fusion/contracts/managers/access/IporFusionAccessManager.sol18.81 KB
- lib/ipor-fusion/contracts/managers/access/IporFusionAccessManagerInitializationLib.sol3.49 KB
- lib/ipor-fusion/contracts/managers/access/IporFusionAccessManagersStorageLib.sol7.8 KB
- lib/ipor-fusion/contracts/managers/access/RedemptionDelayLib.sol5.04 KB
- lib/ipor-fusion/contracts/managers/access/RoleExecutionTimelockLib.sol2.22 KB
- lib/ipor-fusion/contracts/managers/context/ContextClient.sol3.69 KB
- lib/ipor-fusion/contracts/managers/context/ContextClientStorageLib.sol4.78 KB
- lib/ipor-fusion/contracts/managers/context/IContextClient.sol2.6 KB
- lib/ipor-fusion/contracts/managers/fee/FeeAccount.sol1.95 KB
- lib/ipor-fusion/contracts/managers/fee/FeeManager.sol35.03 KB
- lib/ipor-fusion/contracts/managers/fee/FeeManagerFactory.sol3.73 KB
- lib/ipor-fusion/contracts/managers/fee/FeeManagerStorageLib.sol14.25 KB
- lib/ipor-fusion/contracts/managers/withdraw/WithdrawManager.sol16.96 KB
- lib/ipor-fusion/contracts/managers/withdraw/WithdrawManagerStorageLib.sol12.63 KB
- lib/ipor-fusion/contracts/price_oracle/IPriceOracleMiddleware.sol2.28 KB
- lib/ipor-fusion/contracts/universal_reader/UniversalReader.sol3.32 KB
- lib/ipor-fusion/contracts/vaults/PlasmaVault.sol64.1 KB
- lib/ipor-fusion/contracts/vaults/PlasmaVaultGovernance.sol70.09 KB
- lib/ipor-fusion/contracts/vaults/lib/PlasmaVaultFeesLib.sol3.81 KB
- lib/ipor-fusion/contracts/vaults/lib/PlasmaVaultMarketsLib.sol10.41 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol8.91 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol12.47 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol3.2 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol13.75 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/utils/NoncesUpgradeable.sol2.33 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4.36 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol8.69 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/access/manager/AccessManager.sol29.36 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/access/manager/AuthorityUtils.sol1.23 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/access/manager/IAccessManaged.sol1.11 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/access/manager/IAccessManager.sol16.09 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/access/manager/IAuthority.sol482 B
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/governance/utils/IVotes.sol2.32 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/interfaces/IERC4626.sol12.18 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol739 B
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/interfaces/IERC5805.sol272 B
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/interfaces/IERC6372.sol519 B
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/interfaces/draft-IERC6093.sol6.53 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol11.14 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol2.78 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol12.41 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol683 B
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol3.8 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol5.77 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol995 B
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/Address.sol6.26 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/Context.sol963 B
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/Multicall.sol1.7 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/Strings.sol3.1 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol7.73 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol3.76 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/math/Math.sol15.12 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/math/SafeCast.sol34.69 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol1.26 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/structs/Checkpoints.sol21.14 KB
- lib/ipor-fusion/node_modules/@openzeppelin/contracts/utils/types/Time.sol5.1 KB
lib/ipor-fusion/contracts/managers/access/IporFusionAccessManager.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.30;
import {AccessManager} from "@openzeppelin/contracts/access/manager/AccessManager.sol";
import {IAccessManager} from "@openzeppelin/contracts/access/manager/IAccessManager.sol";
import {IIporFusionAccessManager} from "../../interfaces/IIporFusionAccessManager.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {RedemptionDelayLib} from "./RedemptionDelayLib.sol";
import {IporFusionAccessManagersStorageLib} from "./IporFusionAccessManagersStorageLib.sol";
import {PlasmaVault} from "../../vaults/PlasmaVault.sol";
import {RoleExecutionTimelockLib} from "./RoleExecutionTimelockLib.sol";
import {
IporFusionAccessManagerInitializationLib,
InitializationData
} from "./IporFusionAccessManagerInitializationLib.sol";
import {Roles} from "../../libraries/Roles.sol";
/**
* @title IporFusionAccessManager
* @notice Contract responsible for managing access control to the IporFusion protocol
* @dev Extends OpenZeppelin's AccessManager with custom functionality for IPOR Fusion
*
* Role-based permissions:
* - ADMIN_ROLE: Can initialize the contract and manage roles
* - GUARDIAN_ROLE: Can cancel scheduled operations, close and reopen targets (emergency pause / unpause)
* - ATOMIST_ROLE: Can manage vault configurations and market settings
* - PUBLIC_ROLE: Used for publicly accessible functions
* - TECH_CONTEXT_MANAGER_ROLE: Technical role for context operations
* - TECH_PLASMA_VAULT_ROLE: Technical role for plasma vault operations
*
* Function permissions:
* - initialize: Restricted to ADMIN_ROLE
* - updateTargetClosed: Restricted to GUARDIAN_ROLE
* - convertToPublicVault: Restricted to TECH_PLASMA_VAULT_ROLE
* - enableTransferShares: Restricted to TECH_PLASMA_VAULT_ROLE
* - setMinimalExecutionDelaysForRoles: Restricted to TECH_PLASMA_VAULT_ROLE
* - setRedemptionDelay: Restricted to TECH_PLASMA_VAULT_ROLE (the OWNER_ROLE reaches it through
* PlasmaVaultGovernance.setRedemptionDelay; that path is timelocked only when the owner account holds
* OWNER_ROLE with a non-zero execution delay - the default initializer grants it with 0, i.e. immediate)
* - grantRole: Restricted to authorized roles (via onlyAuthorized)
*
* Security features:
* - Role-based execution delays
* - Redemption delay mechanism
* - Guardian role for emergency actions
* - Timelock controls for sensitive operations
*
* Storage layout (not upgradeable, deployed as EIP-1167 clones by AccessManagerFactory):
* - Slots 0-3 belong to OpenZeppelin AccessManager (_targets, _roles, _schedules, _executionId)
* - Slot 4 is `_customConsumingSchedule` (bool). Before IL-7910 slot 4 held the public
* `REDEMPTION_DELAY_IN_SECONDS` state variable and the flag lived in slot 5; the delay now lives in the
* ERC-7201 namespace io.ipor.managers.access.RedemptionDelay. NEVER put this implementation behind a proxy
* that already holds pre-IL-7910 storage - a non-zero legacy delay in slot 4 would read as
* `_customConsumingSchedule == true` permanently. The layout is pinned by RedemptionDelayUpdateTest.
*
*/
contract IporFusionAccessManager is Initializable, IIporFusionAccessManager, AccessManager {
error AccessManagedUnauthorized(address caller);
error TooShortExecutionDelayForRole(uint64 roleId, uint32 executionDelay);
error TooLongRedemptionDelay(uint256 redemptionDelayInSeconds);
/// @notice Emitted when the vault-wide redemption delay is changed (also once at initialization, with old value 0)
/// @dev Carries the previous value so monitoring can alert on the exact transition (e.g. a change to or from 0)
/// @param oldRedemptionDelayInSeconds The redemption delay in force before the change
/// @param newRedemptionDelayInSeconds The redemption delay in force after the change
event RedemptionDelayUpdated(uint256 oldRedemptionDelayInSeconds, uint256 newRedemptionDelayInSeconds);
/// @notice Maximum allowed redemption delay in seconds (7 days)
uint256 public constant MAX_REDEMPTION_DELAY_IN_SECONDS = 7 days;
/// @dev Flag to track custom schedule consumption. Occupies slot 4, right after OpenZeppelin AccessManager's
/// four state variables - see the storage layout note in the contract NatSpec
bool private _customConsumingSchedule;
/**
* @notice Modifier to restrict function access to authorized callers
* @dev Checks if the caller can execute the function and handles scheduled operations
*/
modifier restricted() {
_checkCanCall(_msgSender(), _msgData());
_;
}
/// @custom:oz-upgrades-unsafe-allow constructor
/// @notice Constructor that initializes the IporFusionAccessManager with an admin and redemption delay
/// @dev Used when deploying directly without proxy
/// @param initialAdmin_ The address that will be granted the ADMIN_ROLE
/// @param redemptionDelayInSeconds_ The initial redemption delay period in seconds
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address initialAdmin_, uint256 redemptionDelayInSeconds_) AccessManager(initialAdmin_) initializer {
_initialize(initialAdmin_, redemptionDelayInSeconds_);
}
/// @notice Initializes the IporFusionAccessManager with access control and redemption delay (for cloning)
/// @param initialAdmin_ The address that will be granted the ADMIN_ROLE
/// @param redemptionDelayInSeconds_ The initial redemption delay period in seconds
/// @dev This method is called after cloning to initialize the contract
/// @custom:access Only during initialization
function proxyInitialize(address initialAdmin_, uint256 redemptionDelayInSeconds_) external initializer {
_initialize(initialAdmin_, redemptionDelayInSeconds_);
}
/// @notice Private method containing the common initialization logic
/// @param initialAdmin_ The initial admin address
/// @param redemptionDelayInSeconds_ The redemption delay in seconds
/// @dev This method is used by both constructor and proxyInitialize to avoid code duplication
function _initialize(address initialAdmin_, uint256 redemptionDelayInSeconds_) private {
_setRedemptionDelay(redemptionDelayInSeconds_);
_grantRole(ADMIN_ROLE, initialAdmin_, 0, 0);
}
/**
* @notice Initializes the access manager with role configurations
* @param initialData_ Initial configuration data for roles and permissions
* @dev Sets up role hierarchies, function permissions, and execution delays
* @custom:access Restricted to ADMIN_ROLE
*/
function initialize(InitializationData calldata initialData_) external restricted {
IporFusionAccessManagerInitializationLib.isInitialized();
_revokeRole(ADMIN_ROLE, msg.sender);
uint256 roleToFunctionsLength = initialData_.roleToFunctions.length;
uint64[] memory roleIds = new uint64[](roleToFunctionsLength);
uint256[] memory minimalDelays = new uint256[](roleToFunctionsLength);
if (roleToFunctionsLength > 0) {
for (uint256 i; i < roleToFunctionsLength; ++i) {
_setTargetFunctionRole(
initialData_.roleToFunctions[i].target,
initialData_.roleToFunctions[i].functionSelector,
initialData_.roleToFunctions[i].roleId
);
roleIds[i] = initialData_.roleToFunctions[i].roleId;
minimalDelays[i] = initialData_.roleToFunctions[i].minimalExecutionDelay;
if (
initialData_.roleToFunctions[i].roleId != Roles.ADMIN_ROLE &&
initialData_.roleToFunctions[i].roleId != Roles.GUARDIAN_ROLE &&
initialData_.roleToFunctions[i].roleId != Roles.PUBLIC_ROLE
) {
_setRoleGuardian(initialData_.roleToFunctions[i].roleId, Roles.GUARDIAN_ROLE);
}
}
}
RoleExecutionTimelockLib.setMinimalExecutionDelaysForRoles(roleIds, minimalDelays);
uint256 adminRolesLength = initialData_.adminRoles.length;
if (adminRolesLength > 0) {
for (uint256 i; i < adminRolesLength; ++i) {
_setRoleAdmin(initialData_.adminRoles[i].roleId, initialData_.adminRoles[i].adminRoleId);
}
}
uint256 accountToRolesLength = initialData_.accountToRoles.length;
if (accountToRolesLength > 0) {
for (uint256 i; i < accountToRolesLength; ++i) {
_grantRoleInternal(
initialData_.accountToRoles[i].roleId,
initialData_.accountToRoles[i].account,
initialData_.accountToRoles[i].executionDelay
);
}
}
}
/**
* @notice Checks if a caller can execute a function and updates state if needed
* @param caller_ Address attempting to call the function
* @param target_ Target contract address
* @param selector_ Function selector being called
* @return immediate Whether the call can be executed immediately
* @return delay The required delay before execution
* @custom:security Updates redemption delay state if applicable
*/
function canCallAndUpdate(
address caller_,
address target_,
bytes4 selector_
) external override restricted returns (bool immediate, uint32 delay) {
RedemptionDelayLib.lockChecks(caller_, selector_);
return super.canCall(caller_, target_, selector_);
}
/**
* @notice Updates whether a target contract is closed for operations (emergency pause / unpause)
* @param target_ Target contract address
* @param closed_ New closed status
* @custom:access Restricted to GUARDIAN_ROLE
*/
function updateTargetClosed(address target_, bool closed_) external override restricted {
_setTargetClosed(target_, closed_);
}
/**
* @notice Converts a vault to public access mode
* @param vault_ Address of the vault to convert
* @custom:access Restricted to TECH_PLASMA_VAULT_ROLE
*/
function convertToPublicVault(address vault_) external override restricted {
_setTargetFunctionRole(vault_, PlasmaVault.mint.selector, PUBLIC_ROLE);
_setTargetFunctionRole(vault_, PlasmaVault.deposit.selector, PUBLIC_ROLE);
_setTargetFunctionRole(vault_, PlasmaVault.depositWithPermit.selector, PUBLIC_ROLE);
}
/**
* @notice Enables share transfer functionality for a vault
* @param vault_ Address of the vault
* @custom:access Restricted to TECH_PLASMA_VAULT_ROLE
*/
function enableTransferShares(address vault_) external override restricted {
_setTargetFunctionRole(vault_, PlasmaVault.transfer.selector, PUBLIC_ROLE);
_setTargetFunctionRole(vault_, PlasmaVault.transferFrom.selector, PUBLIC_ROLE);
}
/**
* @notice Sets minimal execution delays for specified roles
* @param rolesIds_ Array of role IDs
* @param delays_ Array of corresponding delays
* @custom:access Restricted to TECH_PLASMA_VAULT_ROLE
*/
function setMinimalExecutionDelaysForRoles(
uint64[] calldata rolesIds_,
uint256[] calldata delays_
) external override restricted {
RoleExecutionTimelockLib.setMinimalExecutionDelaysForRoles(rolesIds_, delays_);
}
/**
* @notice Sets the vault-wide redemption delay
* @param redemptionDelayInSeconds_ The new redemption delay in seconds
* @dev The new value governs every account immediately - each account's unlock time is computed
* at check time as its last deposit timestamp plus the current delay, so lowering the delay
* releases existing depositors and raising it extends their locks, measured from their own deposits.
* Governance calls it through PlasmaVaultGovernance.setRedemptionDelay - AccessManager cannot schedule
* its own custom functions, so a setter restricted here to the OWNER_ROLE could never be timelocked.
* Note that the vault path is timelocked only when the calling owner holds OWNER_ROLE with a non-zero
* execution delay; with the default initializer configuration (execution delay 0) the change is immediate
* @custom:access Restricted to TECH_PLASMA_VAULT_ROLE (the PlasmaVault)
* @custom:risk Raising the delay retroactively locks accounts that deposited under a shorter (or zero) delay,
* for at most MAX_REDEMPTION_DELAY_IN_SECONDS counted from their last deposit - see PlasmaVaultGovernance
* @custom:error TooLongRedemptionDelay if redemptionDelayInSeconds_ exceeds MAX_REDEMPTION_DELAY_IN_SECONDS
*/
function setRedemptionDelay(uint256 redemptionDelayInSeconds_) external override restricted {
_setRedemptionDelay(redemptionDelayInSeconds_);
}
/**
* @notice Grants a role to an account with a specified execution delay
* @param roleId_ The role identifier to grant
* @param account_ The account to receive the role
* @param executionDelay_ The execution delay for the role operations
* @dev Overrides AccessManager.grantRole to add execution delay validation
* @custom:access
* - Restricted to authorized roles via onlyAuthorized modifier
* - Can only be called by the admin of the role being granted (e.g., ADMIN_ROLE can grant OWNER_ROLE, OWNER_ROLE can grant ATOMIST_ROLE)
* - Role hierarchy must be followed according to Roles.sol documentation
* @custom:security
* - Validates that execution delay meets minimum requirements
* - Role hierarchy must be respected (e.g., ADMIN_ROLE can grant OWNER_ROLE)
* @custom:error TooShortExecutionDelayForRole if executionDelay_ is less than the minimum required
*/
function grantRole(
uint64 roleId_,
address account_,
uint32 executionDelay_
) public override(IAccessManager, AccessManager) onlyAuthorized {
_grantRoleInternal(roleId_, account_, executionDelay_);
}
/**
* @notice Retrieves the minimal execution delay configured for a specific role
* @param roleId_ The role identifier to query
* @return The minimal execution delay in seconds for the specified role
* @dev This delay represents the minimum time that must pass between scheduling and executing an operation
* @custom:access No access restrictions - can be called by anyone
* @custom:security Used to enforce timelock restrictions on role operations
*/
function getMinimalExecutionDelayForRole(uint64 roleId_) external view override returns (uint256) {
return RoleExecutionTimelockLib.getMinimalExecutionDelayForRole(roleId_);
}
/**
* @notice Retrieves the effective unlock time for a specific account under the current redemption delay
* @param account_ The account address to query
* @return The timestamp until which the account is locked for redemption operations, computed as
* the account's last deposit timestamp plus the current REDEMPTION_DELAY_IN_SECONDS. May be in the
* past when the lock has already expired. Returns 0 when the account never deposited.
* @dev Used to enforce redemption delay periods after certain operations. The returned value moves
* immediately, in both directions, whenever the redemption delay is changed via setRedemptionDelay.
* @custom:access No access restrictions - can be called by anyone
* @custom:security
* - Part of the redemption delay mechanism
* - Used to prevent immediate withdrawals after specific actions
* - Lock time is managed by RedemptionDelayLib
*/
function getAccountLockTime(address account_) external view override returns (uint256) {
return RedemptionDelayLib.getAccountLockTime(account_);
}
/**
* @notice Retrieves the current vault-wide redemption delay
* @return The redemption delay in seconds, changeable by the OWNER_ROLE via PlasmaVaultGovernance.setRedemptionDelay
* @dev The value lives in ERC-7201 namespaced storage; the constant-style name is kept for
* ABI compatibility with instances deployed when the value was set once at initialization
* @custom:access No access restrictions - can be called by anyone
*/
// solhint-disable-next-line func-name-mixedcase
function REDEMPTION_DELAY_IN_SECONDS() external view override returns (uint256) {
return IporFusionAccessManagersStorageLib.getRedemptionDelay();
}
/**
* @notice Checks if the contract is currently consuming a scheduled operation
* @return bytes4 Returns the function selector if consuming a scheduled operation, or bytes4(0) if not
* @dev Used to track the state of scheduled operation execution
* @custom:access No access restrictions - can be called by anyone
* @custom:security
* - Used internally to prevent reentrancy during scheduled operation execution
* - Returns this.isConsumingScheduledOp.selector when _customConsumingSchedule is true
* - Returns bytes4(0) when not consuming a scheduled operation
*/
function isConsumingScheduledOp() external view override returns (bytes4) {
return _customConsumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);
}
function _setRedemptionDelay(uint256 redemptionDelayInSeconds_) private {
if (redemptionDelayInSeconds_ > MAX_REDEMPTION_DELAY_IN_SECONDS) {
revert TooLongRedemptionDelay(redemptionDelayInSeconds_);
}
uint256 oldRedemptionDelayInSeconds = IporFusionAccessManagersStorageLib.getRedemptionDelay();
IporFusionAccessManagersStorageLib.setRedemptionDelay(redemptionDelayInSeconds_);
emit RedemptionDelayUpdated(oldRedemptionDelayInSeconds, redemptionDelayInSeconds_);
}
function _grantRoleInternal(uint64 roleId_, address account_, uint32 executionDelay_) internal {
if (executionDelay_ < RoleExecutionTimelockLib.getMinimalExecutionDelayForRole(roleId_)) {
revert TooShortExecutionDelayForRole(roleId_, executionDelay_);
}
_grantRole(roleId_, account_, getRoleGrantDelay(roleId_), executionDelay_);
}
function _checkCanCall(address caller_, bytes calldata data_) internal virtual {
(bool immediate, uint32 delay) = canCall(caller_, address(this), bytes4(data_[0:4]));
if (!immediate) {
if (delay > 0) {
_customConsumingSchedule = true;
IAccessManager(address(this)).consumeScheduledOp(caller_, data_);
_customConsumingSchedule = false;
} else {
revert AccessManagedUnauthorized(caller_);
}
}
}
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"@openzeppelin/=lib/ipor-fusion/node_modules/@openzeppelin/",
"@chainlink/=lib/ipor-fusion/node_modules/@chainlink/",
"@uniswap/v4-core/=lib/ipor-fusion/node_modules/@uniswap/v4-core/",
"eth-gas-reporter/=node_modules/eth-gas-reporter/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"@ipor-protocol-deploy/=contracts/",
"@ipor-fusion/=lib/ipor-fusion/",
"@ipor-protocol/=lib/ipor-protocol/",
"scripts/=scripts/",
"@eth-optimism/=lib/ipor-fusion/node_modules/@eth-optimism/",
"@ethereum-vault-connector/=lib/ipor-fusion/node_modules/ethereum-vault-connector/",
"@morpho-org/=lib/ipor-fusion/node_modules/@morpho-org/",
"@pendle/=lib/ipor-fusion/node_modules/@pendle/",
"@prb/test/=lib/ipor-fusion/lib/foundry-random/lib/prb-test/src/",
"@scroll-tech/=lib/ipor-fusion/node_modules/@scroll-tech/",
"@uniswap/v3-core/=lib/ipor-fusion/node_modules/@uniswap/v3-core/",
"CramBit/=lib/ipor-fusion/lib/foundry-random/lib/CramBit/",
"abdk-libraries-solidity/=node_modules/abdk-libraries-solidity/",
"base64-sol/=lib/ipor-fusion/node_modules/base64-sol/",
"crambit/=lib/ipor-fusion/lib/foundry-random/lib/CramBit/src/",
"erc4626-tests/=lib/ipor-fusion/node_modules/@uniswap/v4-core/lib/openzeppelin-contracts/lib/erc4626-tests/",
"ethereum-vault-connector/=lib/ipor-fusion/node_modules/ethereum-vault-connector/",
"foundry-random/=lib/ipor-fusion/lib/foundry-random/src/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"hardhat/=node_modules/hardhat/",
"ipor-fusion/=lib/ipor-fusion/contracts/",
"openzeppelin-contracts/=lib/ipor-fusion/node_modules/@uniswap/v4-core/lib/openzeppelin-contracts/",
"openzeppelin/=lib/ipor-fusion/node_modules/ethereum-vault-connector/lib/openzeppelin-contracts/contracts/",
"prb-test/=lib/ipor-fusion/lib/foundry-random/lib/prb-test/src/",
"solidity-bytes-utils/=lib/ipor-fusion/lib/foundry-random/lib/solidity-bytes-utils/contracts/",
"solmate/=lib/ipor-fusion/node_modules/@uniswap/v4-core/lib/solmate/",
"src/=lib/ipor-fusion/lib/foundry-random/src/",
"test/=lib/ipor-fusion/test/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.