Source Code
Latest 25 from a total of 2,332 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Unstake Traits | 22612575 | 270 days ago | IN | 0 ETH | 0.00009317 | ||||
| Unstake Traits | 22612567 | 270 days ago | IN | 0 ETH | 0.00020948 | ||||
| Unstake Traits | 21941903 | 364 days ago | IN | 0 ETH | 0.00047239 | ||||
| Stake Traits | 21610926 | 410 days ago | IN | 0 ETH | 0.00012123 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Unstake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00057342 | ||||
| Unstake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00057342 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.0005588 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00058348 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00056849 | ||||
| Stake Traits | 18921464 | 787 days ago | IN | 0 ETH | 0.00052959 | ||||
| Stake Traits | 18921216 | 787 days ago | IN | 0 ETH | 0.00089561 | ||||
| Stake Traits | 17685991 | 960 days ago | IN | 0 ETH | 0.00610313 | ||||
| Unstake Traits | 16779202 | 1087 days ago | IN | 0 ETH | 0.00654344 | ||||
| Unstake Traits | 16773142 | 1088 days ago | IN | 0 ETH | 0.0022038 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FancyTraitStaking
Compiler Version
v0.8.12+commit.f00d7308
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.8.12;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./interfaces/IFancyBears.sol";
import "./interfaces/IFancyBearTraits.sol";
import "./interfaces/IFancyBearHoneyConsumption.sol";
contract FancyTraitStaking is ERC1155Holder {
using SafeMath for uint256;
using Address for address;
IFancyBears fancyBearsContract;
IFancyBearTraits fancyTraitContract;
IFancyBearHoneyConsumption fancyBearHoneyConsumptionContract;
mapping(uint256 => mapping(string => uint256))
public stakedTraitsByCategoryByFancyBear;
event TraitStaked(
uint256 indexed _fancyBear,
uint256 _traitId,
string category,
address _address
);
event TraitUnstaked(
uint256 indexed _fancyBear,
uint256 _traitId,
string category,
address _address
);
event TraitSwapped(
uint256 indexed _fancyBear,
string category,
uint256 _oldTrait,
uint256 _newTriat
);
constructor(
IFancyBears _fancyBearsContract,
IFancyBearTraits _fancyTraitContract,
IFancyBearHoneyConsumption _fancyBearHoneyConsumptionContract
) {
fancyBearsContract = _fancyBearsContract;
fancyTraitContract = _fancyTraitContract;
fancyBearHoneyConsumptionContract = _fancyBearHoneyConsumptionContract;
}
function stakeTraits(uint256 _fancyBear, uint256[] calldata _traitIds) public {
require(
fancyBearsContract.ownerOf(_fancyBear) == msg.sender,
"stakeTraits: caller does not own fancy bear"
);
string memory category;
uint256 honeyConsumptionRequirement;
for (uint256 i = 0; i < _traitIds.length; i++) {
require(
fancyTraitContract.balanceOf(msg.sender, _traitIds[i]) > 0,
"stakeTraits: caller does not own trait"
);
(, category, honeyConsumptionRequirement) = fancyTraitContract.getTrait(_traitIds[i]);
require(
fancyBearHoneyConsumptionContract.honeyConsumed(_fancyBear) >=
honeyConsumptionRequirement,
"stakeTraits: fancy bear has not consumed enough honey"
);
uint256 currentTrait = stakedTraitsByCategoryByFancyBear[_fancyBear][category];
if (currentTrait != 0) {
fancyTraitContract.safeTransferFrom(
address(this),
msg.sender,
stakedTraitsByCategoryByFancyBear[_fancyBear][category],
1,
""
);
delete (
stakedTraitsByCategoryByFancyBear[_fancyBear][category]
);
}
fancyTraitContract.safeTransferFrom(
msg.sender,
address(this),
_traitIds[i],
1,
""
);
stakedTraitsByCategoryByFancyBear[_fancyBear][category] = _traitIds[i];
if (currentTrait == 0) {
emit TraitStaked(_fancyBear, _traitIds[i], category, msg.sender);
}
else {
emit TraitSwapped(
_fancyBear,
category,
currentTrait,
_traitIds[i]
);
}
}
}
function unstakeTraits(
uint256 _fancyBear,
string[] calldata _categoriesToUnstake
) public {
require(
fancyBearsContract.ownerOf(_fancyBear) == msg.sender,
"unstakeTraits: caller does not own fancy bear"
);
uint256 trait;
for (uint256 i = 0; i < _categoriesToUnstake.length; i++) {
require(
fancyTraitContract.categoryValidation(_categoriesToUnstake[i]),
"unstakeTraits: invalid trait category"
);
trait = stakedTraitsByCategoryByFancyBear[_fancyBear][_categoriesToUnstake[i]];
require(trait != 0, "unstakeTraits: no trait staked in category");
fancyTraitContract.safeTransferFrom(
address(this),
msg.sender,
trait,
1,
""
);
delete (stakedTraitsByCategoryByFancyBear[_fancyBear][_categoriesToUnstake[i]]);
emit TraitUnstaked(
_fancyBear,
trait,
_categoriesToUnstake[i],
msg.sender
);
}
}
function getStakedTraits(uint256 _fancyBear)
public
view
returns (uint256[] memory, string[] memory)
{
uint256[] memory traitArray = new uint256[](fancyTraitContract.categoryPointer());
string[] memory categories = new string[](fancyTraitContract.categoryPointer());
for (uint256 i = 0; i < traitArray.length; i++) {
categories[i] = fancyTraitContract.categories(i);
traitArray[i] = stakedTraitsByCategoryByFancyBear[_fancyBear][categories[i]];
}
return (traitArray, categories);
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155Receiver)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
interface IFancyBears is IERC721, IERC721Enumerable {
function tokensInWallet(address _owner) external view returns(uint256[] memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
abstract contract IFancyBearTraits is IERC1155 {
mapping(string => bool) public categoryValidation;
uint256 public categoryPointer;
string[] public categories;
function getTrait(uint256 _tokenId) public virtual returns (string memory, string memory, uint256);
function getCategories() public virtual returns (string[] memory);
function mint(address _account, uint256 _id, uint256 _amount, bytes memory _data) public virtual;
function mintBatch(address _account, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) public virtual;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
abstract contract IFancyBearHoneyConsumption {
mapping(uint256 => uint256) public honeyConsumed;
function consumeHoney(uint256 _tokenId, uint256 _honeyAmount) public virtual;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
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) {
unchecked {
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) {
unchecked {
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) {
unchecked {
// 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) {
unchecked {
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) {
unchecked {
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) {
return a + b;
}
/**
* @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) {
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) {
return a * b;
}
/**
* @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.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
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) {
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) {
unchecked {
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.
*
* 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) {
unchecked {
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) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// 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 IERC165 {
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.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 ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";
/**
* @dev _Available since v3.1._
*/
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
pragma solidity ^0.8.0;
import "./ERC1155Receiver.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 ERC1155Holder is ERC1155Receiver {
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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}{
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "london",
"libraries": {},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IFancyBears","name":"_fancyBearsContract","type":"address"},{"internalType":"contract IFancyBearTraits","name":"_fancyTraitContract","type":"address"},{"internalType":"contract IFancyBearHoneyConsumption","name":"_fancyBearHoneyConsumptionContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_fancyBear","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_traitId","type":"uint256"},{"indexed":false,"internalType":"string","name":"category","type":"string"},{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"TraitStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_fancyBear","type":"uint256"},{"indexed":false,"internalType":"string","name":"category","type":"string"},{"indexed":false,"internalType":"uint256","name":"_oldTrait","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newTriat","type":"uint256"}],"name":"TraitSwapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_fancyBear","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_traitId","type":"uint256"},{"indexed":false,"internalType":"string","name":"category","type":"string"},{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"TraitUnstaked","type":"event"},{"inputs":[{"internalType":"uint256","name":"_fancyBear","type":"uint256"}],"name":"getStakedTraits","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"string[]","name":"","type":"string[]"}],"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":[{"internalType":"uint256","name":"_fancyBear","type":"uint256"},{"internalType":"uint256[]","name":"_traitIds","type":"uint256[]"}],"name":"stakeTraits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"string","name":"","type":"string"}],"name":"stakedTraitsByCategoryByFancyBear","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fancyBear","type":"uint256"},{"internalType":"string[]","name":"_categoriesToUnstake","type":"string[]"}],"name":"unstakeTraits","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50604051620016e5380380620016e5833981016040819052620000349162000090565b600080546001600160a01b039485166001600160a01b031991821617909155600180549385169382169390931790925560028054919093169116179055620000e4565b6001600160a01b03811681146200008d57600080fd5b50565b600080600060608486031215620000a657600080fd5b8351620000b38162000077565b6020850151909350620000c68162000077565b6040850151909250620000d98162000077565b809150509250925092565b6115f180620000f46000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638c504b441161005b5780638c504b4414610109578063bc197c811461012a578063f10b1bf714610162578063f23a6e611461017557600080fd5b806301ffc9a7146100825780634bbcc428146100aa5780635c3e2eb2146100bf575b600080fd5b610095610090366004610e22565b610194565b60405190151581526020015b60405180910390f35b6100bd6100b8366004610e9e565b6101a5565b005b6100fb6100cd366004610f94565b6003602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b6040519081526020016100a1565b61011c610117366004610fee565b610564565b6040516100a1929190611063565b6101496101383660046111b2565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016100a1565b6100bd610170366004610e9e565b610806565b61014961018336600461125f565b63f23a6e6160e01b95945050505050565b600061019f82610ded565b92915050565b6000546040516331a9108f60e11b81526004810185905233916001600160a01b031690636352211e90602401602060405180830381865afa1580156101ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021291906112c7565b6001600160a01b0316146102835760405162461bcd60e51b815260206004820152602d60248201527f756e7374616b655472616974733a2063616c6c657220646f6573206e6f74206f60448201526c3bb7103330b731bc903132b0b960991b60648201526084015b60405180910390fd5b6000805b8281101561055d576001546001600160a01b0316635fe870058585848181106102b2576102b26112e4565b90506020028101906102c491906112fa565b6040518363ffffffff1660e01b81526004016102e1929190611369565b602060405180830381865afa1580156102fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103229190611385565b61037c5760405162461bcd60e51b815260206004820152602560248201527f756e7374616b655472616974733a20696e76616c69642074726169742063617460448201526465676f727960d81b606482015260840161027a565b600085815260036020526040902084848381811061039c5761039c6112e4565b90506020028101906103ae91906112fa565b6040516103bc9291906113a7565b908152602001604051809103902054915081600014156104315760405162461bcd60e51b815260206004820152602a60248201527f756e7374616b655472616974733a206e6f207472616974207374616b656420696044820152696e2063617465676f727960b01b606482015260840161027a565b60018054604051637921219560e11b81526001600160a01b039091169163f242432a91610466913091339188916004016113b7565b600060405180830381600087803b15801561048057600080fd5b505af1158015610494573d6000803e3d6000fd5b505050600086815260036020526040902090508484838181106104b9576104b96112e4565b90506020028101906104cb91906112fa565b6040516104d99291906113a7565b908152602001604051809103902060009055847ffe9b089357503fa272bddfaf6c1e531a67ecb6cf95118a1a460a4ae25d64686383868685818110610520576105206112e4565b905060200281019061053291906112fa565b3360405161054394939291906113ef565b60405180910390a28061055581611422565b915050610287565b5050505050565b6060806000600160009054906101000a90046001600160a01b03166001600160a01b031663236390366040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e0919061144b565b6001600160401b038111156105f7576105f7610ee9565b604051908082528060200260200182016040528015610620578160200160208202803683370190505b5090506000600160009054906101000a90046001600160a01b03166001600160a01b031663236390366040518163ffffffff1660e01b8152600401602060405180830381865afa158015610678573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069c919061144b565b6001600160401b038111156106b3576106b3610ee9565b6040519080825280602002602001820160405280156106e657816020015b60608152602001906001900390816106d15790505b50905060005b82518110156107fb57600154604051636366df2f60e11b8152600481018390526001600160a01b039091169063c6cdbe5e90602401600060405180830381865afa15801561073e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261076691908101906114a9565b828281518110610778576107786112e4565b6020026020010181905250600360008781526020019081526020016000208282815181106107a8576107a86112e4565b60200260200101516040516107bd91906114dd565b9081526020016040518091039020548382815181106107de576107de6112e4565b6020908102919091010152806107f381611422565b9150506106ec565b509094909350915050565b6000546040516331a9108f60e11b81526004810185905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561084f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087391906112c7565b6001600160a01b0316146108dd5760405162461bcd60e51b815260206004820152602b60248201527f7374616b655472616974733a2063616c6c657220646f6573206e6f74206f776e60448201526a103330b731bc903132b0b960a91b606482015260840161027a565b60606000805b83811015610de5576001546000906001600160a01b031662fdd58e33888886818110610911576109116112e4565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401602060405180830381865afa158015610963573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610987919061144b565b116109e35760405162461bcd60e51b815260206004820152602660248201527f7374616b655472616974733a2063616c6c657220646f6573206e6f74206f776e604482015265081d1c985a5d60d21b606482015260840161027a565b6001546001600160a01b031663acb586df868684818110610a0657610a066112e4565b905060200201356040518263ffffffff1660e01b8152600401610a2b91815260200190565b6000604051808303816000875af1158015610a4a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a7291908101906114f9565b6002546040516302abc55b60e41b8152600481018b90529296509094508492506001600160a01b031690632abc55b090602401602060405180830381865afa158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae6919061144b565b1015610b525760405162461bcd60e51b815260206004820152603560248201527f7374616b655472616974733a2066616e6379206265617220686173206e6f7420604482015274636f6e73756d656420656e6f75676820686f6e657960581b606482015260840161027a565b6000868152600360205260408082209051610b6e9086906114dd565b908152602001604051809103902054905080600014610c56576001546000888152600360205260409081902090516001600160a01b039092169163f242432a913091339190610bbe908a906114dd565b908152604051908190036020018120546001600160e01b031960e086901b168252610bf09392916001906004016113b7565b600060405180830381600087803b158015610c0a57600080fd5b505af1158015610c1e573d6000803e3d6000fd5b505050506003600088815260200190815260200160002084604051610c4391906114dd565b9081526020016040518091039020600090555b6001546001600160a01b031663f242432a3330898987818110610c7b57610c7b6112e4565b9050602002013560016040518563ffffffff1660e01b8152600401610ca394939291906113b7565b600060405180830381600087803b158015610cbd57600080fd5b505af1158015610cd1573d6000803e3d6000fd5b50505050858583818110610ce757610ce76112e4565b905060200201356003600089815260200190815260200160002085604051610d0f91906114dd565b9081526040519081900360200190205580610d7d57867fe3b73d3d54c16448aedfcef2d4514ad4b8fc1663dfdc3b816f4650f8a16695c6878785818110610d5857610d586112e4565b905060200201358633604051610d7093929190611565565b60405180910390a2610dd2565b867fb500fd16980bc4123ff5ea703587fbb0f2027ed4cda79e8a0565a818c370921c8583898987818110610db357610db36112e4565b90506020020135604051610dc993929190611596565b60405180910390a25b5080610ddd81611422565b9150506108e3565b505050505050565b60006001600160e01b03198216630271189760e51b148061019f57506301ffc9a760e01b6001600160e01b031983161461019f565b600060208284031215610e3457600080fd5b81356001600160e01b031981168114610e4c57600080fd5b9392505050565b60008083601f840112610e6557600080fd5b5081356001600160401b03811115610e7c57600080fd5b6020830191508360208260051b8501011115610e9757600080fd5b9250929050565b600080600060408486031215610eb357600080fd5b8335925060208401356001600160401b03811115610ed057600080fd5b610edc86828701610e53565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610f2757610f27610ee9565b604052919050565b60006001600160401b03821115610f4857610f48610ee9565b50601f01601f191660200190565b6000610f69610f6484610f2f565b610eff565b9050828152838383011115610f7d57600080fd5b828260208301376000602084830101529392505050565b60008060408385031215610fa757600080fd5b8235915060208301356001600160401b03811115610fc457600080fd5b8301601f81018513610fd557600080fd5b610fe485823560208401610f56565b9150509250929050565b60006020828403121561100057600080fd5b5035919050565b60005b8381101561102257818101518382015260200161100a565b83811115611031576000848401525b50505050565b6000815180845261104f816020860160208601611007565b601f01601f19169290920160200192915050565b604080825283519082018190526000906020906060840190828701845b8281101561109c57815184529284019290840190600101611080565b50505083810382850152845180825282820190600581901b8301840187850160005b838110156110ec57601f198684030185526110da838351611037565b948701949250908601906001016110be565b50909998505050505050505050565b6001600160a01b038116811461111057600080fd5b50565b600082601f83011261112457600080fd5b813560206001600160401b0382111561113f5761113f610ee9565b8160051b61114e828201610eff565b928352848101820192828101908785111561116857600080fd5b83870192505b848310156111875782358252918301919083019061116e565b979650505050505050565b600082601f8301126111a357600080fd5b610e4c83833560208501610f56565b600080600080600060a086880312156111ca57600080fd5b85356111d5816110fb565b945060208601356111e5816110fb565b935060408601356001600160401b038082111561120157600080fd5b61120d89838a01611113565b9450606088013591508082111561122357600080fd5b61122f89838a01611113565b9350608088013591508082111561124557600080fd5b5061125288828901611192565b9150509295509295909350565b600080600080600060a0868803121561127757600080fd5b8535611282816110fb565b94506020860135611292816110fb565b9350604086013592506060860135915060808601356001600160401b038111156112bb57600080fd5b61125288828901611192565b6000602082840312156112d957600080fd5b8151610e4c816110fb565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261131157600080fd5b8301803591506001600160401b0382111561132b57600080fd5b602001915036819003821315610e9757600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061137d602083018486611340565b949350505050565b60006020828403121561139757600080fd5b81518015158114610e4c57600080fd5b8183823760009101908152919050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b848152606060208201526000611409606083018587611340565b905060018060a01b038316604083015295945050505050565b600060001982141561144457634e487b7160e01b600052601160045260246000fd5b5060010190565b60006020828403121561145d57600080fd5b5051919050565b600082601f83011261147557600080fd5b8151611483610f6482610f2f565b81815284602083860101111561149857600080fd5b61137d826020830160208701611007565b6000602082840312156114bb57600080fd5b81516001600160401b038111156114d157600080fd5b61137d84828501611464565b600082516114ef818460208701611007565b9190910192915050565b60008060006060848603121561150e57600080fd5b83516001600160401b038082111561152557600080fd5b61153187838801611464565b9450602086015191508082111561154757600080fd5b5061155486828701611464565b925050604084015190509250925092565b83815260606020820152600061157e6060830185611037565b905060018060a01b0383166040830152949350505050565b6060815260006115a96060830186611037565b6020830194909452506040015291905056fea26469706673582212208f9f25a936deaa4c638292ada41729d68fc686cd5debbacafbb87edcc66ffa8064736f6c634300080c003300000000000000000000000087084ec881d5a15c918057f326790db177d218f2000000000000000000000000ce15f018b083844a0b650b8000a00f227fb8cfbe000000000000000000000000628bec3f759d9a6d49829288a0e546282d284b7e
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638c504b441161005b5780638c504b4414610109578063bc197c811461012a578063f10b1bf714610162578063f23a6e611461017557600080fd5b806301ffc9a7146100825780634bbcc428146100aa5780635c3e2eb2146100bf575b600080fd5b610095610090366004610e22565b610194565b60405190151581526020015b60405180910390f35b6100bd6100b8366004610e9e565b6101a5565b005b6100fb6100cd366004610f94565b6003602090815260009283526040909220815180830184018051928152908401929093019190912091525481565b6040519081526020016100a1565b61011c610117366004610fee565b610564565b6040516100a1929190611063565b6101496101383660046111b2565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016100a1565b6100bd610170366004610e9e565b610806565b61014961018336600461125f565b63f23a6e6160e01b95945050505050565b600061019f82610ded565b92915050565b6000546040516331a9108f60e11b81526004810185905233916001600160a01b031690636352211e90602401602060405180830381865afa1580156101ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021291906112c7565b6001600160a01b0316146102835760405162461bcd60e51b815260206004820152602d60248201527f756e7374616b655472616974733a2063616c6c657220646f6573206e6f74206f60448201526c3bb7103330b731bc903132b0b960991b60648201526084015b60405180910390fd5b6000805b8281101561055d576001546001600160a01b0316635fe870058585848181106102b2576102b26112e4565b90506020028101906102c491906112fa565b6040518363ffffffff1660e01b81526004016102e1929190611369565b602060405180830381865afa1580156102fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103229190611385565b61037c5760405162461bcd60e51b815260206004820152602560248201527f756e7374616b655472616974733a20696e76616c69642074726169742063617460448201526465676f727960d81b606482015260840161027a565b600085815260036020526040902084848381811061039c5761039c6112e4565b90506020028101906103ae91906112fa565b6040516103bc9291906113a7565b908152602001604051809103902054915081600014156104315760405162461bcd60e51b815260206004820152602a60248201527f756e7374616b655472616974733a206e6f207472616974207374616b656420696044820152696e2063617465676f727960b01b606482015260840161027a565b60018054604051637921219560e11b81526001600160a01b039091169163f242432a91610466913091339188916004016113b7565b600060405180830381600087803b15801561048057600080fd5b505af1158015610494573d6000803e3d6000fd5b505050600086815260036020526040902090508484838181106104b9576104b96112e4565b90506020028101906104cb91906112fa565b6040516104d99291906113a7565b908152602001604051809103902060009055847ffe9b089357503fa272bddfaf6c1e531a67ecb6cf95118a1a460a4ae25d64686383868685818110610520576105206112e4565b905060200281019061053291906112fa565b3360405161054394939291906113ef565b60405180910390a28061055581611422565b915050610287565b5050505050565b6060806000600160009054906101000a90046001600160a01b03166001600160a01b031663236390366040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e0919061144b565b6001600160401b038111156105f7576105f7610ee9565b604051908082528060200260200182016040528015610620578160200160208202803683370190505b5090506000600160009054906101000a90046001600160a01b03166001600160a01b031663236390366040518163ffffffff1660e01b8152600401602060405180830381865afa158015610678573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069c919061144b565b6001600160401b038111156106b3576106b3610ee9565b6040519080825280602002602001820160405280156106e657816020015b60608152602001906001900390816106d15790505b50905060005b82518110156107fb57600154604051636366df2f60e11b8152600481018390526001600160a01b039091169063c6cdbe5e90602401600060405180830381865afa15801561073e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261076691908101906114a9565b828281518110610778576107786112e4565b6020026020010181905250600360008781526020019081526020016000208282815181106107a8576107a86112e4565b60200260200101516040516107bd91906114dd565b9081526020016040518091039020548382815181106107de576107de6112e4565b6020908102919091010152806107f381611422565b9150506106ec565b509094909350915050565b6000546040516331a9108f60e11b81526004810185905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561084f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087391906112c7565b6001600160a01b0316146108dd5760405162461bcd60e51b815260206004820152602b60248201527f7374616b655472616974733a2063616c6c657220646f6573206e6f74206f776e60448201526a103330b731bc903132b0b960a91b606482015260840161027a565b60606000805b83811015610de5576001546000906001600160a01b031662fdd58e33888886818110610911576109116112e4565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401602060405180830381865afa158015610963573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610987919061144b565b116109e35760405162461bcd60e51b815260206004820152602660248201527f7374616b655472616974733a2063616c6c657220646f6573206e6f74206f776e604482015265081d1c985a5d60d21b606482015260840161027a565b6001546001600160a01b031663acb586df868684818110610a0657610a066112e4565b905060200201356040518263ffffffff1660e01b8152600401610a2b91815260200190565b6000604051808303816000875af1158015610a4a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a7291908101906114f9565b6002546040516302abc55b60e41b8152600481018b90529296509094508492506001600160a01b031690632abc55b090602401602060405180830381865afa158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae6919061144b565b1015610b525760405162461bcd60e51b815260206004820152603560248201527f7374616b655472616974733a2066616e6379206265617220686173206e6f7420604482015274636f6e73756d656420656e6f75676820686f6e657960581b606482015260840161027a565b6000868152600360205260408082209051610b6e9086906114dd565b908152602001604051809103902054905080600014610c56576001546000888152600360205260409081902090516001600160a01b039092169163f242432a913091339190610bbe908a906114dd565b908152604051908190036020018120546001600160e01b031960e086901b168252610bf09392916001906004016113b7565b600060405180830381600087803b158015610c0a57600080fd5b505af1158015610c1e573d6000803e3d6000fd5b505050506003600088815260200190815260200160002084604051610c4391906114dd565b9081526020016040518091039020600090555b6001546001600160a01b031663f242432a3330898987818110610c7b57610c7b6112e4565b9050602002013560016040518563ffffffff1660e01b8152600401610ca394939291906113b7565b600060405180830381600087803b158015610cbd57600080fd5b505af1158015610cd1573d6000803e3d6000fd5b50505050858583818110610ce757610ce76112e4565b905060200201356003600089815260200190815260200160002085604051610d0f91906114dd565b9081526040519081900360200190205580610d7d57867fe3b73d3d54c16448aedfcef2d4514ad4b8fc1663dfdc3b816f4650f8a16695c6878785818110610d5857610d586112e4565b905060200201358633604051610d7093929190611565565b60405180910390a2610dd2565b867fb500fd16980bc4123ff5ea703587fbb0f2027ed4cda79e8a0565a818c370921c8583898987818110610db357610db36112e4565b90506020020135604051610dc993929190611596565b60405180910390a25b5080610ddd81611422565b9150506108e3565b505050505050565b60006001600160e01b03198216630271189760e51b148061019f57506301ffc9a760e01b6001600160e01b031983161461019f565b600060208284031215610e3457600080fd5b81356001600160e01b031981168114610e4c57600080fd5b9392505050565b60008083601f840112610e6557600080fd5b5081356001600160401b03811115610e7c57600080fd5b6020830191508360208260051b8501011115610e9757600080fd5b9250929050565b600080600060408486031215610eb357600080fd5b8335925060208401356001600160401b03811115610ed057600080fd5b610edc86828701610e53565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610f2757610f27610ee9565b604052919050565b60006001600160401b03821115610f4857610f48610ee9565b50601f01601f191660200190565b6000610f69610f6484610f2f565b610eff565b9050828152838383011115610f7d57600080fd5b828260208301376000602084830101529392505050565b60008060408385031215610fa757600080fd5b8235915060208301356001600160401b03811115610fc457600080fd5b8301601f81018513610fd557600080fd5b610fe485823560208401610f56565b9150509250929050565b60006020828403121561100057600080fd5b5035919050565b60005b8381101561102257818101518382015260200161100a565b83811115611031576000848401525b50505050565b6000815180845261104f816020860160208601611007565b601f01601f19169290920160200192915050565b604080825283519082018190526000906020906060840190828701845b8281101561109c57815184529284019290840190600101611080565b50505083810382850152845180825282820190600581901b8301840187850160005b838110156110ec57601f198684030185526110da838351611037565b948701949250908601906001016110be565b50909998505050505050505050565b6001600160a01b038116811461111057600080fd5b50565b600082601f83011261112457600080fd5b813560206001600160401b0382111561113f5761113f610ee9565b8160051b61114e828201610eff565b928352848101820192828101908785111561116857600080fd5b83870192505b848310156111875782358252918301919083019061116e565b979650505050505050565b600082601f8301126111a357600080fd5b610e4c83833560208501610f56565b600080600080600060a086880312156111ca57600080fd5b85356111d5816110fb565b945060208601356111e5816110fb565b935060408601356001600160401b038082111561120157600080fd5b61120d89838a01611113565b9450606088013591508082111561122357600080fd5b61122f89838a01611113565b9350608088013591508082111561124557600080fd5b5061125288828901611192565b9150509295509295909350565b600080600080600060a0868803121561127757600080fd5b8535611282816110fb565b94506020860135611292816110fb565b9350604086013592506060860135915060808601356001600160401b038111156112bb57600080fd5b61125288828901611192565b6000602082840312156112d957600080fd5b8151610e4c816110fb565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261131157600080fd5b8301803591506001600160401b0382111561132b57600080fd5b602001915036819003821315610e9757600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061137d602083018486611340565b949350505050565b60006020828403121561139757600080fd5b81518015158114610e4c57600080fd5b8183823760009101908152919050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b848152606060208201526000611409606083018587611340565b905060018060a01b038316604083015295945050505050565b600060001982141561144457634e487b7160e01b600052601160045260246000fd5b5060010190565b60006020828403121561145d57600080fd5b5051919050565b600082601f83011261147557600080fd5b8151611483610f6482610f2f565b81815284602083860101111561149857600080fd5b61137d826020830160208701611007565b6000602082840312156114bb57600080fd5b81516001600160401b038111156114d157600080fd5b61137d84828501611464565b600082516114ef818460208701611007565b9190910192915050565b60008060006060848603121561150e57600080fd5b83516001600160401b038082111561152557600080fd5b61153187838801611464565b9450602086015191508082111561154757600080fd5b5061155486828701611464565b925050604084015190509250925092565b83815260606020820152600061157e6060830185611037565b905060018060a01b0383166040830152949350505050565b6060815260006115a96060830186611037565b6020830194909452506040015291905056fea26469706673582212208f9f25a936deaa4c638292ada41729d68fc686cd5debbacafbb87edcc66ffa8064736f6c634300080c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000087084ec881d5a15c918057f326790db177d218f2000000000000000000000000ce15f018b083844a0b650b8000a00f227fb8cfbe000000000000000000000000628bec3f759d9a6d49829288a0e546282d284b7e
-----Decoded View---------------
Arg [0] : _fancyBearsContract (address): 0x87084ec881d5A15C918057F326790dB177D218F2
Arg [1] : _fancyTraitContract (address): 0xCE15f018b083844a0B650B8000A00F227fB8cfbe
Arg [2] : _fancyBearHoneyConsumptionContract (address): 0x628BEC3f759D9a6d49829288a0E546282d284b7E
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000087084ec881d5a15c918057f326790db177d218f2
Arg [1] : 000000000000000000000000ce15f018b083844a0b650b8000a00f227fb8cfbe
Arg [2] : 000000000000000000000000628bec3f759d9a6d49829288a0e546282d284b7e
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.