More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,205 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Unstake | 19693899 | 31 days ago | IN | 0 ETH | 0.00058897 | ||||
Unstake | 19145439 | 108 days ago | IN | 0 ETH | 0.00132767 | ||||
Unstake | 19131520 | 110 days ago | IN | 0 ETH | 0.00330051 | ||||
Unstake | 19131516 | 110 days ago | IN | 0 ETH | 0.04642675 | ||||
Unstake | 19130594 | 110 days ago | IN | 0 ETH | 0.00234572 | ||||
Unstake | 19125018 | 111 days ago | IN | 0 ETH | 0.00103137 | ||||
Unstake | 19124653 | 111 days ago | IN | 0 ETH | 0.00111794 | ||||
Unstake | 19122396 | 111 days ago | IN | 0 ETH | 0.00267579 | ||||
Unstake | 19117538 | 112 days ago | IN | 0 ETH | 0.00091302 | ||||
Unstake | 19117317 | 112 days ago | IN | 0 ETH | 0.00202 | ||||
Unstake | 19117310 | 112 days ago | IN | 0 ETH | 0.00110312 | ||||
Unstake | 19117175 | 112 days ago | IN | 0 ETH | 0.00222637 | ||||
Unstake | 19117172 | 112 days ago | IN | 0 ETH | 0.00087937 | ||||
Unstake | 19114548 | 112 days ago | IN | 0 ETH | 0.00160628 | ||||
Unstake | 19114414 | 112 days ago | IN | 0 ETH | 0.00117335 | ||||
Unstake | 19114118 | 112 days ago | IN | 0 ETH | 0.00082034 | ||||
Unstake | 19114011 | 112 days ago | IN | 0 ETH | 0.00097669 | ||||
Unstake | 19113985 | 112 days ago | IN | 0 ETH | 0.00093297 | ||||
Unstake | 19113981 | 112 days ago | IN | 0 ETH | 0.00207574 | ||||
Unstake | 19113867 | 112 days ago | IN | 0 ETH | 0.00153366 | ||||
Unstake | 19113714 | 112 days ago | IN | 0 ETH | 0.00594479 | ||||
Unstake | 19113707 | 112 days ago | IN | 0 ETH | 0.00534059 | ||||
Unstake | 19113602 | 112 days ago | IN | 0 ETH | 0.00232922 | ||||
Unstake | 19113574 | 112 days ago | IN | 0 ETH | 0.00213233 | ||||
Unstake | 19110192 | 113 days ago | IN | 0 ETH | 0.00269371 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Staking
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.15; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract Staking is Ownable, ReentrancyGuard { using Counters for Counters.Counter; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.UintSet; event Stake(address contractAddress, uint256 tokenId, address owner); event Unstake(address contractAddress, uint256 tokenId, address owner); constructor() {} mapping(address => mapping(address => EnumerableSet.UintSet)) private addressToStakedTokensSet; mapping(address => mapping(uint256 => address)) private contractTokenIdToOwner; mapping(address => mapping(uint256 => uint256)) private contractTokenIdToStakedTimestamp; function stake(address contractAddress, uint256[] memory tokenIds) external nonReentrant { for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; contractTokenIdToOwner[contractAddress][tokenId] = _msgSender(); IERC721(contractAddress).transferFrom(_msgSender(), address(this), tokenId); addressToStakedTokensSet[contractAddress][_msgSender()].add(tokenId); contractTokenIdToStakedTimestamp[contractAddress][tokenId] = block.timestamp; emit Stake(contractAddress, tokenId, _msgSender()); } } function unstake( address contractAddress, uint256[] memory tokenIds ) external nonReentrant { for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; require(addressToStakedTokensSet[contractAddress][_msgSender()].contains(tokenId), "Token is not staked"); delete contractTokenIdToOwner[contractAddress][tokenId]; IERC721(contractAddress).transferFrom(address(this), _msgSender(), tokenId); addressToStakedTokensSet[contractAddress][_msgSender()].remove(tokenId); delete contractTokenIdToStakedTimestamp[contractAddress][tokenId]; emit Unstake(contractAddress, tokenId, _msgSender()); } } function stakedTokensOfOwner(address contractAddress, address owner) external view returns (uint256[] memory) { EnumerableSet.UintSet storage userTokens = addressToStakedTokensSet[contractAddress][owner]; uint256[] memory tokenIds = new uint256[](userTokens.length()); for (uint256 i = 0; i < userTokens.length(); i++) { tokenIds[i] = userTokens.at(i); } return tokenIds; } function stakedTokenOwner(address contractAddress, uint256 tokenId) external view returns (address) { return contractTokenIdToOwner[contractAddress][tokenId]; } function stakedTokenTimestamp(address contractAddress, uint256 tokenId) external view returns (uint256) { return contractTokenIdToStakedTimestamp[contractAddress][tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.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 Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// 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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (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`. * * 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; /** * @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 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 the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// 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); }
{ "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
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"Unstake","type":"event"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakedTokenOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakedTokenTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"stakedTokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a33610023565b60018055610073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610c58806100826000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b14610121578063a686eb5f14610132578063c9a3911e14610176578063f2fde38b1461018957600080fd5b80635dbe47561461008d578063715018a6146100a2578063754b069f146100aa5780637dad54c8146100d3575b600080fd5b6100a061009b366004610a23565b61019c565b005b6100a0610406565b6100bd6100b8366004610af4565b61046c565b6040516100ca9190610b27565b60405180910390f35b6101096100e1366004610b6b565b6001600160a01b03918216600090815260036020908152604080832093835292905220541690565b6040516001600160a01b0390911681526020016100ca565b6000546001600160a01b0316610109565b610168610140366004610b6b565b6001600160a01b03919091166000908152600460209081526040808320938352929052205490565b6040519081526020016100ca565b6100a0610184366004610a23565b61053a565b6100a0610197366004610b95565b610721565b6002600154036101f35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260015560005b81518110156103fd57600082828151811061021857610218610bb0565b602002602001015190506102738160026000876001600160a01b03166001600160a01b0316815260200190815260200160002060006102543390565b6001600160a01b031681526020810191909152604001600020906107ec565b6102b55760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881a5cc81b9bdd081cdd185ad959606a1b60448201526064016101ea565b6001600160a01b038416600081815260036020908152604080832085845290915280822080546001600160a01b031916905580516323b872dd60e01b81523060048201523360248201526044810185905290516323b872dd9260648084019391929182900301818387803b15801561032c57600080fd5b505af1158015610340573d6000803e3d6000fd5b5050506001600160a01b0385166000908152600260205260408120610388925083916103693390565b6001600160a01b03168152602081019190915260400160002090610807565b506001600160a01b0384166000818152600460209081526040808320858452825280832092909255815192835282018390523382820152517f379bc14156b62673a2efd113a5b989c8240c2018bf1fa01ee2d3d5915f769d4b9181900360600190a150806103f581610bdc565b9150506101fb565b50506001805550565b6000546001600160a01b031633146104605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101ea565b61046a6000610813565b565b6001600160a01b038083166000908152600260209081526040808320938516835292905290812060609161049f82610863565b67ffffffffffffffff8111156104b7576104b7610a0d565b6040519080825280602002602001820160405280156104e0578160200160208202803683370190505b50905060005b6104ef83610863565b81101561052f57610500838261086d565b82828151811061051257610512610bb0565b60209081029190910101528061052781610bdc565b9150506104e6565b509150505b92915050565b60026001540361058c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101ea565b600260015560005b81518110156103fd5760008282815181106105b1576105b1610bb0565b602002602001015190506105c23390565b6001600160a01b038581166000818152600360209081526040808320878452909152902080546001600160a01b031916939092169290921790556323b872dd336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101849052606401600060405180830381600087803b15801561065057600080fd5b505af1158015610664573d6000803e3d6000fd5b5050506001600160a01b03851660009081526002602052604081206106ac9250839161068d3390565b6001600160a01b03168152602081019190915260400160002090610879565b506001600160a01b0384166000818152600460209081526040808320858452825291829020429055815192835282018390523382820152517fcc2e01638b08266366840f4a2ac8755c01e6932f730d5b707835cf4e23a152459181900360600190a1508061071981610bdc565b915050610594565b6000546001600160a01b0316331461077b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101ea565b6001600160a01b0381166107e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101ea565b6107e981610813565b50565b600081815260018301602052604081205415155b9392505050565b60006108008383610885565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610534825490565b60006108008383610978565b600061080083836109a2565b6000818152600183016020526040812054801561096e5760006108a9600183610bf5565b85549091506000906108bd90600190610bf5565b90508181146109225760008660000182815481106108dd576108dd610bb0565b906000526020600020015490508087600001848154811061090057610900610bb0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061093357610933610c0c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610534565b6000915050610534565b600082600001828154811061098f5761098f610bb0565b9060005260206000200154905092915050565b60008181526001830160205260408120546109e957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610534565b506000610534565b80356001600160a01b0381168114610a0857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610a3657600080fd5b610a3f836109f1565b915060208084013567ffffffffffffffff80821115610a5d57600080fd5b818601915086601f830112610a7157600080fd5b813581811115610a8357610a83610a0d565b8060051b604051601f19603f83011681018181108582111715610aa857610aa8610a0d565b604052918252848201925083810185019189831115610ac657600080fd5b938501935b82851015610ae457843584529385019392850192610acb565b8096505050505050509250929050565b60008060408385031215610b0757600080fd5b610b10836109f1565b9150610b1e602084016109f1565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015610b5f57835183529284019291840191600101610b43565b50909695505050505050565b60008060408385031215610b7e57600080fd5b610b87836109f1565b946020939093013593505050565b600060208284031215610ba757600080fd5b610800826109f1565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201610bee57610bee610bc6565b5060010190565b600082821015610c0757610c07610bc6565b500390565b634e487b7160e01b600052603160045260246000fdfea26469706673582212201ea919ead4191e37a6894f70ddc20a142929445f31777c3eebefe297e8199d8164736f6c634300080f0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b14610121578063a686eb5f14610132578063c9a3911e14610176578063f2fde38b1461018957600080fd5b80635dbe47561461008d578063715018a6146100a2578063754b069f146100aa5780637dad54c8146100d3575b600080fd5b6100a061009b366004610a23565b61019c565b005b6100a0610406565b6100bd6100b8366004610af4565b61046c565b6040516100ca9190610b27565b60405180910390f35b6101096100e1366004610b6b565b6001600160a01b03918216600090815260036020908152604080832093835292905220541690565b6040516001600160a01b0390911681526020016100ca565b6000546001600160a01b0316610109565b610168610140366004610b6b565b6001600160a01b03919091166000908152600460209081526040808320938352929052205490565b6040519081526020016100ca565b6100a0610184366004610a23565b61053a565b6100a0610197366004610b95565b610721565b6002600154036101f35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260015560005b81518110156103fd57600082828151811061021857610218610bb0565b602002602001015190506102738160026000876001600160a01b03166001600160a01b0316815260200190815260200160002060006102543390565b6001600160a01b031681526020810191909152604001600020906107ec565b6102b55760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881a5cc81b9bdd081cdd185ad959606a1b60448201526064016101ea565b6001600160a01b038416600081815260036020908152604080832085845290915280822080546001600160a01b031916905580516323b872dd60e01b81523060048201523360248201526044810185905290516323b872dd9260648084019391929182900301818387803b15801561032c57600080fd5b505af1158015610340573d6000803e3d6000fd5b5050506001600160a01b0385166000908152600260205260408120610388925083916103693390565b6001600160a01b03168152602081019190915260400160002090610807565b506001600160a01b0384166000818152600460209081526040808320858452825280832092909255815192835282018390523382820152517f379bc14156b62673a2efd113a5b989c8240c2018bf1fa01ee2d3d5915f769d4b9181900360600190a150806103f581610bdc565b9150506101fb565b50506001805550565b6000546001600160a01b031633146104605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101ea565b61046a6000610813565b565b6001600160a01b038083166000908152600260209081526040808320938516835292905290812060609161049f82610863565b67ffffffffffffffff8111156104b7576104b7610a0d565b6040519080825280602002602001820160405280156104e0578160200160208202803683370190505b50905060005b6104ef83610863565b81101561052f57610500838261086d565b82828151811061051257610512610bb0565b60209081029190910101528061052781610bdc565b9150506104e6565b509150505b92915050565b60026001540361058c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101ea565b600260015560005b81518110156103fd5760008282815181106105b1576105b1610bb0565b602002602001015190506105c23390565b6001600160a01b038581166000818152600360209081526040808320878452909152902080546001600160a01b031916939092169290921790556323b872dd336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101849052606401600060405180830381600087803b15801561065057600080fd5b505af1158015610664573d6000803e3d6000fd5b5050506001600160a01b03851660009081526002602052604081206106ac9250839161068d3390565b6001600160a01b03168152602081019190915260400160002090610879565b506001600160a01b0384166000818152600460209081526040808320858452825291829020429055815192835282018390523382820152517fcc2e01638b08266366840f4a2ac8755c01e6932f730d5b707835cf4e23a152459181900360600190a1508061071981610bdc565b915050610594565b6000546001600160a01b0316331461077b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101ea565b6001600160a01b0381166107e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101ea565b6107e981610813565b50565b600081815260018301602052604081205415155b9392505050565b60006108008383610885565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610534825490565b60006108008383610978565b600061080083836109a2565b6000818152600183016020526040812054801561096e5760006108a9600183610bf5565b85549091506000906108bd90600190610bf5565b90508181146109225760008660000182815481106108dd576108dd610bb0565b906000526020600020015490508087600001848154811061090057610900610bb0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061093357610933610c0c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610534565b6000915050610534565b600082600001828154811061098f5761098f610bb0565b9060005260206000200154905092915050565b60008181526001830160205260408120546109e957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610534565b506000610534565b80356001600160a01b0381168114610a0857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610a3657600080fd5b610a3f836109f1565b915060208084013567ffffffffffffffff80821115610a5d57600080fd5b818601915086601f830112610a7157600080fd5b813581811115610a8357610a83610a0d565b8060051b604051601f19603f83011681018181108582111715610aa857610aa8610a0d565b604052918252848201925083810185019189831115610ac657600080fd5b938501935b82851015610ae457843584529385019392850192610acb565b8096505050505050509250929050565b60008060408385031215610b0757600080fd5b610b10836109f1565b9150610b1e602084016109f1565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015610b5f57835183529284019291840191600101610b43565b50909695505050505050565b60008060408385031215610b7e57600080fd5b610b87836109f1565b946020939093013593505050565b600060208284031215610ba757600080fd5b610800826109f1565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201610bee57610bee610bc6565b5060010190565b600082821015610c0757610c07610bc6565b500390565b634e487b7160e01b600052603160045260246000fdfea26469706673582212201ea919ead4191e37a6894f70ddc20a142929445f31777c3eebefe297e8199d8164736f6c634300080f0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 25 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.