{
    "Function": "depositTokens",
    "File": "contracts/MerkleResistor.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IERC20"
    ],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function depositTokens(uint treeIndex, uint value) public {\n        // storage because we edit\n        MerkleTree storage merkleTree = merkleTrees[treeIndex];\n\n        // bookkeeping to make sure trees do not share tokens\n        merkleTree.tokenBalance += value;\n\n        // do the transfer from the caller\n        // NOTE: it is possible for user to overfund the tree and there is no mechanism to reclaim excess tokens\n        // this is because there is no way for the contract to know when a tree has had all leaves claimed.\n        // There is also no way for the contract to know the minimum or maximum liabilities represented by the leaves\n        // in short, there is no on-chain inspection of any of the leaf data except at initialization time\n        // NOTE: a malicious token contract could cause merkleTree.tokenBalance to be out of sync with the token contract\n        // this is an unavoidable possibility, and it could render the tree unusable, while leaving other trees unharmed\n        require(IERC20(merkleTree.tokenAddress).transferFrom(msg.sender, address(this), value), \"ERC20 transfer failed\");\n        emit TokensDeposited(treeIndex, merkleTree.tokenAddress, value);\n    }"
}