{"sources":{"src/StakingV2.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\nimport {Errors} from \"../lib/Errors.sol\";\nimport {Diem} from \"./Diem.sol\";\nimport {IStakingV2} from \"../interface/IStakingV2.sol\";\nimport {Staking} from \"./Staking.sol\";\n\n/// @custom:oz-upgrades-from Staking\ncontract StakingV2 is Staking, IStakingV2 {\n    /// @notice Tracks the accumulated reward per share for locked stakes\n    uint256 public accRewardPerShareLocked;\n\n    /// @notice Percentage of total emissions that go to venice\n    uint256 public veniceEmissionsPercentage; // initially 0, expressed as a fraction of 1e18.\n\n    /// @notice Percentage of emissions that go to venice from users have locked their sVVV\n    uint256 public veniceEmissionsPercentageWhenLocked;\n\n    /// @notice Total amount of sVVV that is currently locked\n    uint256 public totalLockedStakedVVV;\n\n    /// @notice Diem token\n    Diem public diem;\n\n    // The below variables define a step wise curve for diem minting.\n    // As the total supply of diem increases, the mint rate increases.\n\n    /// @notice Array of diem total supply points for each diem mint rate\n    uint256[256] public diemSupply;\n    /// @notice Array of diem mint rates for each diem supply point. This is expressed as sVVV per diem.\n    uint256[256] public diemMintRates;\n\n    struct LockedStakeInfo {\n        uint256 sVVVLockedAmount; // total amount of locked sVVV from user\n        uint256 outstandingDiemAmount; // amount of diems that have been minted to user (debt).\n    }\n    /// @notice Mapping of user addresses to their locked stake information\n\n    mapping(address => LockedStakeInfo) public lockedStakes;\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    // NOTE: if we add any modules be sure to add reinitializer(2) here\n    function upgradeInitialize(address _diem) external onlyOwner {\n        require(address(diem) == address(0), Errors.ALREADY_INITIALIZED);\n        veniceEmissionsPercentageWhenLocked = 2e17; // 20% on upgrade.\n        diem = Diem(_diem);\n    }\n\n    /// @notice Sets the percentage of emissions that go to venice before considering staking.\n    function setVeniceEmissionsPercentage(uint256 _veniceEmissionsPercentage) external onlyOwner {\n        _updateGlobalReward(); // ensure rewards are up to date - avoids retroactive changes\n        require(_veniceEmissionsPercentage <= 1e18, Errors.INVALID_EMISSIONS_PERCENTAGE);\n        veniceEmissionsPercentage = _veniceEmissionsPercentage;\n        emit VeniceEmissionsPercentageUpdated(_veniceEmissionsPercentage);\n    }\n\n    /// @notice Sets the percentage of emissions that go to venice from locked stakes.\n    /// This is in addition to the percentage that goes to venice from the total emissions.\n    /// and calculated after. Setting this to 20% (2e17) means that 20% of the rewards from locked stakes\n    /// go to venice, not 20% of the total rewards.\n    function setVeniceEmissionsPercentageWhenLocked(uint256 _veniceEmissionsPercentage) external onlyOwner {\n        _updateGlobalReward(); // ensure rewards are up to date - avoids retroactive changes\n        require(_veniceEmissionsPercentage <= 1e18, Errors.INVALID_EMISSIONS_PERCENTAGE);\n        veniceEmissionsPercentageWhenLocked = _veniceEmissionsPercentage;\n        emit VeniceEmissionsPercentageWhenLockedUpdated(_veniceEmissionsPercentage);\n    }\n\n    /// @notice Sets the diem mint curve and therefore the total possible supply of diem is represented as _diemSupply[255].\n    /// @param _diemSupply The total supply of diem at each point on the curve.\n    /// @param _diemMintRates The mint rate for each point on the curve.\n    function setDiemMintCurve(uint256[256] calldata _diemSupply, uint256[256] calldata _diemMintRates)\n        external\n        onlyOwner\n    {\n        for (uint256 i = 0; i < _diemSupply.length; i++) {\n            diemSupply[i] = _diemSupply[i];\n            diemMintRates[i] = _diemMintRates[i];\n        }\n\n        emit DiemMintRatesUpdated(_diemSupply, _diemMintRates);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                          CORE STAKING LOGIC\n    //////////////////////////////////////////////////////////////*/\n    /// @inheritdoc Staking\n    function stake(address recipient, uint256 amount) public virtual override {\n        require(amount > 0, Errors.STAKE_ZERO);\n        _claim(recipient);\n        _mint(recipient, amount);\n\n        venice.transferFrom(msg.sender, address(this), amount);\n        stakes[recipient].rewardDebt = getRewardDebt(recipient);\n        emit Staked(recipient, amount);\n    }\n\n    /// @inheritdoc Staking\n    function initiateUnstake(uint256 amount) external virtual override {\n        require(amount > 0, Errors.UNSTAKE_ZERO);\n        StakeInfo storage stakeInfo = stakes[msg.sender];\n        require(stakeInfo.cooldownAmount == 0, Errors.COOLDOWN_IN_PROGRESS);\n        require(balanceOfUnlocked(msg.sender) >= amount, Errors.INSUFFICIENT_BALANCE);\n\n        _claim(msg.sender);\n        _burn(msg.sender, amount);\n\n        stakeInfo.cooldownEnd = block.timestamp + cooldownDuration;\n        stakeInfo.cooldownAmount = amount;\n        stakeInfo.rewardDebt = getRewardDebt(msg.sender);\n\n        emit UnstakeInitiated(msg.sender, amount);\n    }\n\n    /// @inheritdoc Staking\n    function claim() public override {\n        _claim(msg.sender);\n        stakes[msg.sender].rewardDebt = getRewardDebt(msg.sender);\n    }\n\n    /// @notice Convenience function to claim rewards and stake them in one transaction and no dust.\n    /// @dev This requires venice approvals are in place ahead fo the call\n    function claimAndStake() external {\n        uint256 pendingRewardsForUser = pendingRewards(msg.sender);\n        stake(msg.sender, pendingRewardsForUser);\n    }\n\n    /// @inheritdoc Staking\n    function pendingRewards(address _user) public view override returns (uint256) {\n        uint256 _accRewardPerShare = accRewardPerShare;\n        uint256 _accRewardPerShareLocked = accRewardPerShareLocked;\n        uint256 currentTime = block.timestamp;\n\n        if (currentTime > lastRewardTimestamp) {\n            // _updateGlobalReward() was not called\n            uint256 timeElapsed = currentTime - lastRewardTimestamp;\n            uint256 minted = timeElapsed * emissionRatePerSecond;\n\n            // there are 2 venice portions here.\n            // 1. the portion that goes to venice from the total supply\n            // 2. the portion that goes to venice from the locked stakes\n\n            uint256 venicePortion = (minted * getVenicePercentage()) / 1e18;\n            uint256 rawStakerPortion = minted - venicePortion;\n            // staker portion is divided between locked and unlocked stakes.\n            uint256 stakerPortionLocked = (rawStakerPortion * totalLockedStakedVVV) / totalSupply();\n            uint256 stakerPortionUnlocked = rawStakerPortion - stakerPortionLocked;\n\n            // from the stakerPortionLocked, we need to remove the % that goes to venice\n            uint256 venicePortionLocked = (stakerPortionLocked * veniceEmissionsPercentageWhenLocked) / 1e18;\n            uint256 stakerPortionLockedForRewards = stakerPortionLocked - venicePortionLocked;\n\n            //NOTE: due to the locked mint to this address in v1, totalSupply has to be always greater than totalLockedStakedVVV\n            // so this should never end up with a division by 0.\n            _accRewardPerShare += (stakerPortionUnlocked * ACC_REWARD_SCALE) / (totalSupply() - totalLockedStakedVVV);\n            if (totalLockedStakedVVV > 0) {\n                // avoid division by 0\n                _accRewardPerShareLocked += (stakerPortionLockedForRewards * ACC_REWARD_SCALE) / totalLockedStakedVVV;\n            }\n        }\n\n        uint256 userAccumulated = (balanceOfUnlocked(_user) * _accRewardPerShare) / ACC_REWARD_SCALE;\n        uint256 userAccumulatedLocked =\n            (lockedStakes[_user].sVVVLockedAmount * _accRewardPerShareLocked) / ACC_REWARD_SCALE;\n        return userAccumulated + userAccumulatedLocked - stakes[_user].rewardDebt;\n    }\n\n    /// @inheritdoc Staking\n    /// @dev maintained for backwards compatibility\n    function getVenicePercentage() public view override returns (uint256) {\n        return veniceEmissionsPercentage;\n    }\n\n    /// @notice Returns the reward \"debt for a user. Concept is carried over from V1 and provides a waypoint to track reward changes.\n    function getRewardDebt(address _user) private view returns (uint256) {\n        uint256 userAccumulated = (balanceOfUnlocked(_user) * accRewardPerShare) / ACC_REWARD_SCALE;\n        uint256 userAccumulatedLocked =\n            (lockedStakes[_user].sVVVLockedAmount * accRewardPerShareLocked) / ACC_REWARD_SCALE;\n        return userAccumulated + userAccumulatedLocked;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                       LOCKED STAKE AND DIEM LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    /// @notice Returns the amount of diems that can be minted for a given amount of sVVV.\n    /// @dev This is a step wise function that iterates through the diem mint curve and calculates the amount of diems that can be minted for a given amount of sVVV.\n    /// @param sVVVAmountToLock The amount of sVVV to lock.\n    /// @return diemAmountOut The amount of diems that can be minted for the given amount of sVVV.\n    function getDiemAmountOut(uint256 sVVVAmountToLock) public view returns (uint256) {\n        uint256 currentDiemSupply = diem.totalSupply();\n        uint256 diemAmountOut = 0;\n        uint256 sVVVRemainingToLock = sVVVAmountToLock;\n\n        // Iterate through the curve points\n        for (uint256 i = 0; i < 256; i++) {\n            // if the current Diem supply is greater than this bucket, we need to advance\n            if (currentDiemSupply >= diemSupply[i]) {\n                continue;\n            }\n\n            uint256 supplyUpperBound = diemSupply[i];\n            uint256 bucketMintRate = diemMintRates[i]; // sVVV / diem\n\n            // we are now in a bucket that has additional supply, calculate how much we can lock in this bucket.\n            uint256 diemsAvailableInBucket = supplyUpperBound - currentDiemSupply;\n            // round sVVVAvailableInBucket up in favor of protocol\n            uint256 sVVVAvailableInBucket = ((bucketMintRate * diemsAvailableInBucket) + (1e18 - 1)) / 1e18;\n\n            if (sVVVAvailableInBucket >= sVVVRemainingToLock) {\n                // this bucket has all the supply we need - no need to advance.\n                diemAmountOut += sVVVRemainingToLock * 1e18 / bucketMintRate;\n                sVVVRemainingToLock = 0;\n                break;\n            } else {\n                // we will consume this whole bucket and need to advance.\n                diemAmountOut += diemsAvailableInBucket;\n                sVVVRemainingToLock -= sVVVAvailableInBucket;\n                currentDiemSupply += diemsAvailableInBucket;\n            }\n        }\n\n        if (sVVVRemainingToLock > 0) {\n            // we haven't been able to consume all the sVVV - we cannot process this request.\n            revert(Errors.INSUFFICIENT_SUPPLY);\n        }\n\n        return diemAmountOut;\n    }\n\n    /// @notice Burns sVVV from user and mints diems\n    /// @param sVVVAmountToLock The amount of sVVV to lock.\n    /// @param minDiemAmountOut The minimum amount of diems that must be minted or the call will revert.\n    function mintDiem(uint256 sVVVAmountToLock, uint256 minDiemAmountOut) external {\n        require(sVVVAmountToLock > 0, Errors.LOCK_ZERO);\n        _claim(msg.sender); // ensure rewards are up to date\n        uint256 unlockedBalance = balanceOfUnlocked(msg.sender);\n        require(unlockedBalance >= sVVVAmountToLock, Errors.INSUFFICIENT_BALANCE);\n\n        LockedStakeInfo storage lockedStake = lockedStakes[msg.sender];\n        uint256 diemAmountOut = getDiemAmountOut(sVVVAmountToLock);\n        require(diemAmountOut >= minDiemAmountOut, Errors.MIN_AMOUNT_OUT);\n\n        // Update user's locked stake info\n        lockedStake.outstandingDiemAmount += diemAmountOut;\n        lockedStake.sVVVLockedAmount += sVVVAmountToLock;\n        totalLockedStakedVVV += sVVVAmountToLock;\n\n        diem.mint(msg.sender, diemAmountOut);\n        emit DiemMinted(sVVVAmountToLock, diemAmountOut);\n        stakes[msg.sender].rewardDebt = getRewardDebt(msg.sender);\n    }\n\n    /// @notice Burns diems from user and unlocks the corresponding amount of sVVV\n    function burnDiem(uint256 diemAmountToBurn) external {\n        require(diemAmountToBurn > 0, Errors.BURN_ZERO);\n        uint256 userDiemBalance = diem.balanceOf(msg.sender);\n        require(userDiemBalance >= diemAmountToBurn, Errors.INSUFFICIENT_BALANCE);\n        require(lockedStakes[msg.sender].outstandingDiemAmount > 0, Errors.INSUFFICIENT_OUTSTANDING_DIEMS);\n\n        _claim(msg.sender);\n        LockedStakeInfo storage lockedStake = lockedStakes[msg.sender];\n\n        // NOTE: we unlock diem at the average mint rate of the user across all their locked sVVV\n        uint256 sVVVToUnlock = diemAmountToBurn * lockedStake.sVVVLockedAmount / lockedStake.outstandingDiemAmount;\n        require(lockedStake.sVVVLockedAmount >= sVVVToUnlock, Errors.INSUFFICIENT_LOCKED_BALANCE);\n\n        // update locked stake info\n        lockedStake.sVVVLockedAmount -= sVVVToUnlock;\n        require(lockedStake.outstandingDiemAmount >= diemAmountToBurn, Errors.INSUFFICIENT_OUTSTANDING_DIEMS);\n        lockedStake.outstandingDiemAmount -= diemAmountToBurn;\n        totalLockedStakedVVV -= sVVVToUnlock;\n\n        // burn diem from user\n        diem.burn(msg.sender, diemAmountToBurn);\n\n        // this should now allow their sVVV to be unstaked if desired.\n        emit DiemBurned(sVVVToUnlock, diemAmountToBurn);\n        stakes[msg.sender].rewardDebt = getRewardDebt(msg.sender);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               ERC20-like Logic\n    //////////////////////////////////////////////////////////////*/\n\n    /// @notice Returns the balance of the user excluding their locked sVVV\n    function balanceOfUnlocked(address user) public view returns (uint256) {\n        return balanceOf(user) - lockedStakes[user].sVVVLockedAmount;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               INTERNALS\n    //////////////////////////////////////////////////////////////*/\n    function _claim(address user) internal virtual override {\n        _updateGlobalReward();\n        uint256 pending = pendingRewards(user);\n        if (pending > 0) {\n            venice.transfer(user, pending);\n            emit Claimed(user, pending);\n        }\n    }\n\n    function _updateGlobalReward() internal virtual override {\n        uint256 currentTime = block.timestamp;\n        if (currentTime <= lastRewardTimestamp) return;\n\n        uint256 timeElapsed = currentTime - lastRewardTimestamp;\n        lastRewardTimestamp = currentTime;\n\n        uint256 minted = timeElapsed * emissionRatePerSecond;\n        if (minted == 0) return;\n\n        uint256 venicePortion = (minted * getVenicePercentage()) / 1e18;\n        uint256 rawStakerPortion = minted - venicePortion;\n\n        // the raw starker portion is divided into three buckets:\n        // 1. rewards to stakers\n        // 2. rewards to locked stakes\n        // 3. rewards to venice (from locked stakes)\n\n        uint256 _totalSupply = totalSupply(); // NOTE: this cannot be 0 due to minting to this address in v1.\n        uint256 totalUnlockedSupply = _totalSupply - totalLockedStakedVVV;\n        uint256 stakerPortionLocked = (rawStakerPortion * totalLockedStakedVVV) / _totalSupply;\n        uint256 stakerPortionUnlocked = rawStakerPortion - stakerPortionLocked;\n        uint256 veniceToMintToAllStakers = 0;\n\n        if (stakerPortionUnlocked > 0) {\n            uint256 stakerRewardDelta = (stakerPortionUnlocked * ACC_REWARD_SCALE) / totalUnlockedSupply;\n            if (stakerRewardDelta > 0) {\n                uint256 distributed = (stakerRewardDelta * totalUnlockedSupply) / ACC_REWARD_SCALE;\n                veniceToMintToAllStakers += distributed;\n                accRewardPerShare += stakerRewardDelta;\n            }\n        }\n\n        if (stakerPortionLocked > 0) {\n            // we have rewards for locked stakers and also to venice!\n            uint256 venicePortionLocked = (stakerPortionLocked * veniceEmissionsPercentageWhenLocked) / 1e18;\n            uint256 stakerPortionLockedForRewards = stakerPortionLocked - venicePortionLocked;\n            uint256 lockedStakerRewardDelta = (stakerPortionLockedForRewards * ACC_REWARD_SCALE) / totalLockedStakedVVV;\n            if (lockedStakerRewardDelta > 0) {\n                uint256 distributedToLockedStakers = (lockedStakerRewardDelta * totalLockedStakedVVV) / ACC_REWARD_SCALE;\n                accRewardPerShareLocked += lockedStakerRewardDelta;\n                veniceToMintToAllStakers += distributedToLockedStakers;\n            }\n            venicePortion += venicePortionLocked;\n        }\n\n        if (venicePortion > 0) {\n            venice.mint(treasury, venicePortion);\n        }\n\n        if (veniceToMintToAllStakers > 0) {\n            venice.mint(address(this), veniceToMintToAllStakers);\n        }\n    }\n}\n"},"lib/Errors.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\nlibrary Errors {\n    string constant STAKE_ZERO               = \"STAKE_ZERO\";\n    string constant UNSTAKE_ZERO             = \"UNSTAKE_ZERO\";\n    string constant LOCK_ZERO                = \"LOCK_ZERO\";\n    string constant NO_COOLDOWN              = \"NO_COOLDOWN\";\n    string constant COOLDOWN_NOT_OVER        = \"COOLDOWN_NOT_OVER\";\n    string constant NOT_TRANSFERRABLE        = \"NOT_TRANSFERRABLE\";\n    string constant NOT_RELAYER              = \"NOT_RELAYER\";\n    string constant INVALID_UTILIZATION_RATE = \"INVALID_UTILIZATION_RATE\";\n    string constant INSUFFICIENT_SUPPLY      = \"INSUFFICIENT_SUPPLY\";\n    string constant ALREADY_INITIALIZED            = \"ALREADY_INITIALIZED\";\n    string constant INSUFFICIENT_BALANCE           = \"INSUFFICIENT_BALANCE\";\n    string constant INSUFFICIENT_STAKED_BALANCE    = \"INSUFFICIENT_STAKED_BALANCE\";\n    string constant INSUFFICIENT_LOCKED_BALANCE    = \"INSUFFICIENT_LOCKED_BALANCE\";\n    string constant INSUFFICIENT_OUTSTANDING_DIEMS = \"INSUFFICIENT_OUTSTANDING_DIEMS\";\n    string constant BURN_ZERO                      = \"BURN_ZERO\";\n    string constant INVALID_EMISSIONS_PERCENTAGE   = \"INVALID_EMISSIONS_PERCENTAGE\";\n    string constant MIN_AMOUNT_OUT                 = \"BELOW_MIN_DIEM_AMOUNT_OUT\";\n    string constant COOLDOWN_IN_PROGRESS           = \"COOLDOWN_IN_PROGRESS\";\n}"},"src/Diem.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {Errors} from \"../lib/Errors.sol\";\n\n/// @title Diem\n/// @notice ERC20 token created by StakingV2 contract by staking sVVV.\n/// user who would like to access VeniceAI API services must stake Diem in this contract\n/// and request withdrawals that will be delayed by a cooldown period.\ncontract Diem is ERC20, AccessControl {\n    bytes32 public constant MINTER_BURNER_ROLE = keccak256(\"MINTER_BURNER_ROLE\");\n\n    event Staked(address indexed user, uint256 amount);\n    event Unstaked(address indexed user, uint256 amount);\n    event UnstakeInitiated(address indexed user, uint256 amount);\n    event CooldownDurationUpdated(uint256 cooldownDuration);\n\n    /// @notice Cooldown period for withdrawals\n    uint256 public cooldownDuration = 1 days;\n\n    /// @notice Total amount of Diem staked in the contract\n    uint256 public totalStaked;\n\n    struct StakedInfo {\n        uint256 amountStaked;\n        uint256 coolDownEnd;\n        uint256 coolDownAmount;\n    }\n\n    mapping(address => StakedInfo) public stakedInfos;\n\n    constructor() ERC20(\"Diem\", \"DIEM\") {\n        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); // has the ability to add minter/burner roles\n    }\n\n    /// @notice Mints new Diem tokens - only callable by minter role (StakingV2)\n    /// @param to The address to mint the tokens to\n    /// @param amount The amount of tokens to mint\n    function mint(address to, uint256 amount) external onlyRole(MINTER_BURNER_ROLE) {\n        _mint(to, amount);\n    }\n\n    /// @notice Burns Diem tokens - only callable by minter role (StakingV2)\n    /// @param from The address to burn the tokens from\n    /// @param amount The amount of tokens to burn\n    function burn(address from, uint256 amount) external onlyRole(MINTER_BURNER_ROLE) {\n        _burn(from, amount);\n    }\n\n    /// @notice Sets the cooldown duration for withdrawals - only callable by default admin role\n    /// @param _cooldownDuration The new cooldown duration\n    function setCooldownDuration(uint256 _cooldownDuration) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        cooldownDuration = _cooldownDuration;\n        emit CooldownDurationUpdated(_cooldownDuration);\n    }\n\n    /// @notice Stakes Diem tokens for use within the VeniceAI ecosystem\n    /// @param amount The amount of tokens to stake\n    function stake(uint256 amount) external {\n        require(amount > 0, Errors.STAKE_ZERO);\n        require(balanceOf(msg.sender) >= amount, Errors.INSUFFICIENT_BALANCE);\n\n        totalStaked += amount;\n        stakedInfos[msg.sender].amountStaked += amount;\n        _update(msg.sender, address(this), amount); // avoid approvals\n        emit Staked(msg.sender, amount);\n    }\n\n    /// @notice Initiates a cooldown period for unstaking Diem tokens\n    /// @param amount The amount of tokens to initiate the cooldown for\n    function initiateUnstake(uint256 amount) external {\n        require(amount > 0, Errors.UNSTAKE_ZERO);\n        require(stakedInfos[msg.sender].amountStaked >= amount, Errors.INSUFFICIENT_STAKED_BALANCE);\n        StakedInfo storage stakedInfo = stakedInfos[msg.sender];\n        stakedInfo.coolDownEnd = block.timestamp + cooldownDuration;\n        stakedInfo.coolDownAmount += amount; // users can increase amount in cooldown, but have to wait again.\n        stakedInfo.amountStaked -= amount;\n        emit UnstakeInitiated(msg.sender, amount);\n    }\n\n    /// @notice Unstakes Diem tokens after the cooldown period has ended transferring them to the user\n    function unstake() external {\n        StakedInfo storage stakedInfo = stakedInfos[msg.sender];\n        require(stakedInfo.coolDownAmount > 0, Errors.NO_COOLDOWN);\n        require(block.timestamp >= stakedInfo.coolDownEnd, Errors.COOLDOWN_NOT_OVER);\n        uint256 amountToUnstake = stakedInfo.coolDownAmount;\n        totalStaked -= amountToUnstake;\n        stakedInfo.coolDownAmount = 0; // critical to reset this to 0!\n        stakedInfo.coolDownEnd = 0;\n        _update(address(this), msg.sender, amountToUnstake);\n        emit Unstaked(msg.sender, amountToUnstake);\n    }\n}\n"},"interface/IStakingV2.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\n/**\n * @title IStakingV2\n * @notice Interface for the Venice StakingV2 functionality.\n *         This interface extends the IStaking interface to include new functionality\n */\ninterface IStakingV2 {\n    event VeniceEmissionsPercentageUpdated(uint newPercentage);\n    event VeniceEmissionsPercentageWhenLockedUpdated(uint newPercentage);\n    event DiemMintRatesUpdated(uint[256] diemSupply, uint[256] diemMintRates);\n    event DiemMinted(uint svvvLocked, uint diemMinted);\n    event DiemBurned(uint svvvUnlocked, uint diemBurned);\n}\n\n"},"src/Staking.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\nimport {UUPSUpgradeable} from \"@openzeppelin-contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {ERC20Upgradeable} from \"@openzeppelin-contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin-contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nimport {Errors} from \"../lib/Errors.sol\";\nimport {Venice} from \"./Venice.sol\";\nimport {Oracle} from \"./Oracle.sol\";\nimport {IStaking} from \"../interface/IStaking.sol\";\n\ncontract Staking is IStaking, UUPSUpgradeable, ERC20Upgradeable, OwnableUpgradeable {\n    uint256 public constant ACC_REWARD_SCALE = 1e36;\n\n    Venice public venice;\n    Oracle public oracle;\n\n    address public treasury;\n    uint256 public emissionRatePerSecond;\n    uint256 public cooldownDuration;\n\n    struct StakeInfo {\n        uint256 rewardDebt;\n        uint256 cooldownEnd;\n        uint256 cooldownAmount;\n    }\n\n    mapping(address => StakeInfo) public stakes;\n\n    uint256 public accRewardPerShare;\n    uint256 public lastRewardTimestamp;\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(address _venice, address _oracle, address _treasury) public initializer {\n        __ERC20_init(\"Staked Venice Token\", \"sVVV\");\n        __Ownable_init(msg.sender);\n        __UUPSUpgradeable_init();\n\n        venice = Venice(_venice);\n        oracle = Oracle(_oracle);\n        treasury = _treasury;\n        emissionRatePerSecond = 14_000_000 * 10 ** 18 / uint256(365 days); // approx. 14M/Year\n        cooldownDuration = 7 days;\n        lastRewardTimestamp = block.timestamp;\n\n        _mint(address(this), 1e18); // Initial supply to mitigate inflation attack\n    }\n\n    /// @inheritdoc IStaking\n    function setTreasury(address _treasury) external onlyOwner {\n        treasury = _treasury;\n        emit TreasuryUpdated(_treasury);\n    }\n\n    /// @inheritdoc IStaking\n    function setEmissionRate(uint256 _emissionRate) external onlyOwner {\n        _updateGlobalReward();\n        emissionRatePerSecond = _emissionRate;\n        emit EmissionRateUpdated(_emissionRate);\n    }\n\n    /// @inheritdoc IStaking\n    function setCooldownDuration(uint256 _cooldownDuration) external onlyOwner {\n        cooldownDuration = _cooldownDuration;\n        emit CooldownDurationUpdated(_cooldownDuration);\n    }\n\n    function _update(address from, address to, uint256 value) internal virtual override {\n        if (from != address(0) && to != address(0)) revert(Errors.NOT_TRANSFERRABLE);\n        super._update(from, to, value);\n    }\n\n    function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n\n    /*//////////////////////////////////////////////////////////////\n                          CORE STAKING LOGIC\n    //////////////////////////////////////////////////////////////*/\n    /// @inheritdoc IStaking\n    function stake(address recipient, uint256 amount) external virtual {\n        require(amount > 0, Errors.STAKE_ZERO);\n        _claim(recipient);\n        _mint(recipient, amount);\n\n        venice.transferFrom(msg.sender, address(this), amount);\n        stakes[recipient].rewardDebt = (balanceOf(recipient) * accRewardPerShare) / ACC_REWARD_SCALE;\n        emit Staked(recipient, amount);\n    }\n\n    /// @inheritdoc IStaking\n    function initiateUnstake(uint256 amount) external virtual {\n        require(amount > 0, Errors.UNSTAKE_ZERO);\n        _claim(msg.sender);\n        _burn(msg.sender, amount);\n\n        StakeInfo storage stakeInfo = stakes[msg.sender];\n        stakeInfo.cooldownEnd = block.timestamp + cooldownDuration;\n        stakeInfo.cooldownAmount = amount;\n        stakeInfo.rewardDebt = (balanceOf(msg.sender) * accRewardPerShare) / ACC_REWARD_SCALE;\n\n        emit UnstakeInitiated(msg.sender, amount);\n    }\n\n    /// @inheritdoc IStaking\n    function finalizeUnstake() external {\n        StakeInfo storage stakeInfo = stakes[msg.sender];\n        require(stakeInfo.cooldownAmount > 0, Errors.NO_COOLDOWN);\n        require(block.timestamp >= stakeInfo.cooldownEnd, Errors.COOLDOWN_NOT_OVER);\n\n        uint256 amount = stakeInfo.cooldownAmount;\n        stakeInfo.cooldownEnd = 0;\n        stakeInfo.cooldownAmount = 0;\n\n        venice.transfer(msg.sender, amount);\n\n        emit UnstakeFinalized(msg.sender, amount);\n    }\n\n    /// @inheritdoc IStaking\n    function claim() external virtual {\n        _claim(msg.sender);\n        stakes[msg.sender].rewardDebt = (balanceOf(msg.sender) * accRewardPerShare) / ACC_REWARD_SCALE;\n    }\n\n    /// @inheritdoc IStaking\n    function pendingRewards(address _user) public view virtual returns (uint256) {\n        uint256 _accRewardPerShare = accRewardPerShare;\n        uint256 currentTime = block.timestamp;\n\n        if (currentTime > lastRewardTimestamp) {\n            // _updateGlobalReward() was not called\n            uint256 timeElapsed = currentTime - lastRewardTimestamp;\n            uint256 minted = timeElapsed * emissionRatePerSecond;\n            uint256 venicePortion = (minted * getVenicePercentage()) / 1e18;\n            uint256 stakerPortion = minted - venicePortion;\n\n            _accRewardPerShare += (stakerPortion * ACC_REWARD_SCALE) / totalSupply();\n        }\n\n        uint256 userAccumulated = (balanceOf(_user) * _accRewardPerShare) / ACC_REWARD_SCALE;\n        return userAccumulated - stakes[_user].rewardDebt;\n    }\n\n    /// @inheritdoc IStaking\n    function getVenicePercentage() public view virtual returns (uint256) {\n        uint256 utilization = oracle.utilizationRate();\n        return utilization <= 5e17 // 5e17 = 50%\n            ? 2e17 + (12e17 * utilization) / 1e18\n            : 14e17 - (12e17 * utilization) / 1e18;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               INTERNALS\n    //////////////////////////////////////////////////////////////*/\n    function _claim(address user) internal virtual {\n        require(stakes[user].cooldownAmount == 0, Errors.COOLDOWN_NOT_OVER);\n        _updateGlobalReward();\n        uint256 pending = pendingRewards(user);\n        if (pending > 0) {\n            venice.transfer(user, pending);\n            emit Claimed(user, pending);\n        }\n    }\n\n    function _updateGlobalReward() internal virtual {\n        uint256 currentTime = block.timestamp;\n        if (currentTime <= lastRewardTimestamp) return;\n\n        uint256 timeElapsed = currentTime - lastRewardTimestamp;\n        lastRewardTimestamp = currentTime;\n\n        uint256 minted = timeElapsed * emissionRatePerSecond;\n        if (minted == 0) return;\n\n        uint256 venicePortion = (minted * getVenicePercentage()) / 1e18;\n        uint256 rawStakerPortion = minted - venicePortion;\n\n        if (venicePortion > 0) {\n            venice.mint(treasury, venicePortion);\n        }\n\n        uint256 _totalSupply = totalSupply();\n        if (rawStakerPortion > 0) {\n            uint256 stakerRewardDelta = (rawStakerPortion * ACC_REWARD_SCALE) / totalSupply();\n            if (stakerRewardDelta > 0) {\n                uint256 distributed = (stakerRewardDelta * _totalSupply) / ACC_REWARD_SCALE;\n                venice.mint(address(this), distributed);\n                accRewardPerShare += stakerRewardDelta;\n            }\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/token/ERC20/ERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0-rc.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor(string memory name_, string memory symbol_) {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            _totalSupply += value;\n        } else {\n            uint256 fromBalance = _balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                _balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        _allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/access/AccessControl.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n    struct RoleData {\n        mapping(address account => bool) hasRole;\n        bytes32 adminRole;\n    }\n\n    mapping(bytes32 role => RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with an {AccessControlUnauthorizedAccount} error including the required role.\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role);\n        _;\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n        return _roles[role].hasRole[account];\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n     */\n    function _checkRole(bytes32 role) internal view virtual {\n        _checkRole(role, _msgSender());\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n     * is missing `role`.\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert AccessControlUnauthorizedAccount(account, role);\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n        if (callerConfirmation != _msgSender()) {\n            revert AccessControlBadConfirmation();\n        }\n\n        _revokeRole(role, callerConfirmation);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        _roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n        if (!hasRole(role, account)) {\n            _roles[role].hasRole[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n        if (hasRole(role, account)) {\n            _roles[role].hasRole[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-upgradeable-5.2.0-rc.1/proxy/utils/UUPSUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0-rc.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n     * See {_onlyProxy}.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC-1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-upgradeable-5.2.0-rc.1/token/ERC20/ERC20Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0-rc.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\n    struct ERC20Storage {\n        mapping(address account => uint256) _balances;\n\n        mapping(address account => mapping(address spender => uint256)) _allowances;\n\n        uint256 _totalSupply;\n\n        string _name;\n        string _symbol;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC20\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n    function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n        assembly {\n            $.slot := ERC20StorageLocation\n        }\n    }\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        ERC20Storage storage $ = _getERC20Storage();\n        $._name = name_;\n        $._symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            $._totalSupply += value;\n        } else {\n            uint256 fromBalance = $._balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                $._balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                $._totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                $._balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        $._allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-upgradeable-5.2.0-rc.1/access/OwnableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},"src/Venice.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\nimport {ERC20} from \"solmate/src/tokens/ERC20.sol\";\nimport {Owned} from \"solmate/src/auth/Owned.sol\";\n\ncontract Venice is ERC20, Owned {\n    constructor(address treasury) ERC20(\"Venice Token\", \"VVV\", 18) Owned(msg.sender) {\n        _mint(treasury, 100_000_000 * 10 ** decimals);\n    }\n\n    function mint(address to, uint256 amount) external onlyOwner {\n        _mint(to, amount);\n    }\n}\n"},"src/Oracle.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\nimport {Owned} from \"solmate/src/auth/Owned.sol\";\nimport {Errors} from \"../lib/Errors.sol\";\n\ncontract Oracle is Owned(msg.sender) {\n    uint256 public utilizationRate;\n    uint256 public updatedAt;\n\n    mapping(address => bool) public isRelayer;\n\n    modifier onlyRelayer() {\n        require(isRelayer[msg.sender], Errors.NOT_RELAYER);\n        _;\n    }\n\n    event UtilizationRateUpdated(uint256 newRate, uint256 timestamp);\n    event RelayerAdded(address relayer);\n    event RelayerRemoved(address relayer);\n\n    function setUtilizationRate(uint256 _utilizationRate) external onlyRelayer {\n        require(_utilizationRate >= 0 && _utilizationRate <= 1 * 10 ** 18, Errors.INVALID_UTILIZATION_RATE);\n        utilizationRate = _utilizationRate;\n        updatedAt = block.timestamp;\n        emit UtilizationRateUpdated(_utilizationRate, block.timestamp);\n    }\n\n    function addRelayer(address _relayer) external onlyOwner {\n        isRelayer[_relayer] = true;\n        emit RelayerAdded(_relayer);\n    }\n\n    function removeRelayer(address _relayer) external onlyOwner {\n        isRelayer[_relayer] = false;\n        emit RelayerRemoved(_relayer);\n    }\n}\n"},"interface/IStaking.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.26;\n\nimport {Venice} from \"../src/Venice.sol\";\nimport {Oracle} from \"../src/Oracle.sol\";\n\n/**\n * @title IStaking\n * @author shafu\n * @notice Interface for the Venice Staking functionality. \n *         This interface describes a staking mechanism where users stake Venice (VVV) tokens to receive\n *         a liquid, representation token (sVVV). The user accrues rewards over time, distributed at a \n *         constant emission rate, and must respect a cooldown period for unstaking.\n * @dev \n *   - The interface outlines the essential external calls without revealing internal implementation details.\n *   - See the main `Staking` contract for specifics about `_harvest` logic, event emissions, etc.\n */\ninterface IStaking {\n    event TreasuryUpdated        (address newTreasury);\n    event EmissionRateUpdated    (uint newRate);\n    event CooldownDurationUpdated(uint newDuration);\n    event Staked                 (address indexed user, uint amount);\n    event UnstakeInitiated       (address indexed user, uint amount);\n    event UnstakeFinalized       (address indexed user, uint amount);\n    event Claimed                (address indexed user, uint amount);\n\n    /**\n     * @notice Emission rate of rewards, expressed in `wei`-denominated VVV per second.\n     * @return The emission rate per second.\n     */\n    function emissionRatePerSecond() external view returns (uint);\n\n    /**\n     * @notice The duration (in seconds) a user must wait after initiating an unstake before they can finalize.\n     * @return The cooldown period in seconds.\n     */\n    function cooldownDuration() external view returns (uint);\n\n    /**\n     * @notice Returns the address of the Venice (VVV) token contract.\n     * @return The `Venice` contract address.\n     */\n    function venice() external view returns (Venice);\n\n    /**\n     * @notice Returns the address of the Oracle used to determine the utilization rate, \n     *         which affects how newly minted rewards are split between the treasury and stakers.\n     * @return The `Oracle` contract address.\n     */\n    function oracle() external view returns (Oracle);\n\n    /**\n     * @notice Returns the address of the treasury that receives a portion of newly minted rewards.\n     * @return The current treasury address.\n     */\n    function treasury() external view returns (address);\n\n    /**\n     * @notice Represents the staking information for each user.\n     * @dev \n     *  - `rewardDebt` tracks how many rewards have been accounted for the user thus far.\n     *  - `cooldownStart` is the timestamp when the user initiated unstaking.\n     *  - `cooldownAmount` is how many tokens are currently waiting to be unstaked (in cooldown).\n     * @param user The address of the user in question.\n     * @return rewardDebt The user’s already-accounted rewards at the last checkpoint.\n     * @return cooldownStart The timestamp when the user initiated an unstake.\n     * @return cooldownAmount The amount of tokens locked in cooldown.\n     */\n    function stakes(address user) external view returns (\n        uint rewardDebt,\n        uint cooldownStart,\n        uint cooldownAmount\n    );\n\n    /**\n     * @notice The accumulated rewards per share, scaled by 1e18 for fixed-point precision.\n     * @return The current `accRewardPerShare`.\n     */\n    function accRewardPerShare() external view returns (uint);\n\n    /**\n     * @notice The timestamp of the most recent rewards update.\n     * @dev Used internally to calculate how many rewards should be minted since the last update.\n     * @return The `lastRewardTimestamp`.\n     */\n    function lastRewardTimestamp() external view returns (uint);\n\n    /**\n     * @notice Updates the treasury address where a portion of new tokens are minted based on utilization rate.\n     * @dev Only callable by the contract owner; reverts if called by non-owner.\n     * @param newTreasury The new treasury address.\n     */\n    function setTreasury(address newTreasury) external;\n\n    /**\n     * @notice Updates the emission rate of rewards, expressed in `wei`-denominated VVV per second.\n     * @dev Only callable by the contract owner; reverts if called by non-owner.\n     * @param newRate The new emission rate per second.\n     */\n    function setEmissionRate(uint newRate) external;\n\n    /**\n     * @notice Updates the cooldown duration for unstaking, in seconds.\n     * @dev Only callable by the contract owner; reverts if called by non-owner.\n     * @param newDuration The new cooldown duration in seconds.\n     */\n    function setCooldownDuration(uint newDuration) external;\n\n    /**\n     * @notice Allows a user to stake `amount` of VVV tokens on behalf of `recipient`, \n     *         receiving an equivalent amount of sVVV in return.\n     * @dev \n     *   - User must have approved this contract to transfer `amount` of VVV beforehand.\n     *   - Accumulates and transfers any pending rewards for `recipient` before minting new sVVV.\n     * @param recipient The address that will receive the newly minted sVVV.\n     * @param amount The amount of VVV tokens to stake.\n     */\n    function stake(address recipient, uint amount) external;\n\n    /**\n     * @notice Initiates the unstaking process: the user burns the specified `amount` of sVVV immediately, \n     *         but must wait `cooldownDuration` seconds before calling `finalizeUnstake` to redeem VVV tokens.\n     *         After `initiateUnstake` is called, all functions called on that user’s stake will revert, including\n     *         claiming, staking and unstaking.\n     * @dev \n     *   - Accumulates and transfers any pending rewards for the user before the burn.\n     *   - Updates the user’s `cooldownStart` and `cooldownAmount`.\n     * @param amount The amount of sVVV tokens to burn and place into cooldown.\n     */\n    function initiateUnstake(uint amount) external;\n\n    /**\n     * @notice Completes the unstaking process by sending the user the equivalent amount of VVV tokens \n     *         after the cooldown period has elapsed.\n     * @dev \n     *   - Reverts if the cooldown period is not over or if there is no `cooldownAmount` to finalize.\n     *   - Resets the cooldown state on success.\n     */\n    function finalizeUnstake() external;\n\n    /**\n     * @notice Claims all pending VVV rewards for the caller.\n     * @dev \n     *   - Harvest logic accounts for all newly minted tokens since the last update.\n     *   - Sends the owed amount of VVV directly to the caller.\n     */\n    function claim() external;\n\n    /**\n     * @notice Returns the pending rewards for a given user, including any rewards that haven’t yet been \n     *         fully distributed in `accRewardPerShare`.\n     * @dev \n     *   - This function simulates what `_harvest` would do, but without transferring tokens.\n     * @param user The address for which to compute the pending rewards.\n     * @return The amount of unclaimed VVV rewards, in `wei`.\n     */\n    function pendingRewards(address user) external view returns (uint);\n\n    /**\n     * @notice Returns the percentage of newly minted rewards that goes to the treasury, as a fraction of 1e18.\n     * @return The treasury percentage.\n     */\n    function getVenicePercentage() external view returns (uint);\n}"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/token/ERC20/extensions/IERC20Metadata.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/utils/Context.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/interfaces/draft-IERC6093.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/access/IAccessControl.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC-165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev The `account` is missing a role.\n     */\n    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n    /**\n     * @dev The caller of a function is not the expected one.\n     *\n     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n     */\n    error AccessControlBadConfirmation();\n\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).\n     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/utils/introspection/ERC165.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/interfaces/draft-IERC1822.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/proxy/ERC1967/ERC1967Utils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0-rc.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.22;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit IERC1967.Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n     */\n    function getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit IERC1967.AdminChanged(getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the ERC-1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit IERC1967.BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-upgradeable-5.2.0-rc.1/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-upgradeable-5.2.0-rc.1/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},"dependencies/solmate-6.8.0/src/tokens/ERC20.sol":{"content":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\nabstract contract ERC20 {\n    /*//////////////////////////////////////////////////////////////\n                                 EVENTS\n    //////////////////////////////////////////////////////////////*/\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n\n    event Approval(address indexed owner, address indexed spender, uint256 amount);\n\n    /*//////////////////////////////////////////////////////////////\n                            METADATA STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    string public name;\n\n    string public symbol;\n\n    uint8 public immutable decimals;\n\n    /*//////////////////////////////////////////////////////////////\n                              ERC20 STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    uint256 public totalSupply;\n\n    mapping(address => uint256) public balanceOf;\n\n    mapping(address => mapping(address => uint256)) public allowance;\n\n    /*//////////////////////////////////////////////////////////////\n                            EIP-2612 STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    uint256 internal immutable INITIAL_CHAIN_ID;\n\n    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\n\n    mapping(address => uint256) public nonces;\n\n    /*//////////////////////////////////////////////////////////////\n                               CONSTRUCTOR\n    //////////////////////////////////////////////////////////////*/\n\n    constructor(\n        string memory _name,\n        string memory _symbol,\n        uint8 _decimals\n    ) {\n        name = _name;\n        symbol = _symbol;\n        decimals = _decimals;\n\n        INITIAL_CHAIN_ID = block.chainid;\n        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               ERC20 LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    function approve(address spender, uint256 amount) public virtual returns (bool) {\n        allowance[msg.sender][spender] = amount;\n\n        emit Approval(msg.sender, spender, amount);\n\n        return true;\n    }\n\n    function transfer(address to, uint256 amount) public virtual returns (bool) {\n        balanceOf[msg.sender] -= amount;\n\n        // Cannot overflow because the sum of all user\n        // balances can't exceed the max uint256 value.\n        unchecked {\n            balanceOf[to] += amount;\n        }\n\n        emit Transfer(msg.sender, to, amount);\n\n        return true;\n    }\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) public virtual returns (bool) {\n        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\n\n        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\n\n        balanceOf[from] -= amount;\n\n        // Cannot overflow because the sum of all user\n        // balances can't exceed the max uint256 value.\n        unchecked {\n            balanceOf[to] += amount;\n        }\n\n        emit Transfer(from, to, amount);\n\n        return true;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                             EIP-2612 LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual {\n        require(deadline >= block.timestamp, \"PERMIT_DEADLINE_EXPIRED\");\n\n        // Unchecked because the only math done is incrementing\n        // the owner's nonce which cannot realistically overflow.\n        unchecked {\n            address recoveredAddress = ecrecover(\n                keccak256(\n                    abi.encodePacked(\n                        \"\\x19\\x01\",\n                        DOMAIN_SEPARATOR(),\n                        keccak256(\n                            abi.encode(\n                                keccak256(\n                                    \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n                                ),\n                                owner,\n                                spender,\n                                value,\n                                nonces[owner]++,\n                                deadline\n                            )\n                        )\n                    )\n                ),\n                v,\n                r,\n                s\n            );\n\n            require(recoveredAddress != address(0) && recoveredAddress == owner, \"INVALID_SIGNER\");\n\n            allowance[recoveredAddress][spender] = value;\n        }\n\n        emit Approval(owner, spender, value);\n    }\n\n    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\n        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\n    }\n\n    function computeDomainSeparator() internal view virtual returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"),\n                    keccak256(bytes(name)),\n                    keccak256(\"1\"),\n                    block.chainid,\n                    address(this)\n                )\n            );\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                        INTERNAL MINT/BURN LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    function _mint(address to, uint256 amount) internal virtual {\n        totalSupply += amount;\n\n        // Cannot overflow because the sum of all user\n        // balances can't exceed the max uint256 value.\n        unchecked {\n            balanceOf[to] += amount;\n        }\n\n        emit Transfer(address(0), to, amount);\n    }\n\n    function _burn(address from, uint256 amount) internal virtual {\n        balanceOf[from] -= amount;\n\n        // Cannot underflow because a user's balance\n        // will never be larger than the total supply.\n        unchecked {\n            totalSupply -= amount;\n        }\n\n        emit Transfer(from, address(0), amount);\n    }\n}\n"},"dependencies/solmate-6.8.0/src/auth/Owned.sol":{"content":"// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Simple single owner authorization mixin.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)\nabstract contract Owned {\n    /*//////////////////////////////////////////////////////////////\n                                 EVENTS\n    //////////////////////////////////////////////////////////////*/\n\n    event OwnershipTransferred(address indexed user, address indexed newOwner);\n\n    /*//////////////////////////////////////////////////////////////\n                            OWNERSHIP STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    address public owner;\n\n    modifier onlyOwner() virtual {\n        require(msg.sender == owner, \"UNAUTHORIZED\");\n\n        _;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               CONSTRUCTOR\n    //////////////////////////////////////////////////////////////*/\n\n    constructor(address _owner) {\n        owner = _owner;\n\n        emit OwnershipTransferred(address(0), _owner);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                             OWNERSHIP LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        owner = newOwner;\n\n        emit OwnershipTransferred(msg.sender, newOwner);\n    }\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/utils/introspection/IERC165.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/proxy/beacon/IBeacon.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/interfaces/IERC1967.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/utils/Address.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n     */\n    function _revert(bytes memory returndata) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            assembly (\"memory-safe\") {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/utils/StorageSlot.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct Int256Slot {\n        int256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n"},"dependencies/@openzeppelin-contracts-5.2.0-rc.1/utils/Errors.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"}},"matchId":"8883528","creationMatch":"exact_match","runtimeMatch":"exact_match","verifiedAt":"2025-08-22T00:14:43Z","match":"exact_match","chainId":"8453","address":"0xe37A7920dbc11253ac6d031C29f592f71B348DCA"}