Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
QBridgeHandler
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
/*
___ ___ ___ ___ ___
/\ \ /\__\ /\ \ /\ \ /\ \
/::\ \ /:/ _/_ /::\ \ _\:\ \ \:\ \
\:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\ /::\__\
\::/ / \:\/:/ / \:\::/ / \::/\/__/ /:/\/__/
/:/ / \::/ / \::/ / \:\__\ \/__/
\/__/ \/__/ \/__/ \/__/
*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../interfaces/IQBridgeHandler.sol";
import "../interfaces/IQBridgeDelegator.sol";
import "../library/SafeToken.sol";
import "./QBridgeToken.sol";
contract QBridgeHandler is IQBridgeHandler, OwnableUpgradeable {
using SafeMath for uint;
using SafeToken for address;
/* ========== CONSTANT VARIABLES ========== */
uint public constant OPTION_QUBIT_BNB_NONE = 100;
uint public constant OPTION_QUBIT_BNB_0100 = 110;
uint public constant OPTION_QUBIT_BNB_0050 = 105;
uint public constant OPTION_BUNNY_XLP_0150 = 215;
/* ========== STATE VARIABLES ========== */
address public _bridgeAddress;
mapping(bytes32 => address) public resourceIDToTokenContractAddress; // resourceID => token contract address
mapping(address => bytes32) public tokenContractAddressToResourceID; // token contract address => resourceID
mapping(address => bool) public burnList; // token contract address => is burnable
mapping(address => bool) public contractWhitelist; // token contract address => is whitelisted
mapping(uint => address) public delegators; // option => delegator contract address
mapping(bytes32 => uint) public withdrawalFees; // resourceID => withdraw fee
mapping(bytes32 => mapping(uint => uint)) public minAmounts; // [resourceID][option] => minDepositAmount
/* ========== INITIALIZER ========== */
function initialize(address bridgeAddress) external initializer {
__Ownable_init();
_bridgeAddress = bridgeAddress;
}
/* ========== MODIFIERS ========== */
modifier onlyBridge() {
require(msg.sender == _bridgeAddress, "QBridgeHandler: caller is not the bridge contract");
_;
}
/* ========== RESTRICTED FUNCTIONS ========== */
function setResource(bytes32 resourceID, address contractAddress) external override onlyBridge {
resourceIDToTokenContractAddress[resourceID] = contractAddress;
tokenContractAddressToResourceID[contractAddress] = resourceID;
contractWhitelist[contractAddress] = true;
}
function setBurnable(address contractAddress) external override onlyBridge {
require(contractWhitelist[contractAddress], "QBridgeHandler: contract address is not whitelisted");
burnList[contractAddress] = true;
}
function setDelegator(uint option, address newDelegator) external onlyOwner {
delegators[option] = newDelegator;
}
function setWithdrawalFee(bytes32 resourceID, uint withdrawalFee) external onlyOwner {
withdrawalFees[resourceID] = withdrawalFee;
}
function setMinDepositAmount(bytes32 resourceID, uint option, uint minAmount) external onlyOwner {
minAmounts[resourceID][option] = minAmount;
}
/**
@notice A deposit is initiated by making a deposit in the Bridge contract.
@param resourceID ResourceID used to find address of token to be used for deposit.
@param depositer Address of account making the deposit in the Bridge contract.
@param data passed into the function should be constructed as follows:
option uint256 bytes 0 - 32
amount uint256 bytes 32 - 64
*/
function deposit(bytes32 resourceID, address depositer, bytes calldata data) external override onlyBridge {
uint option;
uint amount;
(option, amount) = abi.decode(data, (uint, uint));
address tokenAddress = resourceIDToTokenContractAddress[resourceID];
require(contractWhitelist[tokenAddress], "provided tokenAddress is not whitelisted");
if (burnList[tokenAddress]) {
require(amount >= withdrawalFees[resourceID], "less than withdrawal fee");
QBridgeToken(tokenAddress).burnFrom(depositer, amount);
} else {
require(amount >= minAmounts[resourceID][option], "less than minimum amount");
tokenAddress.safeTransferFrom(depositer, address(this), amount);
}
}
/**
@notice Proposal execution should be initiated by a relayer on the deposit's destination chain.
@param data passed into the function should be constructed as follows:
option uint256
amount uint256
destinationRecipientAddress address
*/
function executeProposal(bytes32 resourceID, bytes calldata data) external override onlyBridge {
uint option;
uint amount;
address recipientAddress;
(option, amount, recipientAddress) = abi.decode(data, (uint, uint, address));
address tokenAddress = resourceIDToTokenContractAddress[resourceID];
require(contractWhitelist[tokenAddress], "provided tokenAddress is not whitelisted");
if (burnList[tokenAddress]) {
address delegatorAddress = delegators[option];
if (delegatorAddress == address(0)) {
QBridgeToken(tokenAddress).mint(recipientAddress, amount);
} else {
QBridgeToken(tokenAddress).mint(delegatorAddress, amount);
IQBridgeDelegator(delegatorAddress).delegate(tokenAddress, recipientAddress, option, amount);
}
} else {
tokenAddress.safeTransfer(recipientAddress, amount.sub(withdrawalFees[resourceID]));
}
}
function withdraw(address tokenAddress, address recipient, uint amount) external override onlyBridge {
tokenAddress.safeTransfer(recipient, amount);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/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 initializer {
__Context_init_unchained();
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal initializer {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), 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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
interface IQBridgeHandler {
/**
@notice Correlates {resourceID} with {contractAddress}.
@param resourceID ResourceID to be used when making deposits.
@param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
*/
function setResource(bytes32 resourceID, address contractAddress) external;
/**
@notice Marks {contractAddress} as mintable/burnable.
@param contractAddress Address of contract to be used when making or executing deposits.
*/
function setBurnable(address contractAddress) external;
/**
@notice It is intended that deposit are made using the Bridge contract.
@param depositer Address of account making the deposit in the Bridge contract.
@param data Consists of additional data needed for a specific deposit.
*/
function deposit(bytes32 resourceID, address depositer, bytes calldata data) external;
/**
@notice It is intended that proposals are executed by the Bridge contract.
@param data Consists of additional data needed for a specific deposit execution.
*/
function executeProposal(bytes32 resourceID, bytes calldata data) external;
/**
@notice Used to manually release funds from ERC safes.
@param tokenAddress Address of token contract to release.
@param recipient Address to release tokens to.
@param amount the amount of ERC20 tokens to release.
*/
function withdraw(address tokenAddress, address recipient, uint amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
interface IQBridgeDelegator {
function delegate(address xToken, address account, uint option, uint amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface ERC20Interface {
function balanceOf(address user) external view returns (uint);
}
library SafeToken {
function myBalance(address token) internal view returns (uint) {
return ERC20Interface(token).balanceOf(address(this));
}
function balanceOf(address token, address user) internal view returns (uint) {
return ERC20Interface(token).balanceOf(user);
}
function safeApprove(
address token,
address to,
uint value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeApprove");
}
function safeTransfer(
address token,
address to,
uint value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransfer");
}
function safeTransferFrom(
address token,
address from,
address to,
uint value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransferFrom");
}
function safeTransferETH(address to, uint value) internal {
(bool success, ) = to.call{ value: value }(new bytes(0));
require(success, "!safeTransferETH");
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/*
___ ___ ___ ___ ___
/\ \ /\__\ /\ \ /\ \ /\ \
/::\ \ /:/ _/_ /::\ \ _\:\ \ \:\ \
\:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\ /::\__\
\::/ / \:\/:/ / \:\::/ / \::/\/__/ /:/\/__/
/:/ / \::/ / \::/ / \:\__\ \/__/
\/__/ \/__/ \/__/ \/__/
*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import "../library/BEP20Upgradeable.sol";
contract QBridgeToken is BEP20Upgradeable {
/* ========== STATE VARIABLES ========== */
mapping(address => bool) private _minters;
/* ========== MODIFIERS ========== */
modifier onlyMinter() {
require(isMinter(msg.sender), "QBridgeToken: caller is not the minter");
_;
}
/* ========== INITIALIZER ========== */
function initialize(string memory name, string memory symbol, uint8 decimals) external initializer {
__BEP20__init(name, symbol, decimals);
}
/* ========== RESTRICTED FUNCTIONS ========== */
function setMinter(address minter, bool canMint) external onlyOwner {
_minters[minter] = canMint;
}
function mint(address _to, uint _amount) public onlyMinter {
_mint(_to, _amount);
}
function burnFrom(address account, uint amount) public onlyMinter {
uint decreasedAllowance = allowance(account, msg.sender).sub(amount, "BEP20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
/* ========== VIEWS ========== */
function isMinter(address account) public view returns (bool) {
return _minters[account];
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../proxy/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 GSN 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 initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <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 a proxied contract can't have 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 {UpgradeableProxy-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.
*/
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() {
require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function _isConstructor() private view returns (bool) {
return !AddressUpgradeable.isContract(address(this));
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 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");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(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");
// solhint-disable-next-line avoid-low-level-calls
(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");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
abstract contract BEP20Upgradeable is IBEP20, OwnableUpgradeable {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint[50] private __gap;
/**
* @dev sets initials supply and the owner
*/
function __BEP20__init(
string memory name,
string memory symbol,
uint8 decimals
) internal initializer {
__Ownable_init();
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @dev Returns the bep token owner.
*/
function getOwner() external view override returns (address) {
return owner();
}
/**
* @dev Returns the token decimals.
*/
function decimals() external view override returns (uint8) {
return _decimals;
}
/**
* @dev Returns the token symbol.
*/
function symbol() external view override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the token name.
*/
function name() external view override returns (string memory) {
return _name;
}
/**
* @dev See {BEP20-totalSupply}.
*/
function totalSupply() public view override returns (uint) {
return _totalSupply;
}
/**
* @dev See {BEP20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint) {
return _balances[account];
}
/**
* @dev See {BEP20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {BEP20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
/**
* @dev See {BEP20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {BEP20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {BEP20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint amount
) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance")
);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {BEP20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {BEP20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero")
);
return true;
}
/**
* @dev Burn `amount` tokens and decreasing the total supply.
*/
function burn(uint amount) public returns (bool) {
_burn(_msgSender(), amount);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint amount
) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint amount) internal {
require(account != address(0), "BEP20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint amount) internal {
require(account != address(0), "BEP20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint amount
) internal {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint amount) internal {
_burn(account, amount);
_approve(
account,
_msgSender(),
_allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance")
);
}
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.4.0;
interface IBEP20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the token name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the bep token owner.
*/
function getOwner() external view returns (address);
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
address recipient,
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);
}{
"evmVersion": "istanbul",
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"OPTION_BUNNY_XLP_0150","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPTION_QUBIT_BNB_0050","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPTION_QUBIT_BNB_0100","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPTION_QUBIT_BNB_NONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_bridgeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"burnList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contractWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"delegators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"address","name":"depositer","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"executeProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"minAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"resourceIDToTokenContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setBurnable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"option","type":"uint256"},{"internalType":"address","name":"newDelegator","type":"address"}],"name":"setDelegator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"uint256","name":"option","type":"uint256"},{"internalType":"uint256","name":"minAmount","type":"uint256"}],"name":"setMinDepositAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setResource","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalFee","type":"uint256"}],"name":"setWithdrawalFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenContractAddressToResourceID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"withdrawalFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506115f3806100206000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c8063aa52df9f116100c3578063ca0d9fc41161007c578063ca0d9fc4146102b9578063d9caed12146102c1578063e0a45ff3146102d4578063e1de99d3146102dc578063e248cff2146102e4578063f2fde38b146102f757610158565b8063aa52df9f14610252578063b07e54bb14610265578063b1a83e4214610278578063b54ce96f14610280578063b8fa373614610293578063c4d66de8146102a657610158565b80635be612c7116101155780635be612c7146101f6578063715018a6146102095780637885413f146102115780638da5cb5b1461022457806393dc415d1461022c578063a31bee721461023f57610158565b806307b7ed991461015d578063318c136e1461017257806335d0d5dc1461019057806345198585146101a35780634c999f5e146101c3578063560a0b8e146101e3575b600080fd5b61017061016b366004611043565b61030a565b005b61017a610399565b604051610187919061126e565b60405180910390f35b61017a61019e3660046110c6565b6103a8565b6101b66101b13660046110c6565b6103c3565b60405161018791906112f3565b6101d66101d1366004611043565b6103d5565b60405161018791906112e8565b6101d66101f1366004611043565b6103ea565b61017a6102043660046110c6565b6103ff565b61017061041a565b6101b661021f3660046111b1565b6104a3565b61017a6104c0565b6101b661023a366004611043565b6104cf565b61017061024d3660046111b1565b6104e1565b6101706102603660046111d2565b610532565b61017061027336600461110d565b61058d565b6101b661071e565b61017061028e3660046110de565b610723565b6101706102a13660046110de565b610790565b6101706102b4366004611043565b61080a565b6101b66108b1565b6101706102cf366004611066565b6108b6565b6101b66108f9565b6101b66108fe565b6101706102f2366004611167565b610903565b610170610305366004611043565b610b2b565b6065546001600160a01b0316331461033d5760405162461bcd60e51b815260040161033490611504565b60405180910390fd5b6001600160a01b03811660009081526069602052604090205460ff166103755760405162461bcd60e51b815260040161033490611555565b6001600160a01b03166000908152606860205260409020805460ff19166001179055565b6065546001600160a01b031681565b6066602052600090815260409020546001600160a01b031681565b606b6020526000908152604090205481565b60696020526000908152604090205460ff1681565b60686020526000908152604090205460ff1681565b606a602052600090815260409020546001600160a01b031681565b610422610bec565b6001600160a01b03166104336104c0565b6001600160a01b0316146104595760405162461bcd60e51b815260040161033490611425565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b606c60209081526000928352604080842090915290825290205481565b6033546001600160a01b031690565b60676020526000908152604090205481565b6104e9610bec565b6001600160a01b03166104fa6104c0565b6001600160a01b0316146105205760405162461bcd60e51b815260040161033490611425565b6000918252606b602052604090912055565b61053a610bec565b6001600160a01b031661054b6104c0565b6001600160a01b0316146105715760405162461bcd60e51b815260040161033490611425565b6000928352606c60209081526040808520938552929052912055565b6065546001600160a01b031633146105b75760405162461bcd60e51b815260040161033490611504565b6000806105c6838501856111b1565b6000888152606660209081526040808320546001600160a01b03168084526069909252909120549294509092509060ff166106135760405162461bcd60e51b81526004016103349061145a565b6001600160a01b03811660009081526068602052604090205460ff16156106c7576000878152606b60205260409020548210156106625760405162461bcd60e51b8152600401610334906114cd565b60405163079cc67960e41b81526001600160a01b038216906379cc67909061069090899086906004016112cf565b600060405180830381600087803b1580156106aa57600080fd5b505af11580156106be573d6000803e3d6000fd5b50505050610715565b6000878152606c602090815260408083208684529091529020548210156107005760405162461bcd60e51b815260040161033490611379565b6107156001600160a01b038216873085610bf0565b50505050505050565b606481565b61072b610bec565b6001600160a01b031661073c6104c0565b6001600160a01b0316146107625760405162461bcd60e51b815260040161033490611425565b6000918252606a602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6065546001600160a01b031633146107ba5760405162461bcd60e51b815260040161033490611504565b600082815260666020908152604080832080546001600160a01b039095166001600160a01b031990951685179055928252606781528282209390935560699092529020805460ff19166001179055565b600054610100900460ff16806108235750610823610ce1565b80610831575060005460ff16155b61084d5760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610878576000805460ff1961ff0019909116610100171660011790555b610880610cf2565b606580546001600160a01b0319166001600160a01b03841617905580156108ad576000805461ff00191690555b5050565b60d781565b6065546001600160a01b031633146108e05760405162461bcd60e51b815260040161033490611504565b6108f46001600160a01b0384168383610d85565b505050565b606981565b606e81565b6065546001600160a01b0316331461092d5760405162461bcd60e51b815260040161033490611504565b6000808061093d848601866111fd565b6000898152606660209081526040808320546001600160a01b031680845260699092529091205493965091945092509060ff1661098c5760405162461bcd60e51b81526004016103349061145a565b6001600160a01b03811660009081526068602052604090205460ff1615610afa576000848152606a60205260409020546001600160a01b031680610a2f576040516340c10f1960e01b81526001600160a01b038316906340c10f19906109f890869088906004016112cf565b600060405180830381600087803b158015610a1257600080fd5b505af1158015610a26573d6000803e3d6000fd5b50505050610af4565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610a5d90849088906004016112cf565b600060405180830381600087803b158015610a7757600080fd5b505af1158015610a8b573d6000803e3d6000fd5b5050604051633118000d60e11b81526001600160a01b0384169250636230001a9150610ac190859087908a908a906004016112a6565b600060405180830381600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b505050505b50610715565b6000878152606b6020526040902054610715908390610b1a908690610e73565b6001600160a01b0384169190610d85565b610b33610bec565b6001600160a01b0316610b446104c0565b6001600160a01b031614610b6a5760405162461bcd60e51b815260040161033490611425565b6001600160a01b038116610b905760405162461bcd60e51b8152600401610334906112fc565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60006060856001600160a01b03166323b872dd868686604051602401610c1893929190611282565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051610c519190611235565b6000604051808303816000865af19150503d8060008114610c8e576040519150601f19603f3d011682016040523d82523d6000602084013e610c93565b606091505b5091509150818015610cbd575080511580610cbd575080806020019051810190610cbd91906110a6565b610cd95760405162461bcd60e51b8152600401610334906114a2565b505050505050565b6000610cec30610e9b565b15905090565b600054610100900460ff1680610d0b5750610d0b610ce1565b80610d19575060005460ff16155b610d355760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610d60576000805460ff1961ff0019909116610100171660011790555b610d68610ea1565b610d70610f22565b8015610d82576000805461ff00191690555b50565b60006060846001600160a01b031663a9059cbb8585604051602401610dab9291906112cf565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051610de49190611235565b6000604051808303816000865af19150503d8060008114610e21576040519150601f19603f3d011682016040523d82523d6000602084013e610e26565b606091505b5091509150818015610e50575080511580610e50575080806020019051810190610e5091906110a6565b610e6c5760405162461bcd60e51b8152600401610334906113fe565b5050505050565b600082821115610e955760405162461bcd60e51b815260040161033490611342565b50900390565b3b151590565b600054610100900460ff1680610eba5750610eba610ce1565b80610ec8575060005460ff16155b610ee45760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610d70576000805460ff1961ff0019909116610100171660011790558015610d82576000805461ff001916905550565b600054610100900460ff1680610f3b5750610f3b610ce1565b80610f49575060005460ff16155b610f655760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610f90576000805460ff1961ff0019909116610100171660011790555b6000610f9a610bec565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610d82576000805461ff001916905550565b60008083601f84011261100d578182fd5b50813567ffffffffffffffff811115611024578182fd5b60208301915083602082850101111561103c57600080fd5b9250929050565b600060208284031215611054578081fd5b813561105f816115a8565b9392505050565b60008060006060848603121561107a578182fd5b8335611085816115a8565b92506020840135611095816115a8565b929592945050506040919091013590565b6000602082840312156110b7578081fd5b8151801515811461105f578182fd5b6000602082840312156110d7578081fd5b5035919050565b600080604083850312156110f0578182fd5b823591506020830135611102816115a8565b809150509250929050565b60008060008060608587031215611122578081fd5b843593506020850135611134816115a8565b9250604085013567ffffffffffffffff81111561114f578182fd5b61115b87828801610ffc565b95989497509550505050565b60008060006040848603121561117b578283fd5b83359250602084013567ffffffffffffffff811115611198578283fd5b6111a486828701610ffc565b9497909650939450505050565b600080604083850312156111c3578182fd5b50508035926020909101359150565b6000806000606084860312156111e6578283fd5b505081359360208301359350604090920135919050565b600080600060608486031215611211578283fd5b8335925060208401359150604084013561122a816115a8565b809150509250925092565b60008251815b81811015611255576020818601810151858301520161123b565b818111156112635782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526018908201527f6c657373207468616e206d696e696d756d20616d6f756e740000000000000000604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252600d908201526c10b9b0b332aa3930b739b332b960991b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526028908201527f70726f766964656420746f6b656e41646472657373206973206e6f74207768696040820152671d195b1a5cdd195960c21b606082015260800190565b60208082526011908201527021736166655472616e7366657246726f6d60781b604082015260600190565b60208082526018908201527f6c657373207468616e207769746864726177616c206665650000000000000000604082015260600190565b60208082526031908201527f5142726964676548616e646c65723a2063616c6c6572206973206e6f742074686040820152701948189c9a5919d94818dbdb9d1c9858dd607a1b606082015260800190565b60208082526033908201527f5142726964676548616e646c65723a20636f6e74726163742061646472657373604082015272081a5cc81b9bdd081dda1a5d195b1a5cdd1959606a1b606082015260800190565b6001600160a01b0381168114610d8257600080fdfea26469706673582212200196419e1b680a36c7aafd0426c50f80b4b276740b9c14daa0bd4c9d8ec2cb3364736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063aa52df9f116100c3578063ca0d9fc41161007c578063ca0d9fc4146102b9578063d9caed12146102c1578063e0a45ff3146102d4578063e1de99d3146102dc578063e248cff2146102e4578063f2fde38b146102f757610158565b8063aa52df9f14610252578063b07e54bb14610265578063b1a83e4214610278578063b54ce96f14610280578063b8fa373614610293578063c4d66de8146102a657610158565b80635be612c7116101155780635be612c7146101f6578063715018a6146102095780637885413f146102115780638da5cb5b1461022457806393dc415d1461022c578063a31bee721461023f57610158565b806307b7ed991461015d578063318c136e1461017257806335d0d5dc1461019057806345198585146101a35780634c999f5e146101c3578063560a0b8e146101e3575b600080fd5b61017061016b366004611043565b61030a565b005b61017a610399565b604051610187919061126e565b60405180910390f35b61017a61019e3660046110c6565b6103a8565b6101b66101b13660046110c6565b6103c3565b60405161018791906112f3565b6101d66101d1366004611043565b6103d5565b60405161018791906112e8565b6101d66101f1366004611043565b6103ea565b61017a6102043660046110c6565b6103ff565b61017061041a565b6101b661021f3660046111b1565b6104a3565b61017a6104c0565b6101b661023a366004611043565b6104cf565b61017061024d3660046111b1565b6104e1565b6101706102603660046111d2565b610532565b61017061027336600461110d565b61058d565b6101b661071e565b61017061028e3660046110de565b610723565b6101706102a13660046110de565b610790565b6101706102b4366004611043565b61080a565b6101b66108b1565b6101706102cf366004611066565b6108b6565b6101b66108f9565b6101b66108fe565b6101706102f2366004611167565b610903565b610170610305366004611043565b610b2b565b6065546001600160a01b0316331461033d5760405162461bcd60e51b815260040161033490611504565b60405180910390fd5b6001600160a01b03811660009081526069602052604090205460ff166103755760405162461bcd60e51b815260040161033490611555565b6001600160a01b03166000908152606860205260409020805460ff19166001179055565b6065546001600160a01b031681565b6066602052600090815260409020546001600160a01b031681565b606b6020526000908152604090205481565b60696020526000908152604090205460ff1681565b60686020526000908152604090205460ff1681565b606a602052600090815260409020546001600160a01b031681565b610422610bec565b6001600160a01b03166104336104c0565b6001600160a01b0316146104595760405162461bcd60e51b815260040161033490611425565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b606c60209081526000928352604080842090915290825290205481565b6033546001600160a01b031690565b60676020526000908152604090205481565b6104e9610bec565b6001600160a01b03166104fa6104c0565b6001600160a01b0316146105205760405162461bcd60e51b815260040161033490611425565b6000918252606b602052604090912055565b61053a610bec565b6001600160a01b031661054b6104c0565b6001600160a01b0316146105715760405162461bcd60e51b815260040161033490611425565b6000928352606c60209081526040808520938552929052912055565b6065546001600160a01b031633146105b75760405162461bcd60e51b815260040161033490611504565b6000806105c6838501856111b1565b6000888152606660209081526040808320546001600160a01b03168084526069909252909120549294509092509060ff166106135760405162461bcd60e51b81526004016103349061145a565b6001600160a01b03811660009081526068602052604090205460ff16156106c7576000878152606b60205260409020548210156106625760405162461bcd60e51b8152600401610334906114cd565b60405163079cc67960e41b81526001600160a01b038216906379cc67909061069090899086906004016112cf565b600060405180830381600087803b1580156106aa57600080fd5b505af11580156106be573d6000803e3d6000fd5b50505050610715565b6000878152606c602090815260408083208684529091529020548210156107005760405162461bcd60e51b815260040161033490611379565b6107156001600160a01b038216873085610bf0565b50505050505050565b606481565b61072b610bec565b6001600160a01b031661073c6104c0565b6001600160a01b0316146107625760405162461bcd60e51b815260040161033490611425565b6000918252606a602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6065546001600160a01b031633146107ba5760405162461bcd60e51b815260040161033490611504565b600082815260666020908152604080832080546001600160a01b039095166001600160a01b031990951685179055928252606781528282209390935560699092529020805460ff19166001179055565b600054610100900460ff16806108235750610823610ce1565b80610831575060005460ff16155b61084d5760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610878576000805460ff1961ff0019909116610100171660011790555b610880610cf2565b606580546001600160a01b0319166001600160a01b03841617905580156108ad576000805461ff00191690555b5050565b60d781565b6065546001600160a01b031633146108e05760405162461bcd60e51b815260040161033490611504565b6108f46001600160a01b0384168383610d85565b505050565b606981565b606e81565b6065546001600160a01b0316331461092d5760405162461bcd60e51b815260040161033490611504565b6000808061093d848601866111fd565b6000898152606660209081526040808320546001600160a01b031680845260699092529091205493965091945092509060ff1661098c5760405162461bcd60e51b81526004016103349061145a565b6001600160a01b03811660009081526068602052604090205460ff1615610afa576000848152606a60205260409020546001600160a01b031680610a2f576040516340c10f1960e01b81526001600160a01b038316906340c10f19906109f890869088906004016112cf565b600060405180830381600087803b158015610a1257600080fd5b505af1158015610a26573d6000803e3d6000fd5b50505050610af4565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610a5d90849088906004016112cf565b600060405180830381600087803b158015610a7757600080fd5b505af1158015610a8b573d6000803e3d6000fd5b5050604051633118000d60e11b81526001600160a01b0384169250636230001a9150610ac190859087908a908a906004016112a6565b600060405180830381600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b505050505b50610715565b6000878152606b6020526040902054610715908390610b1a908690610e73565b6001600160a01b0384169190610d85565b610b33610bec565b6001600160a01b0316610b446104c0565b6001600160a01b031614610b6a5760405162461bcd60e51b815260040161033490611425565b6001600160a01b038116610b905760405162461bcd60e51b8152600401610334906112fc565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60006060856001600160a01b03166323b872dd868686604051602401610c1893929190611282565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051610c519190611235565b6000604051808303816000865af19150503d8060008114610c8e576040519150601f19603f3d011682016040523d82523d6000602084013e610c93565b606091505b5091509150818015610cbd575080511580610cbd575080806020019051810190610cbd91906110a6565b610cd95760405162461bcd60e51b8152600401610334906114a2565b505050505050565b6000610cec30610e9b565b15905090565b600054610100900460ff1680610d0b5750610d0b610ce1565b80610d19575060005460ff16155b610d355760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610d60576000805460ff1961ff0019909116610100171660011790555b610d68610ea1565b610d70610f22565b8015610d82576000805461ff00191690555b50565b60006060846001600160a01b031663a9059cbb8585604051602401610dab9291906112cf565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051610de49190611235565b6000604051808303816000865af19150503d8060008114610e21576040519150601f19603f3d011682016040523d82523d6000602084013e610e26565b606091505b5091509150818015610e50575080511580610e50575080806020019051810190610e5091906110a6565b610e6c5760405162461bcd60e51b8152600401610334906113fe565b5050505050565b600082821115610e955760405162461bcd60e51b815260040161033490611342565b50900390565b3b151590565b600054610100900460ff1680610eba5750610eba610ce1565b80610ec8575060005460ff16155b610ee45760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610d70576000805460ff1961ff0019909116610100171660011790558015610d82576000805461ff001916905550565b600054610100900460ff1680610f3b5750610f3b610ce1565b80610f49575060005460ff16155b610f655760405162461bcd60e51b8152600401610334906113b0565b600054610100900460ff16158015610f90576000805460ff1961ff0019909116610100171660011790555b6000610f9a610bec565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610d82576000805461ff001916905550565b60008083601f84011261100d578182fd5b50813567ffffffffffffffff811115611024578182fd5b60208301915083602082850101111561103c57600080fd5b9250929050565b600060208284031215611054578081fd5b813561105f816115a8565b9392505050565b60008060006060848603121561107a578182fd5b8335611085816115a8565b92506020840135611095816115a8565b929592945050506040919091013590565b6000602082840312156110b7578081fd5b8151801515811461105f578182fd5b6000602082840312156110d7578081fd5b5035919050565b600080604083850312156110f0578182fd5b823591506020830135611102816115a8565b809150509250929050565b60008060008060608587031215611122578081fd5b843593506020850135611134816115a8565b9250604085013567ffffffffffffffff81111561114f578182fd5b61115b87828801610ffc565b95989497509550505050565b60008060006040848603121561117b578283fd5b83359250602084013567ffffffffffffffff811115611198578283fd5b6111a486828701610ffc565b9497909650939450505050565b600080604083850312156111c3578182fd5b50508035926020909101359150565b6000806000606084860312156111e6578283fd5b505081359360208301359350604090920135919050565b600080600060608486031215611211578283fd5b8335925060208401359150604084013561122a816115a8565b809150509250925092565b60008251815b81811015611255576020818601810151858301520161123b565b818111156112635782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526018908201527f6c657373207468616e206d696e696d756d20616d6f756e740000000000000000604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252600d908201526c10b9b0b332aa3930b739b332b960991b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526028908201527f70726f766964656420746f6b656e41646472657373206973206e6f74207768696040820152671d195b1a5cdd195960c21b606082015260800190565b60208082526011908201527021736166655472616e7366657246726f6d60781b604082015260600190565b60208082526018908201527f6c657373207468616e207769746864726177616c206665650000000000000000604082015260600190565b60208082526031908201527f5142726964676548616e646c65723a2063616c6c6572206973206e6f742074686040820152701948189c9a5919d94818dbdb9d1c9858dd607a1b606082015260800190565b60208082526033908201527f5142726964676548616e646c65723a20636f6e74726163742061646472657373604082015272081a5cc81b9bdd081dda1a5d195b1a5cdd1959606a1b606082015260800190565b6001600160a01b0381168114610d8257600080fdfea26469706673582212200196419e1b680a36c7aafd0426c50f80b4b276740b9c14daa0bd4c9d8ec2cb3364736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.