{
    "Function": "addMerkleTree",
    "File": "contracts/MerkleResistor.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)",
        "depositTokens"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function addMerkleTree(bytes32 newRoot, bytes32 ipfsHash, uint minEndTime, uint maxEndTime, uint pctUpFront, address tokenAddress, uint tokenBalance) public {\n        // check basic coherence of request\n        require(pctUpFront < 100, 'pctUpFront >= 100');\n        require(minEndTime < maxEndTime, 'minEndTime must be less than maxEndTime');\n\n        // prefix operator ++ increments then evaluates\n        merkleTrees[++numTrees] = MerkleTree(\n            newRoot,\n            ipfsHash,\n            minEndTime,\n            maxEndTime,\n            pctUpFront,\n            tokenAddress,\n            0    // tokenBalance is 0 at first because no tokens have been deposited\n        );\n\n        // pull tokens from user to fund the tree\n        // if tree is insufficiently funded, then some users may not be able to be paid out, this is the responsibility\n        // of the tree creator, if trees are not funded, then the UI will not display the tree\n        depositTokens(numTrees, tokenBalance);\n        emit MerkleTreeAdded(numTrees, tokenAddress, newRoot, ipfsHash);\n    }"
}