Contract 0x86382d3f09a073f6bdb06f730b84342a2a9c59e6

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x5ffa590dc38bc48805fc2526ee33798600924406537d27dabe8a59e99b1ba6020x60806040197439622022-08-08 18:54:15109 days 17 hrs ago0xb013abd83f0bd173e9f14ce7d6e420ad711483b4 IN  Create: Treasury0 ETH0.004107592522 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x1a9ced30e129826abc1e24c028ff3bd116fe2723932eabd3b5192757cb6ba1f4209750752022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x1a9ced30e129826abc1e24c028ff3bd116fe2723932eabd3b5192757cb6ba1f4209750752022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x1a9ced30e129826abc1e24c028ff3bd116fe2723932eabd3b5192757cb6ba1f4209750752022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x84fe82fd527876300581e3762c01cfec0f07509e9ffe5003786b6ef83f7d3435209750622022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0xd40403de5d40750dd9737b5d132abe53d0cdd0bdcc1e79de5a98129f6f8b755d209750502022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0xd40403de5d40750dd9737b5d132abe53d0cdd0bdcc1e79de5a98129f6f8b755d209750502022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0xd40403de5d40750dd9737b5d132abe53d0cdd0bdcc1e79de5a98129f6f8b755d209750502022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0xd40403de5d40750dd9737b5d132abe53d0cdd0bdcc1e79de5a98129f6f8b755d209750502022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0xd40403de5d40750dd9737b5d132abe53d0cdd0bdcc1e79de5a98129f6f8b755d209750502022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0xd40403de5d40750dd9737b5d132abe53d0cdd0bdcc1e79de5a98129f6f8b755d209750502022-08-22 15:18:5495 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
0x5ee8559b8d19bb699819296e5bea5ae6d00631cc262c40f5ae88f55448e04157209749822022-08-22 15:17:5395 days 20 hrs ago 0xf9e197aa9fa7c3b27a1a1313cad5851b55f2fd71 0x86382d3f09a073f6bdb06f730b84342a2a9c59e60 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Treasury

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 22 : Treasury.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol';

import "./TreasurySettings.sol";

contract Treasury is Initializable, TreasurySettings {
    using SafeERC20Upgradeable for IERC20Upgradeable;

    address constant private TREASURY_MULTISIG = 0x0eB5B03c0303f2F47cD81d7BE4275AF8Ed347576;

    function initialize() external initializer {
        TreasurySettings.__TreasurySettings_init();
    }

    function isBridgeWorldPowered() external view contractsAreSet returns(bool) {
        return atlasMine.utilization() >= utilNeededToPowerBW;
    }

    function forwardCoinsToMine(uint256 _totalMagicSent) external contractsAreSet onlyAdminOrOwner {
        uint256 _magicToSendToMine = (_totalMagicSent * percentMagicToMine) / 100;
        if(_magicToSendToMine > 0) {
            bool _wasApproved = magic.approve(address(masterOfCoin), _magicToSendToMine);
            require(_wasApproved, "Could not approve magic to mine");

            masterOfCoin.grantTokenToStream(address(atlasMine), _magicToSendToMine);
        }
    }

    function withdrawMagic() external virtual onlyAdminOrOwner {
        IERC20Upgradeable _magic = IERC20Upgradeable(address(magic));
        uint256 _magicBalance = _magic.balanceOf(address(this));
        _magic.safeTransfer(TREASURY_MULTISIG, _magicBalance);
        emit Withdraw(address(magic), TREASURY_MULTISIG, _magicBalance);
    }
}

File 2 of 22 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 3 of 22 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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);

    /**
     * @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);
}

File 4 of 22 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20Upgradeable {
    using AddressUpgradeable for address;

    function safeTransfer(
        IERC20Upgradeable token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20Upgradeable token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 22 : TreasurySettings.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "./TreasuryContracts.sol";

abstract contract TreasurySettings is Initializable, TreasuryContracts {

    function __TreasurySettings_init() internal initializer {
        TreasuryContracts.__TreasuryContracts_init();
    }

    function setUtilNeededToPowerBW(uint256 _utilNeededToPowerBW) external onlyAdminOrOwner {
        require(_utilNeededToPowerBW <= 1 * 10**18, "Bad percent");
        utilNeededToPowerBW = _utilNeededToPowerBW;
    }

    function setpercentMagicToMine(uint256 _percentMagicToMine) external onlyAdminOrOwner {
        require(_percentMagicToMine >= 0 && _percentMagicToMine <= 100, "Bad percent");
        percentMagicToMine = _percentMagicToMine;
    }

}

File 6 of 22 : AddressUpgradeable.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 AddressUpgradeable {
    /**
     * @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 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);
            }
        }
    }
}

File 7 of 22 : TreasuryContracts.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "./TreasuryState.sol";

abstract contract TreasuryContracts is Initializable, TreasuryState {

    function __TreasuryContracts_init() internal initializer {
        TreasuryState.__TreasuryState_init();
    }

    function setContracts(
        address _masterOfCoinAddress,
        address _atlasMineAddress,
        address _magicAddress)
    external onlyAdminOrOwner
    {
        masterOfCoin = IMasterOfCoin(_masterOfCoinAddress);
        atlasMine = IAtlasMine(_atlasMineAddress);
        magic = IMagic(_magicAddress);
    }

    modifier contractsAreSet() {
        require(areContractsSet(), "Treasury: Contracts aren't set");

        _;
    }

    function areContractsSet() public view returns(bool) {
        return address(masterOfCoin) != address(0)
            && address(magic) != address(0)
            && address(atlasMine) != address(0);
    }
}

File 8 of 22 : TreasuryState.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/utils/ERC1155HolderUpgradeable.sol";

import "./ITreasury.sol";
import "../../shared/AdminableUpgradeable.sol";
import "../external/IMasterOfCoin.sol";
import "../external/IAtlasMine.sol";
import "../external/IMagic.sol";

abstract contract TreasuryState is Initializable, ITreasury, ERC1155HolderUpgradeable, AdminableUpgradeable {

    event Withdraw(address indexed _token, address indexed _to, uint256 _amt);

    IMasterOfCoin public masterOfCoin;
    IAtlasMine public atlasMine;
    IMagic public magic;

    // Utilization needed to power bridgeworld. 100% = 1 * 10**18
    uint256 public utilNeededToPowerBW;

    // number from 0-100
    uint256 public percentMagicToMine;

    function __TreasuryState_init() internal initializer {
        AdminableUpgradeable.__Adminable_init();
        ERC1155HolderUpgradeable.__ERC1155Holder_init();

        // 30%
        utilNeededToPowerBW = 3 * 10**17;
        percentMagicToMine = 33;
    }
}

File 9 of 22 : ERC1155HolderUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155ReceiverUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155HolderUpgradeable is Initializable, ERC1155ReceiverUpgradeable {
    function __ERC1155Holder_init() internal onlyInitializing {
    }

    function __ERC1155Holder_init_unchained() internal onlyInitializing {
    }
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 10 of 22 : ITreasury.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ITreasury {

    function isBridgeWorldPowered() external view returns(bool);

    function forwardCoinsToMine(uint256 _totalMagicSent) external;
}

File 11 of 22 : AdminableUpgradeable.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "./UtilitiesUpgradeable.sol";

// Do not add state to this contract.
//
contract AdminableUpgradeable is UtilitiesUpgradeable {

    mapping(address => bool) private admins;

    function __Adminable_init() internal initializer {
        UtilitiesUpgradeable.__Utilities__init();
    }

    function addAdmin(address _address) external onlyOwner {
        admins[_address] = true;
    }

    function addAdmins(address[] calldata _addresses) external onlyOwner {
        for(uint256 i = 0; i < _addresses.length; i++) {
            admins[_addresses[i]] = true;
        }
    }

    function removeAdmin(address _address) external onlyOwner {
        admins[_address] = false;
    }

    function removeAdmins(address[] calldata _addresses) external onlyOwner {
        for(uint256 i = 0; i < _addresses.length; i++) {
            admins[_addresses[i]] = false;
        }
    }

    function setPause(bool _shouldPause) external onlyAdminOrOwner {
        if(_shouldPause) {
            _pause();
        } else {
            _unpause();
        }
    }

    function isAdmin(address _address) public view returns(bool) {
        return admins[_address];
    }

    modifier onlyAdmin() {
        require(admins[msg.sender], "Not admin");
        _;
    }

    modifier onlyAdminOrOwner() {
        require(admins[msg.sender] || isOwner(), "Not admin or owner");
        _;
    }

    uint256[50] private __gap;
}

File 12 of 22 : IMasterOfCoin.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IMasterOfCoin {
    struct CoinStream {
        uint256 totalRewards;
        uint256 startTimestamp;
        uint256 endTimestamp;
        uint256 lastRewardTimestamp;
        uint256 ratePerSecond;
        uint256 paid;
    }
    
    function requestRewards() external returns (uint256 rewardsPaid);

    function grantTokenToStream(address _stream, uint256 _amount) external;

    function getStreams() external view returns (address[] memory);

    function getStreamConfig(address _stream) external view returns (CoinStream memory);

    function getGlobalRatePerSecond() external view returns (uint256 globalRatePerSecond);

    function getRatePerSecond(address _stream) external view returns (uint256 ratePerSecond);

    function getPendingRewards(address _stream) external view returns (uint256 pendingRewards);
}

File 13 of 22 : IAtlasMine.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IAtlasMine {

    // Returns the percentage of magic staked. 100% = 1 * 10**18
    function utilization() external view returns(uint256);
}

File 14 of 22 : IMagic.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IMagic {

    // Transfers the given amount to the recipient's wallet. Returns a boolean indicating if it was
    // successful or not.
    function transferFrom(address _sender, address _recipient, uint256 _amount) external returns(bool);

    // Transfer the given amount to the recipient's wallet. The sender is the caller of this function.
    // Returns a boolean indicating if it was successful or not.
    function transfer(address _recipient, uint256 _amount) external returns(bool);

    function approve(address _spender, uint256 _amount) external returns(bool);
}

File 15 of 22 : ERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155ReceiverUpgradeable.sol";
import "../../../utils/introspection/ERC165Upgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155ReceiverUpgradeable is Initializable, ERC165Upgradeable, IERC1155ReceiverUpgradeable {
    function __ERC1155Receiver_init() internal onlyInitializing {
    }

    function __ERC1155Receiver_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
        return interfaceId == type(IERC1155ReceiverUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 16 of 22 : IERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 17 of 22 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 18 of 22 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 19 of 22 : UtilitiesUpgradeable.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract UtilitiesUpgradeable is Initializable, OwnableUpgradeable, PausableUpgradeable {

    function __Utilities__init() internal initializer {
        OwnableUpgradeable.__Ownable_init();
        PausableUpgradeable.__Pausable_init();

        _pause();
    }

    modifier nonZeroAddress(address _address) {
        require(address(0) != _address, "0 address");
        _;
    }

    modifier nonZeroLength(uint[] memory _array) {
        require(_array.length > 0, "Empty array");
        _;
    }

    modifier lengthsAreEqual(uint[] memory _array1, uint[] memory _array2) {
        require(_array1.length == _array2.length, "Unequal lengths");
        _;
    }

    modifier onlyEOA() {
        /* solhint-disable avoid-tx-origin */
        require(msg.sender == tx.origin, "No contracts");
        _;
    }

    function isOwner() internal view returns(bool) {
        return owner() == msg.sender;
    }

    function compareStrings(string memory a, string memory b) internal pure returns (bool) {
        return (keccak256(abi.encodePacked((a))) == keccak256(abi.encodePacked((b))));
    }
}

File 20 of 22 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 21 of 22 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 22 of 22 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amt","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"addAdmins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"areContractsSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"atlasMine","outputs":[{"internalType":"contract IAtlasMine","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalMagicSent","type":"uint256"}],"name":"forwardCoinsToMine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBridgeWorldPowered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"magic","outputs":[{"internalType":"contract IMagic","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterOfCoin","outputs":[{"internalType":"contract IMasterOfCoin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"percentMagicToMine","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"removeAdmins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_masterOfCoinAddress","type":"address"},{"internalType":"address","name":"_atlasMineAddress","type":"address"},{"internalType":"address","name":"_magicAddress","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_shouldPause","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_utilNeededToPowerBW","type":"uint256"}],"name":"setUtilNeededToPowerBW","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_percentMagicToMine","type":"uint256"}],"name":"setpercentMagicToMine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"utilNeededToPowerBW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawMagic","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50611ac6806100206000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c806370480275116100de5780639c54df6411610097578063bedb86fb11610071578063bedb86fb1461036c578063ca1709551461037f578063f23a6e6114610387578063f2fde38b146103a657600080fd5b80639c54df641461030e578063b3066d4914610321578063bc197c811461033457600080fd5b806370480275146102c8578063715018a6146102db5780638129fc1c146102e357806387eff8e1146102eb5780638cdcc4b4146102f55780638da5cb5b146102fd57600080fd5b80633995c8801161014b57806359193fc51161012557806359193fc51461027e5780635c975abb1461029157806360a7efb21461029c57806365ad47fd146102b057600080fd5b80633995c8801461024f57806343e0334114610263578063444da9c61461027657600080fd5b806301ffc9a7146101935780630d854646146101bb5780631785f53c146101e757806324d7806c146101fc57806329060ac214610229578063377e11e01461023c575b600080fd5b6101a66101a13660046114c1565b6103b9565b60405190151581526020015b60405180910390f35b610162546101cf906001600160a01b031681565b6040516001600160a01b0390911681526020016101b2565b6101fa6101f5366004611507565b6103f0565b005b6101a661020a366004611507565b6001600160a01b0316600090815261012d602052604090205460ff1690565b6101fa610237366004611522565b610445565b6101fa61024a36600461153b565b6104cf565b610161546101cf906001600160a01b031681565b6101fa610271366004611522565b610571565b6101fa6105f4565b6101fa61028c366004611522565b610738565b60fb5460ff166101a6565b610160546101cf906001600160a01b031681565b6102ba6101645481565b6040519081526020016101b2565b6101fa6102d6366004611507565b61093d565b6101fa61098c565b6101fa6109c2565b6102ba6101635481565b6101a6610a3c565b60c9546001600160a01b03166101cf565b6101fa61031c36600461153b565b610a81565b6101fa61032f3660046115b0565b610b1e565b61035361034236600461171f565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101b2565b6101fa61037a3660046117d7565b610b9e565b6101a6610bf2565b6103536103953660046117f4565b63f23a6e6160e01b95945050505050565b6101fa6103b4366004611507565b610cda565b60006001600160e01b03198216630271189760e51b14806103ea57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60c9546001600160a01b031633146104235760405162461bcd60e51b815260040161041a90611859565b60405180910390fd5b6001600160a01b0316600090815261012d60205260409020805460ff19169055565b33600090815261012d602052604090205460ff16806104675750610467610d72565b6104835760405162461bcd60e51b815260040161041a9061188e565b670de0b6b3a76400008111156104c95760405162461bcd60e51b815260206004820152600b60248201526a109859081c195c98d95b9d60aa1b604482015260640161041a565b61016355565b60c9546001600160a01b031633146104f95760405162461bcd60e51b815260040161041a90611859565b60005b8181101561056c57600061012d600085858581811061051d5761051d6118ba565b90506020020160208101906105329190611507565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610564816118e6565b9150506104fc565b505050565b33600090815261012d602052604090205460ff16806105935750610593610d72565b6105af5760405162461bcd60e51b815260040161041a9061188e565b60648111156105ee5760405162461bcd60e51b815260206004820152600b60248201526a109859081c195c98d95b9d60aa1b604482015260640161041a565b61016455565b33600090815261012d602052604090205460ff16806106165750610616610d72565b6106325760405162461bcd60e51b815260040161041a9061188e565b610162546040516370a0823160e01b81523060048201526001600160a01b039091169060009082906370a082319060240160206040518083038186803b15801561067b57600080fd5b505afa15801561068f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b39190611901565b90506106dd6001600160a01b038316730eb5b03c0303f2f47cd81d7be4275af8ed34757683610d96565b61016254604051828152730eb5b03c0303f2f47cd81d7be4275af8ed347576916001600160a01b0316907f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9060200160405180910390a35050565b610740610a3c565b61078c5760405162461bcd60e51b815260206004820152601e60248201527f54726561737572793a20436f6e747261637473206172656e2774207365740000604482015260640161041a565b33600090815261012d602052604090205460ff16806107ae57506107ae610d72565b6107ca5760405162461bcd60e51b815260040161041a9061188e565b6000606461016454836107dd919061191a565b6107e79190611939565b9050801561093957610162546101605460405163095ea7b360e01b81526001600160a01b03918216600482015260248101849052600092919091169063095ea7b390604401602060405180830381600087803b15801561084657600080fd5b505af115801561085a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087e919061195b565b9050806108cd5760405162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f7420617070726f7665206d6167696320746f206d696e6500604482015260640161041a565b6101605461016154604051631fe8cf2f60e21b81526001600160a01b03918216600482015260248101859052911690637fa33cbc90604401600060405180830381600087803b15801561091f57600080fd5b505af1158015610933573d6000803e3d6000fd5b50505050505b5050565b60c9546001600160a01b031633146109675760405162461bcd60e51b815260040161041a90611859565b6001600160a01b0316600090815261012d60205260409020805460ff19166001179055565b60c9546001600160a01b031633146109b65760405162461bcd60e51b815260040161041a90611859565b6109c06000610de8565b565b600054610100900460ff166109dd5760005460ff16156109e1565b303b155b6109fd5760405162461bcd60e51b815260040161041a90611978565b600054610100900460ff16158015610a1f576000805461ffff19166101011790555b610a27610e3a565b8015610a39576000805461ff00191690555b50565b610160546000906001600160a01b031615801590610a655750610162546001600160a01b031615155b8015610a7c5750610161546001600160a01b031615155b905090565b60c9546001600160a01b03163314610aab5760405162461bcd60e51b815260040161041a90611859565b60005b8181101561056c57600161012d6000858585818110610acf57610acf6118ba565b9050602002016020810190610ae49190611507565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b16816118e6565b915050610aae565b33600090815261012d602052604090205460ff1680610b405750610b40610d72565b610b5c5760405162461bcd60e51b815260040161041a9061188e565b61016080546001600160a01b039485166001600160a01b0319918216179091556101618054938516938216939093179092556101628054919093169116179055565b33600090815261012d602052604090205460ff1680610bc05750610bc0610d72565b610bdc5760405162461bcd60e51b815260040161041a9061188e565b8015610bea57610a39610e9f565b610a39610f37565b6000610bfc610a3c565b610c485760405162461bcd60e51b815260206004820152601e60248201527f54726561737572793a20436f6e747261637473206172656e2774207365740000604482015260640161041a565b6101635461016160009054906101000a90046001600160a01b03166001600160a01b031663ea21cd926040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9b57600080fd5b505afa158015610caf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd39190611901565b1015905090565b60c9546001600160a01b03163314610d045760405162461bcd60e51b815260040161041a90611859565b6001600160a01b038116610d695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161041a565b610a3981610de8565b600033610d8760c9546001600160a01b031690565b6001600160a01b031614905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261056c908490610fb1565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610e555760005460ff1615610e59565b303b155b610e755760405162461bcd60e51b815260040161041a90611978565b600054610100900460ff16158015610e97576000805461ffff19166101011790555b610a27611083565b60fb5460ff1615610ee55760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161041a565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f1a3390565b6040516001600160a01b03909116815260200160405180910390a1565b60fb5460ff16610f805760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161041a565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33610f1a565b6000611006826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166110e89092919063ffffffff16565b80519091501561056c5780806020019051810190611024919061195b565b61056c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161041a565b600054610100900460ff1661109e5760005460ff16156110a2565b303b155b6110be5760405162461bcd60e51b815260040161041a90611978565b600054610100900460ff161580156110e0576000805461ffff19166101011790555b610a27611101565b60606110f78484600085611195565b90505b9392505050565b600054610100900460ff1661111c5760005460ff1615611120565b303b155b61113c5760405162461bcd60e51b815260040161041a90611978565b600054610100900460ff1615801561115e576000805461ffff19166101011790555b6111666112c6565b61116e61132b565b670429d069189e0000610163556021610164558015610a39576000805461ff001916905550565b6060824710156111f65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161041a565b6001600160a01b0385163b61124d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161041a565b600080866001600160a01b0316858760405161126991906119f6565b60006040518083038185875af1925050503d80600081146112a6576040519150601f19603f3d011682016040523d82523d6000602084013e6112ab565b606091505b50915091506112bb828286611352565b979650505050505050565b600054610100900460ff166112e15760005460ff16156112e5565b303b155b6113015760405162461bcd60e51b815260040161041a90611978565b600054610100900460ff16158015611323576000805461ffff19166101011790555b610a2761138b565b600054610100900460ff166109c05760405162461bcd60e51b815260040161041a90611a12565b606083156113615750816110fa565b8251156113715782518084602001fd5b8160405162461bcd60e51b815260040161041a9190611a5d565b600054610100900460ff166113a65760005460ff16156113aa565b303b155b6113c65760405162461bcd60e51b815260040161041a90611978565b600054610100900460ff161580156113e8576000805461ffff19166101011790555b6113f0611400565b6113f861142f565b610a27610e9f565b600054610100900460ff166114275760405162461bcd60e51b815260040161041a90611a12565b6109c061145e565b600054610100900460ff166114565760405162461bcd60e51b815260040161041a90611a12565b6109c061148e565b600054610100900460ff166114855760405162461bcd60e51b815260040161041a90611a12565b6109c033610de8565b600054610100900460ff166114b55760405162461bcd60e51b815260040161041a90611a12565b60fb805460ff19169055565b6000602082840312156114d357600080fd5b81356001600160e01b0319811681146110fa57600080fd5b80356001600160a01b038116811461150257600080fd5b919050565b60006020828403121561151957600080fd5b6110fa826114eb565b60006020828403121561153457600080fd5b5035919050565b6000806020838503121561154e57600080fd5b823567ffffffffffffffff8082111561156657600080fd5b818501915085601f83011261157a57600080fd5b81358181111561158957600080fd5b8660208260051b850101111561159e57600080fd5b60209290920196919550909350505050565b6000806000606084860312156115c557600080fd5b6115ce846114eb565b92506115dc602085016114eb565b91506115ea604085016114eb565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611632576116326115f3565b604052919050565b600082601f83011261164b57600080fd5b8135602067ffffffffffffffff821115611667576116676115f3565b8160051b611676828201611609565b928352848101820192828101908785111561169057600080fd5b83870192505b848310156112bb57823582529183019190830190611696565b600082601f8301126116c057600080fd5b813567ffffffffffffffff8111156116da576116da6115f3565b6116ed601f8201601f1916602001611609565b81815284602083860101111561170257600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561173757600080fd5b611740866114eb565b945061174e602087016114eb565b9350604086013567ffffffffffffffff8082111561176b57600080fd5b61177789838a0161163a565b9450606088013591508082111561178d57600080fd5b61179989838a0161163a565b935060808801359150808211156117af57600080fd5b506117bc888289016116af565b9150509295509295909350565b8015158114610a3957600080fd5b6000602082840312156117e957600080fd5b81356110fa816117c9565b600080600080600060a0868803121561180c57600080fd5b611815866114eb565b9450611823602087016114eb565b93506040860135925060608601359150608086013567ffffffffffffffff81111561184d57600080fd5b6117bc888289016116af565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601290820152712737ba1030b236b4b71037b91037bbb732b960711b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156118fa576118fa6118d0565b5060010190565b60006020828403121561191357600080fd5b5051919050565b6000816000190483118215151615611934576119346118d0565b500290565b60008261195657634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561196d57600080fd5b81516110fa816117c9565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60005b838110156119e15781810151838201526020016119c9565b838111156119f0576000848401525b50505050565b60008251611a088184602087016119c6565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020815260008251806020840152611a7c8160408501602087016119c6565b601f01601f1916919091016040019291505056fea2646970667358221220cf59a90322f895fcc98da676142f83893d86de714f10db5c794bb9808a62175264736f6c63430008090033

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