Token USD Coin

Overview ERC-20

Total Supply:
100,000,000 USDC

Holders:
22 addresses

Profile Summary

 
Contract:
0x6d1fdbA4ad212ba1d12E739c2784FB074dD279F10x6d1fdbA4ad212ba1d12E739c2784FB074dD279F1

Decimals:
6
Balance
5.3 USDC
0xbe188d6641e8b680743a4815dfa0f6208038960f
Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

Click here to update the token ICO / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
UChildERC20Proxy

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion
File 1 of 1 : UChildERC20Proxy.sol
/**
 *Submitted for verification at polygonscan.com on 2021-06-09
*/

// SPDX-License-Identifier: MIT

// File: contracts/lib/Proxy/IERCProxy.sol

pragma solidity 0.6.12;

interface IERCProxy {
    function proxyType() external pure returns (uint256 proxyTypeId);

    function implementation() external view returns (address codeAddr);
}

// File: contracts/lib/Proxy/Proxy.sol

pragma solidity 0.6.12;

abstract contract Proxy is IERCProxy {
    function delegatedFwd(address _dst, bytes memory _calldata) internal {
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            let result := delegatecall(
                sub(gas(), 10000),
                _dst,
                add(_calldata, 0x20),
                mload(_calldata),
                0,
                0
            )
            let size := returndatasize()

            let ptr := mload(0x40)
            returndatacopy(ptr, 0, size)

            // revert instead of invalid() bc if the underlying call failed with invalid() it already wasted gas.
            // if the call returned error data, forward it
            switch result
                case 0 {
                    revert(ptr, size)
                }
                default {
                    return(ptr, size)
                }
        }
    }

    function proxyType()
        external
        virtual
        override
        pure
        returns (uint256 proxyTypeId)
    {
        // Upgradeable proxy
        proxyTypeId = 2;
    }

    function implementation() external virtual override view returns (address);
}

// File: contracts/lib/Proxy/UpgradableProxy.sol

pragma solidity 0.6.12;

contract UpgradableProxy is Proxy {
    event ProxyUpdated(address indexed _new, address indexed _old);
    event ProxyOwnerUpdate(address _new, address _old);

    bytes32 public constant IMPLEMENTATION_SLOT = keccak256(
        "matic.network.proxy.implementation"
    );
    bytes32 public constant OWNER_SLOT = keccak256("matic.network.proxy.owner");

    constructor(address _proxyTo) public {
        setProxyOwner(msg.sender);
        setImplementation(_proxyTo);
    }

    fallback() external payable {
        delegatedFwd(loadImplementation(), msg.data);
    }

    receive() external payable {
        delegatedFwd(loadImplementation(), msg.data);
    }

    modifier onlyProxyOwner() {
        require(loadProxyOwner() == msg.sender, "NOT_OWNER");
        _;
    }

    function proxyOwner() external view returns (address) {
        return loadProxyOwner();
    }

    function loadProxyOwner() internal view returns (address) {
        address _owner;
        bytes32 position = OWNER_SLOT;
        assembly {
            _owner := sload(position)
        }
        return _owner;
    }

    function implementation() external override view returns (address) {
        return loadImplementation();
    }

    function loadImplementation() internal view returns (address) {
        address _impl;
        bytes32 position = IMPLEMENTATION_SLOT;
        assembly {
            _impl := sload(position)
        }
        return _impl;
    }

    function transferProxyOwnership(address newOwner) public onlyProxyOwner {
        require(newOwner != address(0), "ZERO_ADDRESS");
        emit ProxyOwnerUpdate(newOwner, loadProxyOwner());
        setProxyOwner(newOwner);
    }

    function setProxyOwner(address newOwner) private {
        bytes32 position = OWNER_SLOT;
        assembly {
            sstore(position, newOwner)
        }
    }

    function updateImplementation(address _newProxyTo) public onlyProxyOwner {
        require(_newProxyTo != address(0x0), "INVALID_PROXY_ADDRESS");
        require(
            isContract(_newProxyTo),
            "DESTINATION_ADDRESS_IS_NOT_A_CONTRACT"
        );

        emit ProxyUpdated(_newProxyTo, loadImplementation());

        setImplementation(_newProxyTo);
    }

    function updateAndCall(address _newProxyTo, bytes memory data)
        public
        payable
        onlyProxyOwner
    {
        updateImplementation(_newProxyTo);

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returnData) = address(this).call{
            value: msg.value
        }(data);
        require(success, string(returnData));
    }

    function setImplementation(address _newProxyTo) private {
        bytes32 position = IMPLEMENTATION_SLOT;
        assembly {
            sstore(position, _newProxyTo)
        }
    }

    function isContract(address _target) internal view returns (bool) {
        if (_target == address(0)) {
            return false;
        }

        uint256 size;
        assembly {
            size := extcodesize(_target)
        }
        return size > 0;
    }
}

// File: contracts/UChildERC20Proxy.sol

pragma solidity 0.6.12;

contract UChildERC20Proxy is UpgradableProxy {
    constructor(address _proxyTo) public UpgradableProxy(_proxyTo) {}
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 9999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_proxyTo","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_new","type":"address"},{"indexed":false,"internalType":"address","name":"_old","type":"address"}],"name":"ProxyOwnerUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_new","type":"address"},{"indexed":true,"internalType":"address","name":"_old","type":"address"}],"name":"ProxyUpdated","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"IMPLEMENTATION_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OWNER_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyType","outputs":[{"internalType":"uint256","name":"proxyTypeId","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferProxyOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newProxyTo","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"updateAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newProxyTo","type":"address"}],"name":"updateImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50604051610a87380380610a878339818101604052602081101561003357600080fd5b50518061003f3361004f565b61004881610073565b5050610097565b7f44f6e2e8884cba1236b7f22f351fa5d88b17292b7e0225ca47e5ecdf6055cdd655565b7fbaab7dbf64751104133af04abc7d9979f0fda3b059a322a8333f533d3f32bf7f55565b6109e1806100a66000396000f3fe60806040526004361061007f5760003560e01c80635c60da1b1161004e5780635c60da1b14610193578063963949a3146101a8578063d88ca2c8146101bd578063f1739cae14610280576100ce565b8063025313a2146100d9578063025b22bc14610117578063086fc0c7146101575780634555d5c91461017e576100ce565b366100ce576100cc61008f6102c0565b6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506102e592505050565b005b6100cc61008f6102c0565b3480156100e557600080fd5b506100ee61030d565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561012357600080fd5b506100cc6004803603602081101561013a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661031c565b34801561016357600080fd5b5061016c6104f4565b60408051918252519081900360200190f35b34801561018a57600080fd5b5061016c610518565b34801561019f57600080fd5b506100ee61051d565b3480156101b457600080fd5b5061016c610527565b6100cc600480360360408110156101d357600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561020b57600080fd5b82018360208201111561021d57600080fd5b8035906020019184600183028401116401000000008311171561023f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061054b945050505050565b34801561028c57600080fd5b506100cc600480360360208110156102a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610761565b7fbaab7dbf64751104133af04abc7d9979f0fda3b059a322a8333f533d3f32bf7f5490565b600080825160208401856127105a03f43d604051816000823e828015610309578282f35b8282fd5b60006103176108e9565b905090565b336103256108e9565b73ffffffffffffffffffffffffffffffffffffffff16146103a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811661042957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f494e56414c49445f50524f58595f414444524553530000000000000000000000604482015290519081900360640190fd5b6104328161090e565b610487576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806109876025913960400191505060405180910390fd5b61048f6102c0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fd32d24edea94f55e932d9a008afc425a8561462d1b1f57bc6e508e9a6b9509e160405160405180910390a36104f18161093e565b50565b7fbaab7dbf64751104133af04abc7d9979f0fda3b059a322a8333f533d3f32bf7f81565b600290565b60006103176102c0565b7f44f6e2e8884cba1236b7f22f351fa5d88b17292b7e0225ca47e5ecdf6055cdd681565b336105546108e9565b73ffffffffffffffffffffffffffffffffffffffff16146105d657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6105df8261031c565b600060603073ffffffffffffffffffffffffffffffffffffffff1634846040518082805190602001908083835b6020831061064957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161060c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146106ab576040519150601f19603f3d011682016040523d82523d6000602084013e6106b0565b606091505b509150915081819061075a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561071f578181015183820152602001610707565b50505050905090810190601f16801561074c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050505050565b3361076a6108e9565b73ffffffffffffffffffffffffffffffffffffffff16146107ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811661086e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5a45524f5f414444524553530000000000000000000000000000000000000000604482015290519081900360640190fd5b7fdbe5fd65bcdbae152f24ab660ea68e72b4d4705b57b16e0caae994e214680ee2816108986108e9565b604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16104f181610962565b7f44f6e2e8884cba1236b7f22f351fa5d88b17292b7e0225ca47e5ecdf6055cdd65490565b600073ffffffffffffffffffffffffffffffffffffffff821661093357506000610939565b50803b15155b919050565b7fbaab7dbf64751104133af04abc7d9979f0fda3b059a322a8333f533d3f32bf7f55565b7f44f6e2e8884cba1236b7f22f351fa5d88b17292b7e0225ca47e5ecdf6055cdd65556fe44455354494e4154494f4e5f414444524553535f49535f4e4f545f415f434f4e5452414354a26469706673582212205e70b3e0956f89b9a946d5e9d75c03003c1264c8096653dcc4fbf8f5c49a090664736f6c634300060c003300000000000000000000000050b9bb2520fa00abce4289ef867995b28f75701b

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000050b9bb2520fa00abce4289ef867995b28f75701b

-----Decoded View---------------
Arg [0] : _proxyTo (address): 0x50b9bb2520fa00abce4289ef867995b28f75701b

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000050b9bb2520fa00abce4289ef867995b28f75701b


Loading