{
    "Function": "addValueBatch",
    "File": "contracts/Vault.sol",
    "Parent Contracts": [
        "contracts/interfaces/IVault.sol"
    ],
    "High-Level Calls": [
        "SafeERC20"
    ],
    "Internal Calls": [
        "onlyMarket",
        "valueAll",
        "require(bool,string)"
    ],
    "Library Calls": [
        "safeTransferFrom"
    ],
    "Low-Level Calls": [],
    "Code": "function addValueBatch(\n        uint256 _amount,\n        address _from,\n        address[2] memory _beneficiaries,\n        uint256[2] memory _shares\n    ) external override onlyMarket returns (uint256[2] memory _allocations) {\n        \n        require(_shares[0] + _shares[1] == 1000000, \"ERROR_INCORRECT_SHARE\");\n\n        uint256 _attributions;\n        if (totalAttributions == 0) {\n            _attributions = _amount;\n        } else {\n            uint256 _pool = valueAll();\n            _attributions = (_amount * totalAttributions) / _pool;\n        }\n        IERC20(token).safeTransferFrom(_from, address(this), _amount);\n\n        balance += _amount;\n        totalAttributions += _attributions;\n        for (uint128 i = 0; i < 2; i++) {\n            uint256 _allocation = (_shares[i] * _attributions) / MAGIC_SCALE_1E6;\n            attributions[_beneficiaries[i]] += _allocation;\n            _allocations[i] = _allocation;\n        }\n    }"
}