Contract 0xfABBC18bDA50D1CA3fC1c3343A0EF26C453eAf32 5

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x6ec4b3f8baac901b59e33f24e99c9f4f9d4618be9fed41c3fb903bda8d800b7e0x60806040404998882023-03-18 19:01:1981 days 21 hrs ago0xca9f0f2d71c0c59fc295d01b6b94c42eb67e713e IN  Create: Payment0 MATIC0.063452283655 106.432490608
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Payment

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at polygonscan.com on 2023-03-26
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}


contract Main {

    address public owner;

    uint public cut = 1;

    uint public qrcut = 1;

    mapping(bytes32 => address) public whitelist;

    bytes32[] public whiteSymbol;

    constructor (){
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner, "Only owners allowed");
        _;
    }

    function whiteSymbols() public view returns(bytes32[] memory) {
        return whiteSymbol;
    }

    function updateCut (uint ncut) external onlyOwner {
        require(ncut > 0, "Cut too small");
        cut = ncut;
    }

    function addWhitelist (bytes32 symbol, address _address) external onlyOwner {

        whitelist[symbol] = _address;

        whiteSymbol.push(symbol);

    }

    function removeWhitelist (bytes32 symbol) external onlyOwner {

        delete whitelist[symbol];

    }


    function updateQrCut (uint ncut) external onlyOwner {
        require(ncut > 0, "Cut too small");
        qrcut = ncut;
    }

}


contract Payment {

        event TransferReceived(address indexed _to, address indexed _from, uint indexed _amount);

        event TransferSent(address indexed _from, address indexed _desAddr , uint indexed _amount);

        Main parentContract = Main(0x61001c7998EA1FE24EbfD6497216FE6aBD210022);

        address public owner = parentContract.owner();
        address public contractAddress = address(this);
        uint256 public contractBalance;
        uint256 public wallet;  
        uint256 public percent = parentContract.cut();

        constructor () {
             
        }


        receive () external payable {

            emit TransferReceived(contractAddress, msg.sender, msg.value);

        }

        function transferNative (address payable to) payable external {
            require(msg.value > 0, "balance is insufficient");

            uint256 cut = (msg.value * percent) / 100;

            uint256 amount = msg.value - cut;

            to.transfer(amount);

            contractBalance = address(this).balance;

            payable(owner).transfer(cut);

            emit TransferSent(msg.sender, to, amount);
            
        }

        function transferToken (address payable to, uint256 value, bytes32 symbol) external {

            require (owner == msg.sender, "unauthorized");

             uint256 balance = IERC20(parentContract.whitelist(symbol)).balanceOf(contractAddress);

             require (balance > 0, "Balance low");

            uint256 cut = (value * percent) / 100;

            uint256 amount = value - cut;

            IERC20(parentContract.whitelist(symbol)).transfer(to, amount);

            IERC20(parentContract.whitelist(symbol)).transfer(owner, cut);
             
        }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TransferReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_desAddr","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TransferSent","type":"event"},{"inputs":[],"name":"contractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"percent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"}],"name":"transferNative","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes32","name":"symbol","type":"bytes32"}],"name":"transferToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040819052600080546001600160a01b0319167361001c7998ea1fe24ebfd6497216fe6abd210022908117909155638da5cb5b60e01b825290638da5cb5b9060849060209060048186803b15801561005857600080fd5b505afa15801561006c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100909190610144565b600180546001600160a01b039283166001600160a01b0319918216179091556002805490911630179055600054604080516339bf581360e21b81529051919092169163e6fd604c916004808301926020929190829003018186803b1580156100f757600080fd5b505afa15801561010b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012f9190610174565b60055534801561013e57600080fd5b5061018d565b60006020828403121561015657600080fd5b81516001600160a01b038116811461016d57600080fd5b9392505050565b60006020828403121561018657600080fd5b5051919050565b6107f88061019c6000396000f3fe6080604052600436106100745760003560e01c80638da5cb5b1161004e5780638da5cb5b146101115780639f783dae14610149578063a526c5f01461016b578063f6b4dfb41461017e57600080fd5b8063521eb273146100bc57806370ba1113146100e55780638b7afe2e146100fb57600080fd5b366100b757600254604051349133916001600160a01b03909116907f433f97eb1c2cce62f863a3099f94448d8a882075addd4d8df9bbada004eb788090600090a4005b600080fd5b3480156100c857600080fd5b506100d260045481565b6040519081526020015b60405180910390f35b3480156100f157600080fd5b506100d260055481565b34801561010757600080fd5b506100d260035481565b34801561011d57600080fd5b50600154610131906001600160a01b031681565b6040516001600160a01b0390911681526020016100dc565b34801561015557600080fd5b506101696101643660046106cc565b61019e565b005b6101696101793660046106af565b61055b565b34801561018a57600080fd5b50600254610131906001600160a01b031681565b6001546001600160a01b031633146101ec5760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b60448201526064015b60405180910390fd5b600080546040516357da064760e11b8152600481018490526001600160a01b039091169063afb40c8e9060240160206040518083038186803b15801561023157600080fd5b505afa158015610245573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610269919061068b565b6002546040516370a0823160e01b81526001600160a01b0391821660048201529116906370a082319060240160206040518083038186803b1580156102ad57600080fd5b505afa1580156102c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e59190610723565b9050600081116103255760405162461bcd60e51b815260206004820152600b60248201526a42616c616e6365206c6f7760a81b60448201526064016101e3565b6000606460055485610337919061075e565b610341919061073c565b9050600061034f828661077d565b6000546040516357da064760e11b8152600481018790529192506001600160a01b03169063afb40c8e9060240160206040518083038186803b15801561039457600080fd5b505afa1580156103a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cc919061068b565b60405163a9059cbb60e01b81526001600160a01b03888116600483015260248201849052919091169063a9059cbb90604401602060405180830381600087803b15801561041857600080fd5b505af115801561042c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104509190610701565b506000546040516357da064760e11b8152600481018690526001600160a01b039091169063afb40c8e9060240160206040518083038186803b15801561049557600080fd5b505afa1580156104a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cd919061068b565b60015460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810185905291169063a9059cbb90604401602060405180830381600087803b15801561051a57600080fd5b505af115801561052e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105529190610701565b50505050505050565b600034116105ab5760405162461bcd60e51b815260206004820152601760248201527f62616c616e636520697320696e73756666696369656e7400000000000000000060448201526064016101e3565b60006064600554346105bd919061075e565b6105c7919061073c565b905060006105d5823461077d565b6040519091506001600160a01b0384169082156108fc029083906000818181858888f1935050505015801561060e573d6000803e3d6000fd5b50476003556001546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505015801561064d573d6000803e3d6000fd5b5060405181906001600160a01b0385169033907ffda3a3e0e1479b43cb1c701f7576187f4c4ad80768d627387e00184302f7d88e90600090a4505050565b60006020828403121561069d57600080fd5b81516106a8816107aa565b9392505050565b6000602082840312156106c157600080fd5b81356106a8816107aa565b6000806000606084860312156106e157600080fd5b83356106ec816107aa565b95602085013595506040909401359392505050565b60006020828403121561071357600080fd5b815180151581146106a857600080fd5b60006020828403121561073557600080fd5b5051919050565b60008261075957634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561077857610778610794565b500290565b60008282101561078f5761078f610794565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146107bf57600080fd5b5056fea2646970667358221220175cd2e42aed37f194c07d70a5740b009ce16d539d5940bc1824696793beab3764736f6c63430008070033

Deployed ByteCode Sourcemap

3739:1805:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4425:15;;4408:56;;4454:9;;4442:10;;-1:-1:-1;;;;;4425:15:0;;;;4408:56;;4425:15;;4408:56;3739:1805;;;;;4210:21;;;;;;;;;;;;;;;;;;;2317:25:1;;;2305:2;2290:18;4210:21:0;;;;;;;;4244:45;;;;;;;;;;;;;;;;4169:30;;;;;;;;;;;;;;;;4056:45;;;;;;;;;;-1:-1:-1;4056:45:0;;;;-1:-1:-1;;;;;4056:45:0;;;;;;-1:-1:-1;;;;;1561:32:1;;;1543:51;;1531:2;1516:18;4056:45:0;1397:203:1;4956:585:0;;;;;;;;;;-1:-1:-1;4956:585:0;;;;;:::i;:::-;;:::i;:::-;;4490:454;;;;;;:::i;:::-;;:::i;4112:46::-;;;;;;;;;;-1:-1:-1;4112:46:0;;;;-1:-1:-1;;;;;4112:46:0;;;4956:585;5066:5;;-1:-1:-1;;;;;5066:5:0;5075:10;5066:19;5057:45;;;;-1:-1:-1;;;5057:45:0;;2895:2:1;5057:45:0;;;2877:21:1;2934:2;2914:18;;;2907:30;-1:-1:-1;;;2953:18:1;;;2946:42;3005:18;;5057:45:0;;;;;;;;;5120:15;5145:14;;:32;;-1:-1:-1;;;5145:32:0;;;;;2317:25:1;;;-1:-1:-1;;;;;5145:14:0;;;;:24;;2290:18:1;;5145:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5189:15;;5138:67;;-1:-1:-1;;;5138:67:0;;-1:-1:-1;;;;;5189:15:0;;;5138:67;;;1543:51:1;5138:50:0;;;;;1516:18:1;;5138:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5120:85;;5242:1;5232:7;:11;5223:36;;;;-1:-1:-1;;;5223:36:0;;2555:2:1;5223:36:0;;;2537:21:1;2594:2;2574:18;;;2567:30;-1:-1:-1;;;2613:18:1;;;2606:41;2664:18;;5223:36:0;2353:335:1;5223:36:0;5276:11;5310:3;5299:7;;5291:5;:15;;;;:::i;:::-;5290:23;;;;:::i;:::-;5276:37;-1:-1:-1;5330:14:0;5347:11;5276:37;5347:5;:11;:::i;:::-;5382:14;;:32;;-1:-1:-1;;;5382:32:0;;;;;2317:25:1;;;5330:28:0;;-1:-1:-1;;;;;;5382:14:0;;:24;;2290:18:1;;5382:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5375:61;;-1:-1:-1;;;5375:61:0;;-1:-1:-1;;;;;1805:32:1;;;5375:61:0;;;1787:51:1;1854:18;;;1847:34;;;5375:49:0;;;;;;;1760:18:1;;5375:61:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;5460:14:0;;:32;;-1:-1:-1;;;5460:32:0;;;;;2317:25:1;;;-1:-1:-1;;;;;5460:14:0;;;;:24;;2290:18:1;;5460:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5503:5;;5453:61;;-1:-1:-1;;;5453:61:0;;-1:-1:-1;;;;;5503:5:0;;;5453:61;;;1787:51:1;1854:18;;;1847:34;;;5453:49:0;;;;;1760:18:1;;5453:61:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5040:501;;;4956:585;;;:::o;4490:454::-;4587:1;4575:9;:13;4567:49;;;;-1:-1:-1;;;4567:49:0;;3236:2:1;4567:49:0;;;3218:21:1;3275:2;3255:18;;;3248:30;3314:25;3294:18;;;3287:53;3357:18;;4567:49:0;3034:347:1;4567:49:0;4633:11;4671:3;4660:7;;4648:9;:19;;;;:::i;:::-;4647:27;;;;:::i;:::-;4633:41;-1:-1:-1;4691:14:0;4708:15;4633:41;4708:9;:15;:::i;:::-;4740:19;;4691:32;;-1:-1:-1;;;;;;4740:11:0;;;:19;;;;;4691:32;;4740:19;;;;4691:32;4740:11;:19;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4794:21:0;4776:15;:39;4840:5;;4832:28;;-1:-1:-1;;;;;4840:5:0;;;;4832:28;;;;;4856:3;;4840:5;4832:28;4840:5;4832:28;4856:3;4840:5;4832:28;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4882:36:0;;4911:6;;-1:-1:-1;;;;;4882:36:0;;;4895:10;;4882:36;;;;;4552:392;;4490:454;:::o;14:251:1:-;84:6;137:2;125:9;116:7;112:23;108:32;105:52;;;153:1;150;143:12;105:52;185:9;179:16;204:31;229:5;204:31;:::i;:::-;254:5;14:251;-1:-1:-1;;;14:251:1:o;270:255::-;337:6;390:2;378:9;369:7;365:23;361:32;358:52;;;406:1;403;396:12;358:52;445:9;432:23;464:31;489:5;464:31;:::i;530:391::-;615:6;623;631;684:2;672:9;663:7;659:23;655:32;652:52;;;700:1;697;690:12;652:52;739:9;726:23;758:31;783:5;758:31;:::i;:::-;808:5;860:2;845:18;;832:32;;-1:-1:-1;911:2:1;896:18;;;883:32;;530:391;-1:-1:-1;;;530:391:1:o;926:277::-;993:6;1046:2;1034:9;1025:7;1021:23;1017:32;1014:52;;;1062:1;1059;1052:12;1014:52;1094:9;1088:16;1147:5;1140:13;1133:21;1126:5;1123:32;1113:60;;1169:1;1166;1159:12;1208:184;1278:6;1331:2;1319:9;1310:7;1306:23;1302:32;1299:52;;;1347:1;1344;1337:12;1299:52;-1:-1:-1;1370:16:1;;1208:184;-1:-1:-1;1208:184:1:o;3568:217::-;3608:1;3634;3624:132;;3678:10;3673:3;3669:20;3666:1;3659:31;3713:4;3710:1;3703:15;3741:4;3738:1;3731:15;3624:132;-1:-1:-1;3770:9:1;;3568:217::o;3790:168::-;3830:7;3896:1;3892;3888:6;3884:14;3881:1;3878:21;3873:1;3866:9;3859:17;3855:45;3852:71;;;3903:18;;:::i;:::-;-1:-1:-1;3943:9:1;;3790:168::o;3963:125::-;4003:4;4031:1;4028;4025:8;4022:34;;;4036:18;;:::i;:::-;-1:-1:-1;4073:9:1;;3963:125::o;4093:127::-;4154:10;4149:3;4145:20;4142:1;4135:31;4185:4;4182:1;4175:15;4209:4;4206:1;4199:15;4225:131;-1:-1:-1;;;;;4300:31:1;;4290:42;;4280:70;;4346:1;4343;4336:12;4280:70;4225:131;:::o

Swarm Source

ipfs://175cd2e42aed37f194c07d70a5740b009ce16d539d5940bc1824696793beab37
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.