`GovPool::delegateTreasury` does not verify transfer of tokens and NFTs to delegatee leading to potential voting manipulation
`GovPool::delegateTreasury` transfers ERC20 tokens & specific nfts from DAO treasury to `govUserKeeper`. Based on this transfer, the `tokenBalance` and `nftBalance` of the delegatee is increased. This allows a delegatee to use this delegated voting power to vote in critical proposals.\\nAs the following snippet of `GovPool::delegateTreasury` function shows, there is no verification that the tokens and nfts are actually transferred to the `govUserKeeper`. It is implicitly assumed that a successful transfer is completed and subsequently, the voting power of the delegatee is increased.\\n```\\n  function delegateTreasury(\\n        address delegatee,\\n        uint256 amount,\\n        uint256[] calldata nftIds\\n    ) external override onlyThis {\\n        require(amount > 0 || nftIds.length > 0, "Gov: empty delegation");\\n        require(getExpertStatus(delegatee), "Gov: delegatee is not an expert");\\n\\n        _unlock(delegatee);\\n\\n        if (amount != 0) {\\n            address token = _govUserKeeper.tokenAddress();\\n\\n  >          IERC20(token).transfer(address(_govUserKeeper), amount.from18(token.decimals())); //@audit no check if tokens are actually transferred\\n\\n            _govUserKeeper.delegateTokensTreasury(delegatee, amount);\\n        }\\n\\n        if (nftIds.length != 0) {\\n            IERC721 nft = IERC721(_govUserKeeper.nftAddress());\\n\\n            for (uint256 i; i < nftIds.length; i++) {\\n  >              nft.safeTransferFrom(address(this), address(_govUserKeeper), nftIds[i]); //-n no check if nft's are actually transferred\\n            }\\n\\n            _govUserKeeper.delegateNftsTreasury(delegatee, nftIds);\\n        }\\n\\n        _revoteDelegated(delegatee, VoteType.TreasuryVote);\\n\\n        emit DelegatedTreasury(delegatee, amount, nftIds, true);\\n    }\\n```\\n\\nThis could lead to a dangerous situation where a malicious DAO treasury can increase voting power manifold while actually transferring tokens only once (or even, not transfer at all). This breaks the invariance that the total accounting balances in `govUserKeeper` contract must match the actual token balances in that contract.
Since DEXE starts out with a trustless assumption that does not give any special trust privileges to a DAO treasury, it is always prudent to follow the "trust but verify" approach when it comes to non-standard tokens, both ERC20 and ERC721. To that extent, consider adding verification of token & nft balance increase before/after token transfer.
Since both the ERC20 and ERC721 token implementations are controlled by the DAO, and since we are dealing with upgradeable token contracts, there is a potential rug-pull vector created by the implicit transfer assumption above.
```\\n  function delegateTreasury(\\n        address delegatee,\\n        uint256 amount,\\n        uint256[] calldata nftIds\\n    ) external override onlyThis {\\n        require(amount > 0 || nftIds.length > 0, "Gov: empty delegation");\\n        require(getExpertStatus(delegatee), "Gov: delegatee is not an expert");\\n\\n        _unlock(delegatee);\\n\\n        if (amount != 0) {\\n            address token = _govUserKeeper.tokenAddress();\\n\\n  >          IERC20(token).transfer(address(_govUserKeeper), amount.from18(token.decimals())); //@audit no check if tokens are actually transferred\\n\\n            _govUserKeeper.delegateTokensTreasury(delegatee, amount);\\n        }\\n\\n        if (nftIds.length != 0) {\\n            IERC721 nft = IERC721(_govUserKeeper.nftAddress());\\n\\n            for (uint256 i; i < nftIds.length; i++) {\\n  >              nft.safeTransferFrom(address(this), address(_govUserKeeper), nftIds[i]); //-n no check if nft's are actually transferred\\n            }\\n\\n            _govUserKeeper.delegateNftsTreasury(delegatee, nftIds);\\n        }\\n\\n        _revoteDelegated(delegatee, VoteType.TreasuryVote);\\n\\n        emit DelegatedTreasury(delegatee, amount, nftIds, true);\\n    }\\n```\\n