Contract 0xb09c1ca6d5d6ca8511eadad54abb622a0d568874

Contract Overview

Balance:
0 HT
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xa650cfad038ded6de670d4a01fac331fdb7311e28c7dbcc2c9b50062e24d068e0x60806040163829872022-06-24 3:01:348 days 21 hrs ago0x0444c019c90402033ff8246bcea440ceb9468c88 IN  Contract Creation0 HT0.0007977475 2.5
[ Download CSV Export 
Latest 3 internal transactions
Parent Txn Hash Block From To Value
0x0a2455f4964f2239abf5a0aa07293883d9d7a9988882bea5f278d5d4529cf1c0165052042022-06-28 8:52:254 days 15 hrs ago 0xa150c5357524c85751cfca9afad02b86c1d64c930xb09c1ca6d5d6ca8511eadad54abb622a0d5688740 HT
0xf19aeff17b23f93889f6ba540392ddcf05937510aaf0ff1bd4f3451723de3e05163900882022-06-24 8:56:378 days 15 hrs ago 0xa150c5357524c85751cfca9afad02b86c1d64c930xb09c1ca6d5d6ca8511eadad54abb622a0d5688740 HT
0x457d979b6a57d2fe2df480a4a2061ed348b08f57b58270989f386410aae7754e163831852022-06-24 3:11:288 days 21 hrs ago 0xa150c5357524c85751cfca9afad02b86c1d64c930xb09c1ca6d5d6ca8511eadad54abb622a0d5688740 HT
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x8451047A25F4577278878F58D2E83ebd3fb5A6E6

Contract Name:
Wallet

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license
/**
 *Submitted for verification at hecoinfo.com on 2022-06-17
*/

// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;

abstract contract IRelayRecipient {
    /**
     * return if the forwarder is trusted to forward relayed transactions to us.
     * the forwarder is required to verify the sender's signature, and verify
     * the call is not a replay.
     */
    function isTrustedForwarder(address forwarder) public view virtual returns (bool);

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes
     * of the msg.data.
     * otherwise, return `msg.sender`
     * should be used in the contract anywhere instead of msg.sender
     */
    function _msgSender() internal view virtual returns (address payable);

    /**
     * return the msg.data of this call.
     * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes
     * of the msg.data - so this method will strip those 20 bytes off.
     * otherwise (if the call was made directly and not through the forwarder), return `msg.data`
     * should be used in the contract instead of msg.data, where this difference matters.
     */
    function _msgData() internal view virtual returns (bytes calldata);

    function versionRecipient() external view virtual returns (string memory);
}


abstract contract BaseRelayRecipient is IRelayRecipient {
    /*
     * Forwarder singleton we accept calls from
     */
    address internal _trustedForwarder;

    // __gap is reserved storage
    uint256[50] private __gap;

    event TrustedForwarderUpdated(address trustedForwarder);

    function getTrustedForwarder() external view returns (address) {
        return _trustedForwarder;
    }

    /// @inheritdoc IRelayRecipient
    function versionRecipient() external pure override returns (string memory) {
        return "2.0.0";
    }

    /// @inheritdoc IRelayRecipient
    function isTrustedForwarder(address forwarder) public view virtual override returns (bool) {
        return forwarder == _trustedForwarder;
    }

    function _setTrustedForwarder(address trustedForwarderArg) internal {
        _trustedForwarder = trustedForwarderArg;
        emit TrustedForwarderUpdated(trustedForwarderArg);
    }

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, return the original sender.
     * otherwise, return `msg.sender`.
     * should be used in the contract anywhere instead of msg.sender
     */
    /// @inheritdoc IRelayRecipient
    function _msgSender() internal view virtual override returns (address payable ret) {
        if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {
            // At this point we know that the sender is a trusted forwarder,
            // so we trust that the last bytes of msg.data are the verified sender address.
            // extract sender address from the end of msg.data
            assembly {
                ret := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            ret = msg.sender;
        }
    }

    /**
     * return the msg.data of this call.
     * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes
     * of the msg.data - so this method will strip those 20 bytes off.
     * otherwise (if the call was made directly and not through the forwarder), return `msg.data`
     * should be used in the contract instead of msg.data, where this difference matters.
     */
    /// @inheritdoc IRelayRecipient
    function _msgData() internal view virtual override returns (bytes calldata ret) {
        if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {
            return msg.data[0 : msg.data.length - 20];
        } else {
            return msg.data;
        }
    }
}

library TransferHelper {
    function safeApprove(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
    }

    function safeTransfer(address token, address to, uint value) internal {
        // usdt of tron mainnet TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t: 0x41a614f803b6fd780986a42c78ec9c7f77e6ded13c
        /*
        if (token == address(0x41a614f803b6fd780986a42c78ec9c7f77e6ded13c)){
            IERC20(token).transfer(to, value);
            return;
        }
        */

        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
    }

    function safeTransferFrom(address token, address from, address to, uint value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
    }
}


contract Wallet is BaseRelayRecipient {
    mapping(address => uint256) public balances;

    constructor (address _forwarder) public {
        _trustedForwarder = _forwarder;
    }

    function setTrustedForwarder(address _forwarder) external {
        _trustedForwarder = _forwarder;
    }

    function deposit(uint256 amount) external {
        balances[_msgSender()] = balances[_msgSender()] + amount;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"trustedForwarder","type":"address"}],"name":"TrustedForwarderUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTrustedForwarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"versionRecipient","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b506040516104f33803806104f38339818101604052602081101561003357600080fd5b8101908080519060200190929190505050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061045f806100946000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806327e235e314610067578063486ff0cd146100bf578063572b6c0514610142578063b6b55f251461019c578063ce1b815f146101ca578063da742228146101fe575b600080fd5b6100a96004803603602081101561007d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610242565b6040518082815260200191505060405180910390f35b6100c761025a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101075780820151818401526020810190506100ec565b50505050905090810190601f1680156101345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101846004803603602081101561015857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610297565b60405180821515815260200191505060405180910390f35b6101c8600480360360208110156101b257600080fd5b81019080803590602001909291905050506102f0565b005b6101d2610386565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102406004803603602081101561021457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103af565b005b60336020528060005260406000206000915090505481565b60606040518060400160405280600581526020017f322e302e30000000000000000000000000000000000000000000000000000000815250905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b80603360006102fd6103f2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401603360006103456103f2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000601460003690501015801561040e575061040d33610297565b5b1561042257601436033560601c9050610426565b3390505b9056fea2646970667358221220283b627d2b1deb29bd8049c395297fceda80211badddf3938febae8e2cb173db64736f6c634300070600330000000000000000000000002f3bb541072059e6d475af43f18fd78a0229d970

Deployed ByteCode Sourcemap

5422:429:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5467:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1829:108;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1982:147;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;5731:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1678:106;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;5616:107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5467:43;;;;;;;;;;;;;;;;;:::o;1829:108::-;1889:13;1915:14;;;;;;;;;;;;;;;;;;;1829:108;:::o;1982:147::-;2067:4;2104:17;;;;;;;;;;;2091:30;;:9;:30;;;2084:37;;1982:147;;;:::o;5731:117::-;5834:6;5809:8;:22;5818:12;:10;:12::i;:::-;5809:22;;;;;;;;;;;;;;;;:31;5784:8;:22;5793:12;:10;:12::i;:::-;5784:22;;;;;;;;;;;;;;;:56;;;;5731:117;:::o;1678:106::-;1732:7;1759:17;;;;;;;;;;;1752:24;;1678:106;:::o;5616:107::-;5705:10;5685:17;;:30;;;;;;;;;;;;;;;;;;5616:107;:::o;2620:568::-;2682:19;2737:2;2718:8;;:15;;:21;;:55;;;;;2743:30;2762:10;2743:18;:30::i;:::-;2718:55;2714:467;;;3101:2;3085:14;3081:23;3068:37;3064:2;3060:46;3053:53;;3034:87;;;3159:10;3153:16;;2714:467;2620:568;:::o

Swarm Source

ipfs://283b627d2b1deb29bd8049c395297fceda80211badddf3938febae8e2cb173db
Block Transaction Gas Used Reward
Age Block Fee Address Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading