Token CrossSwap.com

 

Overview [ERC-20]

Max Total Supply:
78,907,000 CSWAP

Holders:
446

Transfers:
-

 
Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

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

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

Contract Name:
TransparentUpgradeableProxy

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2021-08-01
*/

pragma solidity ^0.6.12;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 * 
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 * 
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     * 
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 { revert(0, returndatasize()) }
            default { return(0, returndatasize()) }
        }
    }

    /**
     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal virtual view returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     * 
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _fallback() internal {
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback () payable external {
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive () payable external {
        _delegate(_implementation());
    }
}

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 * 
 * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see
 * {TransparentUpgradeableProxy}.
 */
contract UpgradeableProxy is Proxy {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
     * 
     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
     * function call, and allows initializating the storage of the proxy like a Solidity constructor.
     */
    constructor() public payable {
        assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
    }

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Returns the current implementation address.
     */
    function _implementation() internal override view returns (address impl) {
        bytes32 slot = _IMPLEMENTATION_SLOT;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            impl := sload(slot)
        }
    }

    /**
     * @dev Upgrades the proxy to a new implementation.
     * 
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) virtual internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        address implementation = _implementation();
        require(implementation != newImplementation, "Proxy: Attemps update proxy with the same implementation");

        bytes32 slot = _IMPLEMENTATION_SLOT;

        // solhint-disable-next-line no-inline-assembly
        assembly {
            sstore(slot, newImplementation)
        }
    }
}

/**
 * @dev This contract implements a proxy that is upgradeable by an admin.
 * 
 * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector
 * clashing], which can potentially be used in an attack, this contract uses the
 * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
 * things that go hand in hand:
 * 
 * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
 * that call matches one of the admin functions exposed by the proxy itself.
 * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the
 * implementation. If the admin tries to call a function on the implementation it will fail with an error that says
 * "admin cannot fallback to proxy target".
 * 
 * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing
 * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due
 * to sudden errors when trying to call a function from the proxy implementation.
 * 
 * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,
 * you should think of the `ProxyAdmin` instance as the real administrative inerface of your proxy.
 */
contract TransparentUpgradeableProxy is UpgradeableProxy {
    /**
     * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
     * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.
     */
    constructor(address admin, address implementation) public payable UpgradeableProxy() {
        require(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1), "Wrong admin slot");
        _setAdmin(admin);
        _upgradeTo(implementation);
    }

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.
     */
    modifier ifAdmin() {
        if (msg.sender == _admin()) {
            _;
        } else {
            _fallback();
        }
    }

    /**
     * @dev Returns the current admin.
     * 
     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.
     * 
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function admin() external ifAdmin returns (address) {
        return _admin();
    }

    /**
     * @dev Returns the current implementation.
     * 
     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.
     * 
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
     */
    function implementation() external ifAdmin returns (address) {
        return _implementation();
    }

    /**
     * @dev Changes the admin of the proxy.
     * 
     * Emits an {AdminChanged} event.
     * 
     * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.
     */
    function changeAdmin(address newAdmin) external ifAdmin {
        require(newAdmin != _admin(), "Proxy: new admin is the same admin.");
        emit AdminChanged(_admin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev Upgrade the implementation of the proxy.
     * 
     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.
     */
    function upgradeTo(address newImplementation) external ifAdmin {
        _upgradeTo(newImplementation);
    }

    /**
     * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified
     * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the
     * proxied contract.
     * 
     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.
     */
    function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
        _upgradeTo(newImplementation);
        // solhint-disable-next-line avoid-low-level-calls
        (bool success,) = newImplementation.delegatecall(data);
        require(success);
    }

    /**
     * @dev Returns the current admin.
     */
    function _admin() internal view returns (address adm) {
        bytes32 slot = _ADMIN_SLOT;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            adm := sload(slot)
        }
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        bytes32 slot = _ADMIN_SLOT;
        require(newAdmin != address(0), "Proxy: Can't set admin to zero address.");

        // solhint-disable-next-line no-inline-assembly
        assembly {
            sstore(slot, newAdmin)
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"implementation","type":"address"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"changeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526040516108143803806108148339818101604052604081101561002657600080fd5b50805160209091015161003882610048565b610041816100b1565b5050610174565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61036001600160a01b0382166100ae5760405162461bcd60e51b81526004018080602001828103825260278152602001806107956027913960400191505060405180910390fd5b55565b6100ba816100f1565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60006100fb610161565b9050816001600160a01b0316816001600160a01b0316141561014e5760405162461bcd60e51b81526004018080602001828103825260388152602001806107bc6038913960400191505060405180910390fd5b506000805160206107f483398151915255565b6000805160206107f48339815191525490565b610612806101836000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100705780634f1ef286146100a35780635c60da1b146101235780638f28397014610154578063f851a4401461018757610065565b366100655761006361005e61019c565b6101c1565b005b61006361005e61019c565b34801561007c57600080fd5b506100636004803603602081101561009357600080fd5b50356001600160a01b03166101ea565b610063600480360360408110156100b957600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100e457600080fd5b8201836020820111156100f657600080fd5b8035906020019184600183028401116401000000008311171561011857600080fd5b509092509050610224565b34801561012f57600080fd5b506101386102cc565b604080516001600160a01b039092168252519081900360200190f35b34801561016057600080fd5b506100636004803603602081101561017757600080fd5b50356001600160a01b0316610309565b34801561019357600080fd5b506101386103d6565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156101e0573d6000f35b3d6000fd5b505050565b6101f26103fd565b6001600160a01b0316336001600160a01b031614156102195761021481610422565b610221565b610221610462565b50565b61022c6103fd565b6001600160a01b0316336001600160a01b031614156102c45761024e83610422565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146102ab576040519150601f19603f3d011682016040523d82523d6000602084013e6102b0565b606091505b50509050806102be57600080fd5b506101e5565b6101e5610462565b60006102d66103fd565b6001600160a01b0316336001600160a01b031614156102fe576102f761019c565b9050610306565b610306610462565b90565b6103116103fd565b6001600160a01b0316336001600160a01b03161415610219576103326103fd565b6001600160a01b0316816001600160a01b031614156103825760405162461bcd60e51b81526004018080602001828103825260238152602001806105826023913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103ab6103fd565b604080516001600160a01b03928316815291841660208301528051918290030190a16102148161046f565b60006103e06103fd565b6001600160a01b0316336001600160a01b031614156102fe576102f75b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61042b816104d8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61046d61005e61019c565b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61036001600160a01b0382166104d55760405162461bcd60e51b815260040180806020018281038252602781526020018061055b6027913960400191505060405180910390fd5b55565b60006104e261019c565b9050816001600160a01b0316816001600160a01b031614156105355760405162461bcd60e51b81526004018080602001828103825260388152602001806105a56038913960400191505060405180910390fd5b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe50726f78793a2043616e2774207365742061646d696e20746f207a65726f20616464726573732e50726f78793a206e65772061646d696e206973207468652073616d652061646d696e2e50726f78793a20417474656d7073207570646174652070726f78792077697468207468652073616d6520696d706c656d656e746174696f6ea2646970667358221220d86a77a3ac5810bef8a244453ba1bee8c3cd15723333437382d47c0ea7402ecd64736f6c634300060c003350726f78793a2043616e2774207365742061646d696e20746f207a65726f20616464726573732e50726f78793a20417474656d7073207570646174652070726f78792077697468207468652073616d6520696d706c656d656e746174696f6e360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc000000000000000000000000b5ec42f1b60367d4cd608cf1bc105774c1b6b35d0000000000000000000000009ed27d7f260ee52668b209a15159045011c8d007

Deployed ByteCode Sourcemap

7036:4487:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2833:28;2843:17;:15;:17::i;:::-;2833:9;:28::i;:::-;7036:4487;;2592:28;2602:17;:15;:17::i;10051:111::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10051:111:0;-1:-1:-1;;;;;10051:111:0;;:::i;10548:299::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;10548:299:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10548:299:0;;-1:-1:-1;10548:299:0;-1:-1:-1;10548:299:0;:::i;9342:104::-;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;9342:104:0;;;;;;;;;;;;;;9662:221;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9662:221:0;-1:-1:-1;;;;;9662:221:0;;:::i;8783:86::-;;;;;;;;;;;;;:::i;4497:248::-;4347:66;4716:11;;4693:45::o;872:907::-;1264:14;1261:1;1258;1245:34;1482:1;1479;1463:14;1460:1;1444:14;1437:5;1424:60;1561:16;1558:1;1555;1540:38;1601:6;1670:38;;;;1742:16;1739:1;1732:27;1670:38;1689:16;1686:1;1679:27;1594:167;;;1001:771;:::o;10051:111::-;8239:8;:6;:8::i;:::-;-1:-1:-1;;;;;8225:22:0;:10;-1:-1:-1;;;;;8225:22:0;;8221:100;;;10125:29:::1;10136:17;10125:10;:29::i;:::-;8221:100:::0;;;8298:11;:9;:11::i;:::-;10051:111;:::o;10548:299::-;8239:8;:6;:8::i;:::-;-1:-1:-1;;;;;8225:22:0;:10;-1:-1:-1;;;;;8225:22:0;;8221:100;;;10658:29:::1;10669:17;10658:10;:29::i;:::-;10759:12;10776:17;-1:-1:-1::0;;;;;10776:30:0::1;10807:4;;10776:36;;;;;;;;;;::::0;;::::1;::::0;-1:-1:-1;10776:36:0::1;::::0;-1:-1:-1;10776:36:0;;-1:-1:-1;;10776:36:0;;::::1;::::0;;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10758:54;;;10831:7;10823:16;;;::::0;::::1;;8264:1;8221:100:::0;;;8298:11;:9;:11::i;9342:104::-;9394:7;8239:8;:6;:8::i;:::-;-1:-1:-1;;;;;8225:22:0;:10;-1:-1:-1;;;;;8225:22:0;;8221:100;;;9421:17:::1;:15;:17::i;:::-;9414:24;;8221:100:::0;;;8298:11;:9;:11::i;:::-;9342:104;:::o;9662:221::-;8239:8;:6;:8::i;:::-;-1:-1:-1;;;;;8225:22:0;:10;-1:-1:-1;;;;;8225:22:0;;8221:100;;;9749:8:::1;:6;:8::i;:::-;-1:-1:-1::0;;;;;9737:20:0::1;:8;-1:-1:-1::0;;;;;9737:20:0::1;;;9729:68;;;;-1:-1:-1::0;;;9729:68:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9813:32;9826:8;:6;:8::i;:::-;9813:32;::::0;;-1:-1:-1;;;;;9813:32:0;;::::1;::::0;;;;::::1;;::::0;::::1;::::0;;;;;;;;;::::1;9856:19;9866:8;9856:9;:19::i;8783:86::-:0;8826:7;8239:8;:6;:8::i;:::-;-1:-1:-1;;;;;8225:22:0;:10;-1:-1:-1;;;;;8225:22:0;;8221:100;;;8853:8:::1;10913:219:::0;7978:66;11103:11;;11081:44::o;4872:163::-;4947:37;4966:17;4947:18;:37::i;:::-;5000:27;;-1:-1:-1;;;;;5000:27:0;;;;;;;;4872:163;:::o;2272:77::-;2313:28;2323:17;:15;:17::i;2313:28::-;2272:77::o;11219:301::-;7978:66;-1:-1:-1;;;;;11320:22:0;;11312:74;;;;-1:-1:-1;;;11312:74:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11480:22;11465:48::o;5131:422::-;5205:22;5230:17;:15;:17::i;:::-;5205:42;;5284:17;-1:-1:-1;;;;;5266:35:0;:14;-1:-1:-1;;;;;5266:35:0;;;5258:104;;;;-1:-1:-1;;;5258:104:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4347:66:0;5504:31;5489:57::o

Swarm Source

ipfs://d86a77a3ac5810bef8a244453ba1bee8c3cd15723333437382d47c0ea7402ecd

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.