{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/Witch.sol",
    "Parent Contracts": [
        "contracts/utils/access/AccessControl.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract Witch is AccessControl() {\n    using WMul for uint256;\n    using WDiv for uint256;\n    using WDivUp for uint256;\n    using CastU256U128 for uint256;\n\n    event AuctionTimeSet(uint128 indexed auctionTime);\n    event InitialProportionSet(uint128 indexed initialProportion);\n    event Bought(bytes12 indexed vaultId, address indexed buyer, uint256 ink, uint256 art);\n  \n    uint128 public auctionTime = 4 * 60 * 60; // Time that auctions take to go to minimal price and stay there.\n    uint128 public initialProportion = 5e17;  // Proportion of collateral that is sold at auction start.\n\n    ICauldron immutable public cauldron;\n    ILadle immutable public ladle;\n    mapping(bytes12 => address) public vaultOwners;\n\n    constructor (ICauldron cauldron_, ILadle ladle_) {\n        cauldron = cauldron_;\n        ladle = ladle_;\n    }\n\n    /// @dev Set the auction time to calculate liquidation prices\n    function setAuctionTime(uint128 auctionTime_) public auth {\n        auctionTime = auctionTime_;\n        emit AuctionTimeSet(auctionTime_);\n    }\n\n    /// @dev Set the proportion of the collateral that will be sold at auction start\n    function setInitialProportion(uint128 initialProportion_) public auth {\n        require (initialProportion_ <= 1e18, \"Only at or under 100%\");\n        initialProportion = initialProportion_;\n        emit InitialProportionSet(initialProportion_);\n    }\n\n    /// @dev Put an undercollateralized vault up for liquidation.\n    function grab(bytes12 vaultId) public {\n        DataTypes.Vault memory vault = cauldron.vaults(vaultId);\n        vaultOwners[vaultId] = vault.owner;\n        cauldron.grab(vaultId, address(this));\n    }\n\n    /// @dev Buy an amount of collateral off a vault in liquidation, paying at most `max` underlying.\n    function buy(bytes12 vaultId, uint128 art, uint128 min) public {\n        DataTypes.Balances memory balances_ = cauldron.balances(vaultId);\n\n        require (balances_.art > 0, \"Nothing to buy\");                                      // Cheapest way of failing gracefully if given a non existing vault\n        uint256 elapsed = uint32(block.timestamp) - cauldron.auctions(vaultId);           // Auctions will malfunction on the 7th of February 2106, at 06:28:16 GMT, we should replace this contract before then.\n        uint256 price;\n        {\n            // Price of a collateral unit, in underlying, at the present moment, for a given vault\n            //\n            //                ink                     min(auction, elapsed)\n            // price = 1 / (------- * (p + (1 - p) * -----------------------))\n            //                art                          auction\n            (uint256 auctionTime_, uint256 initialProportion_) = (auctionTime, initialProportion);\n            uint256 term1 = uint256(balances_.ink).wdiv(balances_.art);\n            uint256 dividend2 = auctionTime_ < elapsed ? auctionTime_ : elapsed;\n            uint256 divisor2 = auctionTime_;\n            uint256 term2 = initialProportion_ + (1e18 - initialProportion_).wmul(dividend2.wdiv(divisor2));\n            price = uint256(1e18).wdiv(term1.wmul(term2));\n        }\n        uint256 ink = uint256(art).wdivup(price);                                                    // Calculate collateral to sell. Using divdrup stops rounding from leaving 1 stray wei in vaults.\n        require (ink >= min, \"Not enough bought\");\n\n        ladle.settle(vaultId, msg.sender, ink.u128(), art);                                        // Move the assets\n        if (balances_.art - art == 0) {                                                             // If there is no debt left, return the vault with the collateral to the owner\n            cauldron.give(vaultId, vaultOwners[vaultId]);\n            delete vaultOwners[vaultId];\n        }\n\n        emit Bought(vaultId, msg.sender, ink, art);\n    }\n}"
}