Skip to content
Verified contractPartial

IssuanceManager

Address0xe0753ef9fa073ba97bed7335a67488512fbf44d2
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 15 runs
EVM version
prague
Via IR
yes
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,300,441
Creation transaction
0xe93cd2341c…f1a0f0d030
Libraries
src/CyberAgreementRegistry.sol:CyberAgreementJson0x7ccd…ec9e8esrc/CyberAgreementRegistry.sol:CyberAgreementBound0xe878…e93415src/storage/LexScrowStorage.sol:LexScrowStorage0xe060…24d49dsrc/creds/LeXcheXBadgeRender.sol:LeXcheXBadgeRender0xb62c…5c99a2src/storage/DealManagerStorage.sol:DealManagerStorage0x1745…aee644src/storage/RoundManagerStorage.sol:RoundManagerStorage0xfdb8…aa3813src/storage/SecondaryTradeStorage.sol:SecondaryTradeStorage0xe658…520e86src/CertificateImageContentBuilder.sol:CertificateImageContentBuilder0xf73c…eb4c1dsrc/storage/IssuanceManagerStorage.sol:IssuanceManagerStorage0xbc28…e1220csrc/storage/LedgerEntryTokenStorage.sol:LedgerEntryTokenStorage0xe720…5c4a05src/storage/extensions/ShareCertDataLayerLib.sol:ShareCertDataLayerLib0x7802…70468c

50 files

The source code is large: one file is shown at a time. Choose a file in the list.

src/IssuanceManager.sol

/*    .o.                                                                                             
     .888.                                                                                            
    .8"888.                                                                                           
   .8' `888.                                                                                          
  .88ooo8888.                                                                                         
 .8'     `888.                                                                                        
o88o     o8888o                                                                                       
                                                                                                      
                                                                                                      
                                                                                                      
ooo        ooooo               .             ooooo                  ooooooo  ooooo                    
`88.       .888'             .o8             `888'                   `8888    d8'                     
 888b     d'888   .ooooo.  .o888oo  .oooo.    888          .ooooo.     Y888..8P                       
 8 Y88. .P  888  d88' `88b   888   `P  )88b   888         d88' `88b     `8888'                        
 8  `888'   888  888ooo888   888    .oP"888   888         888ooo888    .8PY888.                       
 8    Y     888  888    .o   888 . d8(  888   888       o 888    .o   d8'  `888b                      
o8o        o888o `Y8bod8P'   "888" `Y888""8o o888ooooood8 `Y8bod8P' o888o  o88888o                    
                                                                                                      
                                                                                                      
                                                                                                      
  .oooooo.                .o8                            .oooooo.                                     
 d8P'  `Y8b              "888                           d8P'  `Y8b                                    
888          oooo    ooo  888oooo.   .ooooo.  oooo d8b 888           .ooooo.  oooo d8b oo.ooooo.      
888           `88.  .8'   d88' `88b d88' `88b `888""8P 888          d88' `88b `888""8P  888' `88b     
888            `88..8'    888   888 888ooo888  888     888          888   888  888      888   888     
`88b    ooo     `888'     888   888 888    .o  888     `88b    ooo  888   888  888      888   888 .o. 
 `Y8bood8P'      .8'      `Y8bod8P' `Y8bod8P' d888b     `Y8bood8P'  `Y8bod8P' d888b     888bod8P' Y8P 
             .o..P'                                                                     888           
             `Y8P'                                                                     o888o          
_______________________________________________________________________________________________________

All software, documentation and other files and information in this repository (collectively, the "Software")
are copyright MetaLeX Labs, Inc., a Delaware corporation.

All rights reserved.

The Software is proprietary and shall not, in part or in whole, be used, copied, modified, merged, published, 
distributed, transmitted, sublicensed, sold, or otherwise used in any form or by any means, electronic or
mechanical, including photocopying, recording, or by any information storage and retrieval system, 
except with the express prior written permission of the copyright holder.*/

pragma solidity 0.8.28;

import "./libs/auth.sol";
import "openzeppelin-contracts/proxy/beacon/UpgradeableBeacon.sol";
import "openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol";
import "openzeppelin-contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "./interfaces/ITransferRestrictionHook.sol";

import "./interfaces/ICertificateConverter.sol";
import "./interfaces/IIssuanceManagerFactory.sol";
import "./storage/IssuanceManagerStorage.sol";
import "./interfaces/IIssuanceManager.sol";

/// @title IssuanceManager
/// @notice Manages the issuance and lifecycle of digital certificates representing securities and more
/// @dev Implements UUPS upgradeable pattern and BorgAuth access control
contract IssuanceManager is Initializable, BorgAuthACL, UUPSUpgradeable, IIssuanceManager {
    string public constant DEPLOY_VERSION = "5"; // For version-tracking on all deployment and future upgrades

    // IssuanceManager errors
    error CompanyDetailsNotSet();
    error SignatureRequired();
    error TokenProxyNotFound();
    error NotSAFEToken();
    error NotUpgradeFactory();
    error ScripifiedCertNotAllowed();
    error ConditionCheckFailed();
    error NotRefImplementation();
    error InvalidScripRatio();
    error ScripOutstanding();
    error ScripToCertMinimumNotMet();
    error ScripifyNotWhitelisted();
    error RecertificationApprovalRequired();
    error InvalidInvestor();
    error InvalidInvestorName();

    event UriBuilderUpdated(address indexed uriBuilder, address indexed oldUriBuilder);
    event ScripifyWhitelistEnabledSet(address indexed certAddress, bool enabled);
    event ScripifyWhitelistUpdated(
        address indexed certAddress,
        uint256 indexed id,
        bool isWhitelisted
    );
    event CyberScripDeployed(
        address indexed certPrinterAddress,
        address indexed cyberScripAddress,
        uint256 scripRatioNumerator,
        uint256 scripRatioDenominator,
        bool enableForceTransfer,
        bool enableForceBurn,
        bool enableFreeze
    );
    event RecertificationApprovalSet(
        address indexed certAddress,
        address indexed investor,
        string investorName
    );
    event RecertificationApprovalCleared(
        address indexed certAddress,
        address indexed investor
    );

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    /// @notice Initializes the IssuanceManager contract
    /// @param _auth Address of the BorgAuth contract
    /// @param _CORP Address of the CyberCorp contract
    /// @param _uriBuilder Address of the json URI builder contract for certificate metadata
    /// @param _upgradeFactory Address of the factory (for upgrading purposes)
    function initialize(
        address _auth,
        address _CORP,
        address _uriBuilder,
        address _upgradeFactory
    ) external initializer {
        __BorgAuthACL_init(_auth);

        // Create beacons for LedgerEntryToken and CyberScrip
        // Unlike IssuanceManager which is individually upgradeable, LedgerEntryToken and CyberScrip deployments are
        // beacon proxies because they are managed by the same company owner and are expected to
        // share the same implementation or upgraded to a new version all at the same time.
        // Maintenance-wise, since IssuanceManager itself is upgradeable, we don't need to worry about beacon ownership transfers
        // Delegated to IssuanceManagerStorage to keep this contract under the EIP-170 size limit.
        IssuanceManagerStorage.executeInitialize(
            _upgradeFactory,
            _CORP,
            _uriBuilder
        );
    }

    modifier onlyUpgradeFactory() {
        // Allow explicitly configured upgrade factory OR contract owner
        if (msg.sender != IssuanceManagerStorage.getUpgradeFactory()) {
            // Check owner via BorgAuth
            try AUTH.onlyRole(AUTH.OWNER_ROLE(), msg.sender) {
                _;
                return;
            } catch {
                revert NotUpgradeFactory();
            }
        }
        _;
    }

    /// @dev Restricts execution to contract itself or AUTH.OWNER_ROLE callers. Body in a shared private helper
    /// (not inlined per call site) to keep this contract under the EIP-170 size limit.
    function _requireOwnerOrSelf() private view {
        if (msg.sender != address(this)) {
            AUTH.onlyRole(AUTH.OWNER_ROLE(), msg.sender);
        }
    }

    modifier onlyOwnerOrSelf() {
        _requireOwnerOrSelf();
        _;
    }

    /// @notice Creates a new certificate printer with extension-formatted series-scope data.
    /// @dev Only callable by owner. `_seriesData` is decoded by the same `_extension` contract that
    /// handles per-cert extensionData; pass an empty byte string when the extension has no series section.
    function createCertPrinter(
        string[] memory _ledger,
        string memory _name,
        string memory _ticker,
        string memory _certificateUri,
        SecurityClass _securityType,
        SecuritySeries _securitySeries,
        address _extension,
        bytes memory _seriesData
    ) public onlyOwner returns (address) {
        return
            IssuanceManagerStorage.executeCreateCertPrinter(
                _ledger,
                _name,
                _ticker,
                _certificateUri,
                _securityType,
                _securitySeries,
                _extension,
                _seriesData
            );
    }

    /// @notice Registers a new class-level LET designation (see SecurityClassInfo)
    /// @dev Only callable by owner; classIds are sequential starting at 1 (0 = unclassified)
    /// @param _classType Type tag for the class
    /// @param _documentURI URI of the class-level governing document
    /// @param _dataExtension Optional ICertificateExtension-style decoder/renderer for _classData
    /// @param _classData extensionData-style opaque payload for the class
    /// @return classId ID of the new class
    function defineSecurityClass(
        SecurityClass _classType,
        string memory _documentURI,
        address _dataExtension,
        bytes memory _classData
    ) external onlyOwner returns (uint256 classId) {
        return
            IssuanceManagerStorage.executeDefineSecurityClass(
                _classType,
                _documentURI,
                _dataExtension,
                _classData
            );
    }

    /// @notice Replaces an existing class designation's fields
    /// @dev Only callable by owner
    function updateSecurityClass(
        uint256 _classId,
        SecurityClass _classType,
        string memory _documentURI,
        address _dataExtension,
        bytes memory _classData
    ) external onlyOwner {
        IssuanceManagerStorage.executeUpdateSecurityClass(
            _classId,
            _classType,
            _documentURI,
            _dataExtension,
            _classData
        );
    }

    /// @notice Assigns a certificate printer (the series scope) to a class; 0 clears the assignment
    /// @dev Only callable by owner; also the backfill path for pre-existing printers
    function setPrinterClass(address _printer, uint256 _classId) external onlyOwner {
        IssuanceManagerStorage.executeSetPrinterClass(_printer, _classId);
    }

    /// @notice Gets a class designation by ID
    function getSecurityClass(
        uint256 _classId
    ) external view returns (SecurityClassInfo memory) {
        return IssuanceManagerStorage.getSecurityClass(_classId);
    }

    /// @notice Number of classes defined; valid classIds are 1..count
    function getSecurityClassCount() external view returns (uint256) {
        return IssuanceManagerStorage.getSecurityClassCount();
    }

    /// @notice The classId a printer is assigned to (0 = unclassified)
    function getPrinterClassId(address _printer) external view returns (uint256) {
        return IssuanceManagerStorage.getPrinterClassId(_printer);
    }

    // ─────────────────────────────────────────────────────────────────────────
    // Issuance entry points. All four mint a lot and register a holder; they differ in what else they
    // write. Pick by what the lot needs to carry, not by how many arguments you have.
    //
    //   createCert                   no endorsement, no name, no signature. The holder is whoever you
    //                                mint to, including this contract's own callers minting into escrow.
    //   createCertAndAssign          adds an issuance endorsement naming the investor. No name on the
    //                                register, stamped now.
    //   createCertAndAssignWithName  adds the holder's legal name and lets the caller set the endorsement
    //                                date, so a reissue keeps the original one.
    //   createCertSignAndAssign      binds the endorsement to a registry + agreement id. Always stamped now.
    //
    // `assignCert` is not in this family: it mints nothing and moves the register on an existing lot.
    // ─────────────────────────────────────────────────────────────────────────

    /// @notice Creates a certificate and registers `to` as the holder of record, with a blank name.
    /// @dev This is the bare mint. It writes no endorsement and no name.
    /// The name does not mean unissued. `recordMint` registers `to`.
    /// The two managers mint into escrow with `to = address(this)`, so the manager holds the register.
    /// @dev Only callable by owner
    /// @param certAddress Address of the certificate printer contract
    /// @param to Recipient of the certificate, and its holder of record
    /// @param _details Certificate details
    /// @return uint256 ID of the new certificate
    function createCert(
        address certAddress,
        address to,
        CertificateDetails memory _details
    ) public onlyOwner returns (uint256) {
        return IssuanceManagerStorage.executeCreateCert(certAddress, to, _details);
    }

    /// @notice Re-registers an existing certificate to a new holder of record.
    /// @dev This mints nothing. It moves the register on a lot that already has a holder.
    /// It has no payment step and writes no endorsement. Use it to correct the register.
    /// Do not use it to settle a trade. The DealManager does that.
    /// @dev Only callable by owner
    /// @param certAddress Address of the certificate printer contract
    /// @param from Current holder of record — the register, not the possessor
    /// @param tokenId ID of the certificate
    /// @param investor Incoming holder of record
    /// @param _details Updated certificate details
    /// @param investorName Incoming holder's legal name for the register
    function assignCert(
        address certAddress,
        address from,
        uint256 tokenId,
        address investor,
        CertificateDetails memory _details,
        string memory investorName
    ) public onlyOwner {
        IssuanceManagerStorage.executeAssignCert(
            certAddress,
            from,
            tokenId,
            investor,
            _details,
            investorName
        );
    }

    /// @notice Issues a certificate to an investor, with an issuance endorsement.
    /// @dev This is the short form of `createCertAndAssignWithName`. It sends no name and no signature.
    /// The investor gets both possession and the register.
    /// @dev Only callable by owner or self. Requires company details to be set.
    /// @param certAddress Address of the certificate printer contract
    /// @param investor Recipient of the certificate, and its holder of record
    /// @param _details Certificate details
    /// @return tokenId ID of the new certificate
    function createCertAndAssign(
        address certAddress,
        address investor,
        CertificateDetails memory _details
    ) public onlyOwnerOrSelf returns (uint256 tokenId) {
        return
            createCertAndAssignWithName(
                certAddress,
                investor,
                _details,
                "",
                bytes(""),
                block.timestamp
            );
    }

    /// @notice Issues a certificate to a named investor, and sets the endorsement date.
    /// @dev This adds two things to `createCertAndAssign`: the holder's name, and a settable date.
    /// A reissue uses the date to keep the original issuance date.
    /// The endorsement points at no agreement. Use `createCertSignAndAssign` if it must.
    /// @dev Only callable by owner or self. `executeConvertScripToCert` calls back in through it.
    /// @param certAddress Address of the certificate printer contract
    /// @param investor Recipient of the certificate, and its holder of record
    /// @param _details Certificate details
    /// @param investorName Holder's legal name for the register and the endorsement
    /// @param endorsementSignature Officer signature; also added as an issuer signature when non-empty
    /// @param timestamp Endorsement date, so a reissue can keep the original one
    /// @return tokenId ID of the new certificate
    function createCertAndAssignWithName(
        address certAddress,
        address investor,
        CertificateDetails memory _details,
        string memory investorName,
        bytes memory endorsementSignature,
        uint256 timestamp
    ) public onlyOwnerOrSelf returns (uint256 tokenId) {
        return
            IssuanceManagerStorage.executeCreateCertAndAssign(
                certAddress,
                investor,
                _details,
                investorName,
                endorsementSignature,
                timestamp
            );
    }

    /// @notice Issues a certificate, and points its endorsement at an agreement.
    /// @dev This differs from `createCertAndAssignWithName` in two ways.
    /// It records `registry` and `agreementId`. It always stamps the endorsement now.
    /// @dev Only callable by owner/self, requires company details to be set
    /// @param certAddress Address of the certificate printer contract
    /// @param investor Recipient of the certificate, and its holder of record
    /// @param _details Certificate details
    /// @param endorsementSignature Signature hash to store in endorsement and cert signatures
    /// @param registry Source registry the endorsement points at
    /// @param agreementId Agreement the endorsement points at
    /// @param investorName Holder's legal name for the register and the endorsement
    /// @return tokenId ID of the new certificate
    function createCertSignAndAssign(
        address certAddress,
        address investor,
        CertificateDetails memory _details,
        bytes memory endorsementSignature,
        address registry,
        bytes32 agreementId,
        string memory investorName
    ) public onlyOwnerOrSelf returns (uint256 tokenId) {
        return
            IssuanceManagerStorage.executeCreateCertSignAndAssign(
                certAddress,
                investor,
                _details,
                endorsementSignature,
                registry,
                agreementId,
                investorName
            );
    }

    /// @notice Effectuates the secondary-trade ownership change at finalization (spec §7.4A / §7.5)
    /// @dev Gated on OWNER_ROLE, which the SPV's DealManager holds. dealMetadata is the abi-encoded tuple
    /// produced by DealManager.finalizeSecondaryTradeAgreement; see IssuanceManagerStorage.executeSecondaryTransfer.
    function secondaryTransfer(bytes calldata dealMetadata) external onlyOwner {
        IssuanceManagerStorage.executeSecondaryTransfer(dealMetadata);
    }

   /* /// @notice Updates the details of an existing certificate
    /// @dev Only callable by admin
    /// @param certAddress Address of the certificate printer contract
    /// @param tokenId ID of the certificate
    /// @param _details Updated certificate details
    function updateCertificateDetails(
        address certAddress,
        uint256 tokenId,
        CertificateDetails memory _details
    ) external onlyAdmin {
        ILedgerEntryToken certificate = ILedgerEntryToken(certAddress);
        certificate.updateCertificateDetails(tokenId, _details);
    }*/

    /// @notice Upgrades the implementation of the certificate printer
    /// @dev Only callable by company owner, only upgradeable to the current reference implementation
    /// @param _newImplementation Address of the new implementation
    function upgradeCertPrinterBeaconImplementation(
        address _newImplementation
    ) external onlyOwner {
        if (
            IIssuanceManagerFactory(IssuanceManagerStorage.getUpgradeFactory())
                .getCyberCertPrinterRefImplementation() != _newImplementation
        ) {
            revert NotRefImplementation();
        }
        IssuanceManagerStorage.upgradeCertPrinterBeaconImplementation(
            _newImplementation
        );
        emit CertPrinterBeaconImplementationUpgraded(_newImplementation);
    }

    /// @notice Gets the current implementation address of the certificate printer
    /// @return address Current implementation address
    function getCertPrinterBeaconImplementation()
        external
        view
        returns (address)
    {
        return
            IssuanceManagerStorage.getCyberCertPrinterBeacon().implementation();
    }

    /// @notice Upgrades the implementation of the scrip
    /// @dev Only callable by company owner, only upgradeable to the current reference implementation
    /// @param _newImplementation Address of the new implementation
    function upgradeScripBeaconImplementation(
        address _newImplementation
    ) external onlyOwner {
        if (
            IIssuanceManagerFactory(IssuanceManagerStorage.getUpgradeFactory())
                .getCyberScripRefImplementation() != _newImplementation
        ) {
            revert NotRefImplementation();
        }
        IssuanceManagerStorage.updateScripBeaconImplementation(
            _newImplementation
        );
        emit ScripBeaconImplementationUpgraded(_newImplementation);
    }

    function getScripBeaconImplementation() external view returns (address) {
        return IssuanceManagerStorage.getCyberScripBeacon().implementation();
    }

    /// @notice Gets the company name from the CyberCorp contract
    /// @return string The company name
    function companyName() external view returns (string memory) {
        return ICyberCorp(IssuanceManagerStorage.getCORP()).cyberCORPName();
    }

    /// @notice Gets the company jurisdiction from the CyberCorp contract
    /// @return string The company jurisdiction
    function companyJurisdiction() external view returns (string memory) {
        return
            ICyberCorp(IssuanceManagerStorage.getCORP())
                .cyberCORPJurisdiction();
    }

    /// @notice Gets the CyberCorp contract address
    /// @return address The CyberCorp contract address
    function CORP() external view returns (address) {
        return IssuanceManagerStorage.getCORP();
    }

    /// @notice Gets the URI builder contract address
    /// @return address The URI builder contract address
    function uriBuilder() external view returns (address) {
        return IssuanceManagerStorage.getUriBuilder();
    }

    /// @notice Gets the certificate printer beacon contract
    /// @return UpgradeableBeacon The beacon contract
    function cyberCertPrinterBeacon()
        external
        view
        returns (UpgradeableBeacon)
    {
        return IssuanceManagerStorage.getCyberCertPrinterBeacon();
    }

    /// @notice Gets the scrip beacon contract
    /// @return UpgradeableBeacon The beacon contract
    function cyberScripBeacon() external view returns (UpgradeableBeacon) {
        return IssuanceManagerStorage.getCyberScripBeacon();
    }

    /// @notice Gets a certificate printer address by index
    /// @param index Index in the printers array
    /// @return address The certificate printer contract address
    function printers(uint256 index) external view returns (address) {
        return IssuanceManagerStorage.getPrinters()[index];
    }

    /// @notice Whether `printer` is a certificate printer this IssuanceManager created and still tracks
    /// @dev Authoritative membership check against the registry; a self-reporting printer cannot forge it
    function isPrinter(address printer) external view returns (bool) {
        return IssuanceManagerStorage.isPrinter(printer);
    }

    /// @notice Sets the URI builder contract address
    /// @dev Only callable by owner
    /// @param _uriBuilder New URI builder contract address
    function setUriBuilder(address _uriBuilder) external onlyOwner {
        address oldUriBuilder = IssuanceManagerStorage.getUriBuilder();
        IssuanceManagerStorage.setUriBuilder(_uriBuilder);
        emit UriBuilderUpdated(_uriBuilder, oldUriBuilder);
    }

    function setScripRatio(
        address certAddress,
        uint256 numerator,
        uint256 denominator
    ) external onlyOwner {
        IssuanceManagerStorage.executeSetScripRatio(
            certAddress,
            numerator,
            denominator
        );
    }

    function getScripRatio(
        address certAddress
    ) external view returns (uint256 numerator, uint256 denominator) {
        IssuanceManagerStorage.ScripRatio storage ratio = IssuanceManagerStorage
            .getScripRatio(certAddress);
        numerator = ratio.numerator;
        denominator = ratio.denominator;
        if (numerator == 0 || denominator == 0) {
            return (1, 1);
        }
    }

    /// @notice Sets the minimum scrip amount required to convert back into certs
    /// @dev Only callable by owner; set to 0 to disable the minimum
    /// @param certAddress Address of the certificate printer contract
    /// @param minimum Minimum amount required for scrip-to-cert conversion
    function setScripToCertMinimum(
        address certAddress,
        uint256 minimum
    ) external onlyOwner {
        IssuanceManagerStorage.executeSetScripToCertMinimum(
            certAddress,
            minimum
        );
    }

    function setScripifyWhitelistEnabled(
        address certAddress,
        bool enabled
    ) external onlyOwner {
        IssuanceManagerStorage.executeSetScripifyWhitelistEnabled(
            certAddress,
            enabled
        );
    }

    function addScripifyWhitelistIds(
        address certAddress,
        uint256[] memory ids
    ) external onlyOwner {
        IssuanceManagerStorage.executeSetScripifyWhitelistIds(
            certAddress,
            ids,
            true
        );
    }

    function removeScripifyWhitelistIds(
        address certAddress,
        uint256[] memory ids
    ) external onlyOwner {
        IssuanceManagerStorage.executeSetScripifyWhitelistIds(
            certAddress,
            ids,
            false
        );
    }

    //deploy matching erc20 contract for a cert
    function deployCyberScrip(
        address certAddress,
        ITransferRestrictionHook[] memory typeRestrictionHooks,
        ICondition[] memory certToScripConditions,
        ICondition[] memory scripToCertConditions,
        uint256 scripToCertMinimum,
        uint256 scripRatioNumerator,
        uint256 scripRatioDenominator,
        uint256[] memory scripifyWhitelistIds,
        bool scripifyWhitelistEnabled,
        bool enableForceTransfer,
        bool enableForceBurn,
        bool enableFreeze
    ) onlyOwner external returns (address) {
        return
            IssuanceManagerStorage.executeDeployCyberScrip(
                certAddress,
                address(AUTH),
                typeRestrictionHooks,
                certToScripConditions,
                scripToCertConditions,
                scripToCertMinimum,
                scripRatioNumerator,
                scripRatioDenominator,
                scripifyWhitelistIds,
                scripifyWhitelistEnabled,
                enableForceTransfer,
                enableForceBurn,
                enableFreeze
            );
    }

    function forceScripBurn(
        address certAddress,
        address account,
        uint256 amount
    ) external onlyAdmin {
        IssuanceManagerStorage.executeForceScripBurn(
            certAddress,
            account,
            amount
        );
    }

    /// @notice Convert a certificate into scrip tokens, partially or fully
    /// @param certAddress Address of the certificate printer contract
    /// @param id ID of the certificate to convert
    /// @param amount Number of units to convert into scrip
    function scripifyCert(
        address certAddress,
        uint256 id,
        uint256 amount,
        address target
    ) external {
        IssuanceManagerStorage.executeScripifyCert(
            certAddress,
            id,
            amount,
            target,
            msg.sender
        );
    }

    function getUpgradeFactory() public view returns (address) {
        return IssuanceManagerStorage.getUpgradeFactory();
    }

    function getScripToCertMinimum(address certAddress) external view returns (uint256) {
        return IssuanceManagerStorage.getScripToCertMinimum(certAddress);
    }

    function setRecertificationApproval(
        address certAddress,
        address investor,
        string calldata investorName,
        CertificateDetails calldata details,
        bytes calldata officerSignature
    ) external onlyAdmin {
        IssuanceManagerStorage.executeSetRecertificationApproval(
            certAddress,
            investor,
            investorName,
            details,
            officerSignature
        );
    }

    function clearRecertificationApproval(
        address certAddress,
        address investor
    ) external onlyAdmin {
        IssuanceManagerStorage.executeClearRecertificationApproval(
            certAddress,
            investor
        );
    }

    function getRecertificationApproval(
        address certAddress,
        address investor
    )
        external
        view
        returns (
            bool approved,
            string memory investorName,
            CertificateDetails memory details,
            bytes memory officerSignature,
            uint256 endorsementTimestamp
        )
    {
        return
            IssuanceManagerStorage.getRecertificationApprovalData(
                certAddress,
                investor
            );
    }

    function getScripifyWhitelistEnabled(
        address certAddress
    ) external view returns (bool) {
        return IssuanceManagerStorage.getScripifyWhitelistEnabled(certAddress);
    }

    function getCertScripifiedStatus(
        address certAddress,
        uint256 id
    )
        external
        view
        returns (bool isScripified, uint256 scripifiedUnits, uint256 maxUnitsRepresented)
    {
        return IssuanceManagerStorage.getCertScripifiedStatus(certAddress, id);
    }

    /// @notice `totalTrackedScrip` is CyberScrip `totalSupply`. Second value is vault price per
    ///         nominal share (ray), or 0 if empty. Initialized proportional pools report 1e27.
    function getScripPoolTotals(
        address certAddress
    )
        external
        view
        returns (uint256 totalTrackedScrip, uint256 pricePerShareRay)
    {
        return IssuanceManagerStorage.getScripPoolTotals(certAddress);
    }

    /// @notice Underlying units (wad) and normalized nominal shares, equal after index initialization.
    /// @dev Individually floored certificate positions may sum to less than the total due to pool dust.
    function getCertScripUnitVault(address certAddress)
        external
        view
        returns (uint256 totalAssetsWad, uint256 totalNominalShares)
    {
        return IssuanceManagerStorage.getCertScripUnitVault(certAddress);
    }

    function getScripPoolAmountById(
        address certAddress,
        uint256 id
    ) external view returns (uint256) {
        return IssuanceManagerStorage.getScripPoolAmountById(certAddress, id);
    }

    /// @notice Effective rebasing shares; excludes sub-wei attribution dust held by the pool.
    function getScripPoolSharesById(
        address certAddress,
        uint256 id
    ) external view returns (uint256) {
        return IssuanceManagerStorage.getScripPoolSharesById(certAddress, id);
    }

    function isScripifyWhitelisted(
        address certAddress,
        uint256 id
    ) external view returns (bool) {
        return IssuanceManagerStorage.isScripifyWhitelisted(certAddress, id);
    }

    /// @notice Voids lots that hold no units and no vault claim, so the printer's holder tally stops
    /// counting them. Admin only: another party can drive a lot's vault claim to zero, so an open call
    /// lets them void a holder's lot while that holder still holds redeemable scrip.
    /// @param certAddress Address of the certificate printer contract
    /// @param tokenIds IDs of the lots to void
    function voidEmptyCerts(address certAddress, uint256[] calldata tokenIds) external onlyAdmin {
        IssuanceManagerStorage.executeVoidEmptyCerts(certAddress, tokenIds);
    }

    function convertScripToCert(address certAddress, uint256 amount) external {
        IssuanceManagerStorage.executeConvertScripToCert(
            certAddress,
            amount,
            msg.sender,
            this.convertScripToCert.selector
        );
    }

    /// @notice UUPS upgrade authorization
    /// @dev MetaLeX releases new versions through the factory's reference implementation,
    /// and the CyberCorp owner can decide if or when he wants to perform the upgrade
    function _authorizeUpgrade(
        address newImplementation
    ) internal override onlyOwner {
        if (
            IIssuanceManagerFactory(IssuanceManagerStorage.getUpgradeFactory())
                .getRefImplementation() != newImplementation
        ) {
            revert NotRefImplementation();
        }
    }

}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "libraries": {
    "src/CyberAgreementRegistry.sol": {
      "CyberAgreementJson": "0x7ccD9CF37B17b1433df67724B18C5c3dF7ec9e8E",
      "CyberAgreementBound": "0xe8788a560F68a497C23cddCAFA4728B175e93415"
    },
    "src/storage/LexScrowStorage.sol": {
      "LexScrowStorage": "0xe06006dDcC4ff20aacff20906F56d9893124d49D"
    },
    "src/creds/LeXcheXBadgeRender.sol": {
      "LeXcheXBadgeRender": "0xB62cEBD990aAD2114Ef5120536b38Ce7ef5C99a2"
    },
    "src/storage/DealManagerStorage.sol": {
      "DealManagerStorage": "0x17454BE928Bf061678A2E1D7909A94E6AbAEE644"
    },
    "src/storage/RoundManagerStorage.sol": {
      "RoundManagerStorage": "0xFDb8ED7631Ed803E6110c07f2926AbA088AA3813"
    },
    "src/storage/SecondaryTradeStorage.sol": {
      "SecondaryTradeStorage": "0xE65839Cf4d81aF8D8aB30a59558bF249E3520e86"
    },
    "src/CertificateImageContentBuilder.sol": {
      "CertificateImageContentBuilder": "0xf73cF11Dc03473e53582137fB336A06C22eb4c1D"
    },
    "src/storage/IssuanceManagerStorage.sol": {
      "IssuanceManagerStorage": "0xbC2878B5777B33B951260A6ff866933063e1220c"
    },
    "src/storage/LedgerEntryTokenStorage.sol": {
      "LedgerEntryTokenStorage": "0xe720A5d00732830df878629cEdE70B2bF95c4a05"
    },
    "src/storage/extensions/ShareCertDataLayerLib.sol": {
      "ShareCertDataLayerLib": "0x780211CDcf92273C00a29bE6cD367c4abc70468c"
    }
  },
  "optimizer": {
    "runs": 15,
    "enabled": true
  },
  "evmVersion": "prague",
  "remappings": [
    "openzeppelin-contracts/=dependencies/openzeppelin-contracts/contracts/",
    "openzeppelin-contracts-upgradeable/=dependencies/openzeppelin-contracts-upgradeable/contracts/",
    "erc721a/=dependencies/erc721a-4.3.0/",
    "forge-std/=dependencies/forge-std/src/",
    "ConditionManager/=dependencies/ConditionManager/src/",
    "dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=dependencies/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "dependencies/openzeppelin-contracts-upgradeable/:erc4626-tests/=dependencies/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "dependencies/openzeppelin-contracts-upgradeable/:erc4626-tests/=dependencies/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "dependencies/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=dependencies/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "dependencies/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=dependencies/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "dependencies/openzeppelin-contracts/:erc4626-tests/=dependencies/openzeppelin-contracts/lib/erc4626-tests/",
    "dependencies/openzeppelin-contracts/:erc4626-tests/=dependencies/openzeppelin-contracts/lib/erc4626-tests/",
    "dependencies/openzeppelin-contracts/:halmos-cheatcodes/=dependencies/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "dependencies/openzeppelin-contracts/:halmos-cheatcodes/=dependencies/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "@openzeppelin/contracts-upgradeable/=dependencies/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=dependencies/openzeppelin-contracts/contracts/",
    "erc4626-tests/=dependencies/openzeppelin-contracts/lib/erc4626-tests/",
    "halmos-cheatcodes/=dependencies/openzeppelin-contracts/lib/halmos-cheatcodes/src/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.