ETH Price: $2,630.98 (+7.65%)

Contract

0x7061D8654288D0bDe0DB559784DBABAf7e00a869
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Rewards175644532023-06-26 15:21:11476 days ago1687792871IN
0x7061D865...f7e00a869
0 ETH0.0010997515.1950307
Claim Rewards174883942023-06-15 22:58:47486 days ago1686869927IN
0x7061D865...f7e00a869
0 ETH0.0009779116.66064576
Unstake Saviors168897752023-03-23 10:54:11571 days ago1679568851IN
0x7061D865...f7e00a869
0 ETH0.0014236714.91067132
Claim Rewards168585552023-03-19 1:38:35575 days ago1679189915IN
0x7061D865...f7e00a869
0 ETH0.0006760913.13576178
Claim Rewards168585502023-03-19 1:37:35575 days ago1679189855IN
0x7061D865...f7e00a869
0 ETH0.0007055213.18747504
Unstake Saviors168585492023-03-19 1:37:23575 days ago1679189843IN
0x7061D865...f7e00a869
0 ETH0.0060322612.35241019
Unstake Saviors168286832023-03-14 20:51:59579 days ago1678827119IN
0x7061D865...f7e00a869
0 ETH0.0036328232.10683436
Unstake Saviors168191782023-03-13 12:49:59581 days ago1678711799IN
0x7061D865...f7e00a869
0 ETH0.0019021119.33734228
Unstake Saviors168191672023-03-13 12:47:47581 days ago1678711667IN
0x7061D865...f7e00a869
0 ETH0.0018854620.86909455
Claim Rewards168191652023-03-13 12:47:11581 days ago1678711631IN
0x7061D865...f7e00a869
0 ETH0.0013629218.83121809
Unstake Saviors168146302023-03-12 21:29:59581 days ago1678656599IN
0x7061D865...f7e00a869
0 ETH0.0016711320.5640514
Claim Rewards168146252023-03-12 21:28:59581 days ago1678656539IN
0x7061D865...f7e00a869
0 ETH0.0010890521.1590679
Unstake Saviors168146172023-03-12 21:27:23581 days ago1678656443IN
0x7061D865...f7e00a869
0 ETH0.0149232320.53770811
Unstake Saviors168127762023-03-12 15:15:59582 days ago1678634159IN
0x7061D865...f7e00a869
0 ETH0.0024923418.78067388
Claim Rewards168127722023-03-12 15:15:11582 days ago1678634111IN
0x7061D865...f7e00a869
0 ETH0.0011462419.52848544
Claim Rewards167995992023-03-10 18:48:11583 days ago1678474091IN
0x7061D865...f7e00a869
0 ETH0.0015045728.12296387
Unstake Saviors167995972023-03-10 18:47:47583 days ago1678474067IN
0x7061D865...f7e00a869
0 ETH0.0028179929.18597148
Unstake Saviors167959252023-03-10 6:19:47584 days ago1678429187IN
0x7061D865...f7e00a869
0 ETH0.0077558419.69333848
Unstake Saviors167958182023-03-10 5:57:23584 days ago1678427843IN
0x7061D865...f7e00a869
0 ETH0.0092873322.1947142
Claim Rewards167875512023-03-09 2:01:11585 days ago1678327271IN
0x7061D865...f7e00a869
0 ETH0.0007975536.99902099
Claim Rewards167875472023-03-09 2:00:23585 days ago1678327223IN
0x7061D865...f7e00a869
0 ETH0.0006640530.80618992
Claim Rewards167846552023-03-08 16:13:47586 days ago1678292027IN
0x7061D865...f7e00a869
0 ETH0.001547728.92897524
Unstake Saviors167846532023-03-08 16:13:23586 days ago1678292003IN
0x7061D865...f7e00a869
0 ETH0.0090768829.71807797
Claim Rewards167817182023-03-08 6:20:11586 days ago1678256411IN
0x7061D865...f7e00a869
0 ETH0.0009886219.20776636
Unstake Saviors167816772023-03-08 6:11:59586 days ago1678255919IN
0x7061D865...f7e00a869
0 ETH0.0163151721.9186052
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SaviorStaking

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 1337 runs

Other Settings:
default evmVersion
File 1 of 8 : SaviorStaking.sol
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./interfaces/ISucker.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract SaviorStaking is Ownable {
    using EnumerableSet for EnumerableSet.UintSet;

    struct UserStake {
        EnumerableSet.UintSet saviors;
        uint256 lastRewardUpdate;
        uint256 rewardsAccumulated;
    }

    mapping(address => UserStake) private saviorUsers;

    IERC721 saviorNft;
    ISucker suckerToken;

    uint256 public REWARD_PER_SAVIOR = 208333330000000000000;

    modifier updateRewards(address user) {
        UserStake storage stakerUser = saviorUsers[user];
        uint256 rewardBlocks = block.timestamp - stakerUser.lastRewardUpdate;
        uint256 saviorRewards = (rewardBlocks * REWARD_PER_SAVIOR) * stakerUser.saviors.length();
        stakerUser.lastRewardUpdate = block.timestamp;
        stakerUser.rewardsAccumulated += saviorRewards;
        _;
    }

    constructor(IERC721 _savior, ISucker _suckerToken) {
        saviorNft = _savior;
        suckerToken = _suckerToken;
    }

    function stakeSaviors(uint256[] memory saviorIds) external updateRewards(msg.sender) {
        UserStake storage user = saviorUsers[msg.sender];
        
        for(uint256 i; i < saviorIds.length;) {
            uint256 saviorId = saviorIds[i];
            require(saviorNft.ownerOf(saviorId) == msg.sender, "NOT_OWNER");
            user.saviors.add(saviorId);
            saviorNft.transferFrom(msg.sender, address(this), saviorId);
            unchecked {
                ++i;
            }
        }
    }

    function unstakeSaviors(uint256[] memory saviorIds) external updateRewards(msg.sender) {
        UserStake storage user = saviorUsers[msg.sender];

        for(uint256 i; i < saviorIds.length;) {
            uint256 saviorId = saviorIds[i];
            require(user.saviors.contains(saviorId), "NOT_OWNER");
            saviorUsers[msg.sender].saviors.remove(saviorId);
            saviorNft.transferFrom(address(this), msg.sender, saviorId);
            unchecked {
                ++i;
            }
        }
    }

    function claimRewards() external updateRewards(msg.sender) {
        UserStake storage user = saviorUsers[msg.sender];
        uint256 userRewards = user.rewardsAccumulated;
        require(userRewards > 0, "NO_REWARDS");
        user.rewardsAccumulated = 0;
        suckerToken.mint(msg.sender, userRewards);
    }

    function editTokenEmissions(uint256 amount) external onlyOwner {
        REWARD_PER_SAVIOR = amount;
    }

    function getUser(address userAddress) view external returns(uint[] memory, uint, uint) {
        UserStake storage user = saviorUsers[userAddress];
        uint[] memory saviorStaked = user.saviors.values();
        uint256 rewardBlocks = block.timestamp - user.lastRewardUpdate;
        uint256 saviorRewards = ((rewardBlocks * REWARD_PER_SAVIOR) * user.saviors.length()) + user.rewardsAccumulated;
        return (saviorStaked, user.lastRewardUpdate, saviorRewards);
    }

}

File 2 of 8 : Ownable.sol
// 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);
    }
}

File 3 of 8 : ISucker.sol
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ISucker is IERC20 {
    function mint(address receiver, uint256 amount) external;
}

File 4 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 5 of 8 : EnumerableSet.sol
// 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;
    }
}

File 6 of 8 : IERC721.sol
// 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);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface 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);
}

File 8 of 8 : Context.sol
// 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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC721","name":"_savior","type":"address"},{"internalType":"contract ISucker","name":"_suckerToken","type":"address"}],"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"},{"inputs":[],"name":"REWARD_PER_SAVIOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"editTokenEmissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"getUser","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"saviorIds","type":"uint256[]"}],"name":"stakeSaviors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"saviorIds","type":"uint256[]"}],"name":"unstakeSaviors","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052680b4b34abd6743b200060045534801561001d57600080fd5b50604051610e57380380610e5783398101604081905261003c916100de565b61004533610076565b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055610118565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146100db57600080fd5b50565b600080604083850312156100f157600080fd5b82516100fc816100c6565b602084015190925061010d816100c6565b809150509250929050565b610d30806101276000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80638056229c11610076578063bf4077e31161005b578063bf4077e314610126578063e11ad5231461013d578063f2fde38b1461015057600080fd5b80638056229c146100f85780638da5cb5b1461010b57600080fd5b8063372500ab146100a857806349526578146100b25780636f77926b146100c5578063715018a6146100f0575b600080fd5b6100b0610163565b005b6100b06100c0366004610af7565b6102c0565b6100d86100d3366004610bca565b6104cd565b6040516100e793929190610be7565b60405180910390f35b6100b0610556565b6100b0610106366004610af7565b6105bc565b6000546040516001600160a01b0390911681526020016100e7565b61012f60045481565b6040519081526020016100e7565b6100b061014b366004610c34565b610746565b6100b061015e366004610bca565b6107a5565b33600081815260016020526040812060028101549091906101849042610c63565b9050600061019183610887565b60045461019e9084610c7a565b6101a89190610c7a565b9050428360020181905550808360030160008282546101c79190610c99565b90915550503360009081526001602052604090206003810154806102325760405162461bcd60e51b815260206004820152600a60248201527f4e4f5f524557415244530000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6000600383810191909155546040517f40c10f19000000000000000000000000000000000000000000000000000000008152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50505050505050505050565b33600081815260016020526040812060028101549091906102e19042610c63565b905060006102ee83610887565b6004546102fb9084610c7a565b6103059190610c7a565b9050428360020181905550808360030160008282546103249190610c99565b9091555050336000908152600160205260408120905b86518110156104c457600087828151811061035757610357610cb1565b60209081029190910101516002546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905291925033916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed9190610cc7565b6001600160a01b0316146104435760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610229565b61044d8382610897565b506002546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050508160010191505061033a565b50505050505050565b6001600160a01b0381166000908152600160205260408120606091908190816104f5826108aa565b905060008260020154426105099190610c63565b90506000836003015461051e85600001610887565b60045461052b9085610c7a565b6105359190610c7a565b61053f9190610c99565b600294909401549298929750929550909350505050565b6000546001600160a01b031633146105b05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610229565b6105ba60006108b7565b565b33600081815260016020526040812060028101549091906105dd9042610c63565b905060006105ea83610887565b6004546105f79084610c7a565b6106019190610c7a565b9050428360020181905550808360030160008282546106209190610c99565b9091555050336000908152600160205260408120905b86518110156104c457600087828151811061065357610653610cb1565b6020908102919091010151905061066a838261091f565b6106b65760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610229565b3360009081526001602052604090206106cf9082610937565b506002546040516323b872dd60e01b8152306004820152336024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b15801561072257600080fd5b505af1158015610736573d6000803e3d6000fd5b5050505081600101915050610636565b6000546001600160a01b031633146107a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610229565b600455565b6000546001600160a01b031633146107ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610229565b6001600160a01b03811661087b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610229565b610884816108b7565b50565b6000610891825490565b92915050565b60006108a38383610943565b9392505050565b606060006108a383610992565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815260018301602052604081205415156108a3565b60006108a383836109ee565b600081815260018301602052604081205461098a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610891565b506000610891565b6060816000018054806020026020016040519081016040528092919081815260200182805480156109e257602002820191906000526020600020905b8154815260200190600101908083116109ce575b50505050509050919050565b60008181526001830160205260408120548015610ad7576000610a12600183610c63565b8554909150600090610a2690600190610c63565b9050818114610a8b576000866000018281548110610a4657610a46610cb1565b9060005260206000200154905080876000018481548110610a6957610a69610cb1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610a9c57610a9c610ce4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610891565b6000915050610891565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610b0a57600080fd5b823567ffffffffffffffff80821115610b2257600080fd5b818501915085601f830112610b3657600080fd5b813581811115610b4857610b48610ae1565b8060051b604051601f19603f83011681018181108582111715610b6d57610b6d610ae1565b604052918252848201925083810185019188831115610b8b57600080fd5b938501935b82851015610ba957843584529385019392850192610b90565b98975050505050505050565b6001600160a01b038116811461088457600080fd5b600060208284031215610bdc57600080fd5b81356108a381610bb5565b606080825284519082018190526000906020906080840190828801845b82811015610c2057815184529284019290840190600101610c04565b505050908301949094525060400152919050565b600060208284031215610c4657600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c7557610c75610c4d565b500390565b6000816000190483118215151615610c9457610c94610c4d565b500290565b60008219821115610cac57610cac610c4d565b500190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610cd957600080fd5b81516108a381610bb5565b634e487b7160e01b600052603160045260246000fdfea26469706673582212209e5b80511fc2dba4fb0f6c926c22f2beba5c02991d8fbe535b956de15526e03c64736f6c634300080c0033000000000000000000000000c92528b4ab6fd7c1f5012cd049c2a48e6a0400de00000000000000000000000035bcf2b1c21562579c3d88ceb9d7149c96397545

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a35760003560e01c80638056229c11610076578063bf4077e31161005b578063bf4077e314610126578063e11ad5231461013d578063f2fde38b1461015057600080fd5b80638056229c146100f85780638da5cb5b1461010b57600080fd5b8063372500ab146100a857806349526578146100b25780636f77926b146100c5578063715018a6146100f0575b600080fd5b6100b0610163565b005b6100b06100c0366004610af7565b6102c0565b6100d86100d3366004610bca565b6104cd565b6040516100e793929190610be7565b60405180910390f35b6100b0610556565b6100b0610106366004610af7565b6105bc565b6000546040516001600160a01b0390911681526020016100e7565b61012f60045481565b6040519081526020016100e7565b6100b061014b366004610c34565b610746565b6100b061015e366004610bca565b6107a5565b33600081815260016020526040812060028101549091906101849042610c63565b9050600061019183610887565b60045461019e9084610c7a565b6101a89190610c7a565b9050428360020181905550808360030160008282546101c79190610c99565b90915550503360009081526001602052604090206003810154806102325760405162461bcd60e51b815260206004820152600a60248201527f4e4f5f524557415244530000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6000600383810191909155546040517f40c10f19000000000000000000000000000000000000000000000000000000008152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50505050505050505050565b33600081815260016020526040812060028101549091906102e19042610c63565b905060006102ee83610887565b6004546102fb9084610c7a565b6103059190610c7a565b9050428360020181905550808360030160008282546103249190610c99565b9091555050336000908152600160205260408120905b86518110156104c457600087828151811061035757610357610cb1565b60209081029190910101516002546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905291925033916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ed9190610cc7565b6001600160a01b0316146104435760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610229565b61044d8382610897565b506002546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050508160010191505061033a565b50505050505050565b6001600160a01b0381166000908152600160205260408120606091908190816104f5826108aa565b905060008260020154426105099190610c63565b90506000836003015461051e85600001610887565b60045461052b9085610c7a565b6105359190610c7a565b61053f9190610c99565b600294909401549298929750929550909350505050565b6000546001600160a01b031633146105b05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610229565b6105ba60006108b7565b565b33600081815260016020526040812060028101549091906105dd9042610c63565b905060006105ea83610887565b6004546105f79084610c7a565b6106019190610c7a565b9050428360020181905550808360030160008282546106209190610c99565b9091555050336000908152600160205260408120905b86518110156104c457600087828151811061065357610653610cb1565b6020908102919091010151905061066a838261091f565b6106b65760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610229565b3360009081526001602052604090206106cf9082610937565b506002546040516323b872dd60e01b8152306004820152336024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b15801561072257600080fd5b505af1158015610736573d6000803e3d6000fd5b5050505081600101915050610636565b6000546001600160a01b031633146107a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610229565b600455565b6000546001600160a01b031633146107ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610229565b6001600160a01b03811661087b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610229565b610884816108b7565b50565b6000610891825490565b92915050565b60006108a38383610943565b9392505050565b606060006108a383610992565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815260018301602052604081205415156108a3565b60006108a383836109ee565b600081815260018301602052604081205461098a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610891565b506000610891565b6060816000018054806020026020016040519081016040528092919081815260200182805480156109e257602002820191906000526020600020905b8154815260200190600101908083116109ce575b50505050509050919050565b60008181526001830160205260408120548015610ad7576000610a12600183610c63565b8554909150600090610a2690600190610c63565b9050818114610a8b576000866000018281548110610a4657610a46610cb1565b9060005260206000200154905080876000018481548110610a6957610a69610cb1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610a9c57610a9c610ce4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610891565b6000915050610891565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610b0a57600080fd5b823567ffffffffffffffff80821115610b2257600080fd5b818501915085601f830112610b3657600080fd5b813581811115610b4857610b48610ae1565b8060051b604051601f19603f83011681018181108582111715610b6d57610b6d610ae1565b604052918252848201925083810185019188831115610b8b57600080fd5b938501935b82851015610ba957843584529385019392850192610b90565b98975050505050505050565b6001600160a01b038116811461088457600080fd5b600060208284031215610bdc57600080fd5b81356108a381610bb5565b606080825284519082018190526000906020906080840190828801845b82811015610c2057815184529284019290840190600101610c04565b505050908301949094525060400152919050565b600060208284031215610c4657600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c7557610c75610c4d565b500390565b6000816000190483118215151615610c9457610c94610c4d565b500290565b60008219821115610cac57610cac610c4d565b500190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610cd957600080fd5b81516108a381610bb5565b634e487b7160e01b600052603160045260246000fdfea26469706673582212209e5b80511fc2dba4fb0f6c926c22f2beba5c02991d8fbe535b956de15526e03c64736f6c634300080c0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000c92528b4ab6fd7c1f5012cd049c2a48e6a0400de00000000000000000000000035bcf2b1c21562579c3d88ceb9d7149c96397545

-----Decoded View---------------
Arg [0] : _savior (address): 0xC92528B4AB6fd7c1F5012CD049c2A48e6a0400dE
Arg [1] : _suckerToken (address): 0x35bCF2B1c21562579C3d88CeB9D7149c96397545

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c92528b4ab6fd7c1f5012cd049c2a48e6a0400de
Arg [1] : 00000000000000000000000035bcf2b1c21562579c3d88ceb9d7149c96397545


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.