false
false

Contract Address Details

0x7f24cc3c8053db2ebb8764e0204575847b0b39cb

Contract Name
UpgradeableBeaconWithPr..pgrader
Creator
0x3455fa–f3666d at 0x85f319–e743de
Implementation
ArbSubredditPointsImport | 0x352dd7cfa76665c3450178be391f88bf2be7458e
Balance
0 ETH ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
70562070
Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x7414e43014f275c846aa2b952a9850c7fdc7526b.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Verify & Publish
Contract name:
UpgradeableBeaconWithProxyUpgrader




Optimization enabled
true
Compiler version
v0.8.12+commit.f00d7308




Optimization runs
10
Verified at
2023-08-24T23:26:33.523000Z

contracts/UpgradeableBeaconWithProxyUpgrader.sol

/*
    SPDX-License-Identifier: Apache-2.0

    Copyright 2022 Reddit, Inc

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import "./IUpgradeableBeaconProxy.sol";

// Beacon that can upgrade an UpgradeableBeaconProxy's Beacon
contract UpgradeableBeaconWithProxyUpgrader is UpgradeableBeacon {
    constructor(address implementation) UpgradeableBeacon(implementation) {}

    function upgradeBeaconProxyToUseNewBeaconAndCall(
        IUpgradeableBeaconProxy beaconProxy,
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) external onlyOwner {
        beaconProxy.upgradeBeaconToAndCall(newBeacon, data, forceCall);
    }
}
        

@openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
          

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"implementation","internalType":"address"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"implementation","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeBeaconProxyToUseNewBeaconAndCall","inputs":[{"type":"address","name":"beaconProxy","internalType":"contract IUpgradeableBeaconProxy"},{"type":"address","name":"newBeacon","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"},{"type":"bool","name":"forceCall","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]}]
              

Contract Creation Code

Verify & Publish
0x608060405234801561001057600080fd5b5060405161077a38038061077a83398101604081905261002f91610153565b8061003933610049565b61004281610099565b5050610183565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100ac8161014460201b6102d41760201c565b6101225760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03163b151590565b60006020828403121561016557600080fd5b81516001600160a01b038116811461017c57600080fd5b9392505050565b6105e8806101926000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806310902306146100675780633659cfe61461007c5780635c60da1b1461008f578063715018a6146100b85780638da5cb5b146100c0578063f2fde38b146100c8575b600080fd5b61007a610075366004610406565b6100db565b005b61007a61008a3660046104ec565b61017b565b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61007a6101ea565b61009c610225565b61007a6100d63660046104ec565b610234565b336100e4610225565b6001600160a01b0316146101135760405162461bcd60e51b815260040161010a90610510565b60405180910390fd5b604051635aabcad560e01b81526001600160a01b03851690635aabcad59061014390869086908690600401610545565b600060405180830381600087803b15801561015d57600080fd5b505af1158015610171573d6000803e3d6000fd5b5050505050505050565b33610184610225565b6001600160a01b0316146101aa5760405162461bcd60e51b815260040161010a90610510565b6101b3816102e3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b336101f3610225565b6001600160a01b0316146102195760405162461bcd60e51b815260040161010a90610510565b6102236000610376565b565b6000546001600160a01b031690565b3361023d610225565b6001600160a01b0316146102635760405162461bcd60e51b815260040161010a90610510565b6001600160a01b0381166102c85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161010a565b6102d181610376565b50565b6001600160a01b03163b151590565b6102ec816102d4565b6103545760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b606482015260840161010a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146102d157600080fd5b634e487b7160e01b600052604160045260246000fd5b8035801515811461040157600080fd5b919050565b6000806000806080858703121561041c57600080fd5b8435610427816103c6565b93506020850135610437816103c6565b925060408501356001600160401b038082111561045357600080fd5b818701915087601f83011261046757600080fd5b813581811115610479576104796103db565b604051601f8201601f19908116603f011681019083821181831017156104a1576104a16103db565b816040528281528a60208487010111156104ba57600080fd5b8260208601602083013760006020848301015280965050505050506104e1606086016103f1565b905092959194509250565b6000602082840312156104fe57600080fd5b8135610509816103c6565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b038416815260006020606081840152845180606085015260005b8181101561058157868101830151858201608001528201610565565b81811115610593576000608083870101525b5093151560408401525050601f91909101601f1916016080019291505056fea264697066735822122042394612e76871f36310e42cc2ad232024852a0c5a633852b0620d931794318f64736f6c634300080c0033000000000000000000000000a17d914d67cdb35bdc1aefa57f344a37baf64131

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c806310902306146100675780633659cfe61461007c5780635c60da1b1461008f578063715018a6146100b85780638da5cb5b146100c0578063f2fde38b146100c8575b600080fd5b61007a610075366004610406565b6100db565b005b61007a61008a3660046104ec565b61017b565b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61007a6101ea565b61009c610225565b61007a6100d63660046104ec565b610234565b336100e4610225565b6001600160a01b0316146101135760405162461bcd60e51b815260040161010a90610510565b60405180910390fd5b604051635aabcad560e01b81526001600160a01b03851690635aabcad59061014390869086908690600401610545565b600060405180830381600087803b15801561015d57600080fd5b505af1158015610171573d6000803e3d6000fd5b5050505050505050565b33610184610225565b6001600160a01b0316146101aa5760405162461bcd60e51b815260040161010a90610510565b6101b3816102e3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b336101f3610225565b6001600160a01b0316146102195760405162461bcd60e51b815260040161010a90610510565b6102236000610376565b565b6000546001600160a01b031690565b3361023d610225565b6001600160a01b0316146102635760405162461bcd60e51b815260040161010a90610510565b6001600160a01b0381166102c85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161010a565b6102d181610376565b50565b6001600160a01b03163b151590565b6102ec816102d4565b6103545760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b606482015260840161010a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146102d157600080fd5b634e487b7160e01b600052604160045260246000fd5b8035801515811461040157600080fd5b919050565b6000806000806080858703121561041c57600080fd5b8435610427816103c6565b93506020850135610437816103c6565b925060408501356001600160401b038082111561045357600080fd5b818701915087601f83011261046757600080fd5b813581811115610479576104796103db565b604051601f8201601f19908116603f011681019083821181831017156104a1576104a16103db565b816040528281528a60208487010111156104ba57600080fd5b8260208601602083013760006020848301015280965050505050506104e1606086016103f1565b905092959194509250565b6000602082840312156104fe57600080fd5b8135610509816103c6565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b038416815260006020606081840152845180606085015260005b8181101561058157868101830151858201608001528201610565565b81811115610593576000608083870101525b5093151560408401525050601f91909101601f1916016080019291505056fea264697066735822122042394612e76871f36310e42cc2ad232024852a0c5a633852b0620d931794318f64736f6c634300080c0033