Contract Overview
Balance:
0 AVAX
AVAX Value:
$0.00
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Contract Name:
CatThief
Compiler Version
v0.8.2+commit.661d1103
Contract Source Code (Solidity)
/** *Submitted for verification at snowtrace.io on 2022-03-26 */ // SPDX-License-Identifier: MIT // contract developed by xrpant // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // 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; } } // File: @openzeppelin/contracts/utils/Context.sol // 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; } } // File: @openzeppelin/contracts/access/Ownable.sol // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; /** * @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: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } // File: @openzeppelin/contracts/token/ERC20/ERC20.sol // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, _allowances[owner][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = _allowances[owner][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Spend `amount` form the allowance of `owner` toward `spender`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } // File: @openzeppelin/contracts/utils/math/SafeMath.sol // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } // File: cheese/thief.sol pragma solidity 0.8.2; interface ICat { function ownerOf(uint cat) external view returns (address catOwner); function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract CatThief is Ownable, ReentrancyGuard { address public CAT_CONTRACT = 0xeE18DBa45cb3ef6bd3211209eFE997C5cB314193; address public KGOLD_CONTRACT; mapping(address => bool) public cheesyAddresses; mapping(uint => bool) public isCatching; mapping(uint => uint) public catLevel; uint public BASE_STEAL_PCT = 20; uint[] public catThieves; constructor() {} event StakedCats(address staker, uint numCats); function startCatching() external { ICat c = ICat(CAT_CONTRACT); uint[] memory _catsOwned = c.walletOfOwner(msg.sender); uint _count = _catsOwned.length; require(_count > 0, "You don't have any cats!"); for (uint i = 0; i < _count; i++) { if (!isCatching[_catsOwned[i]]) { isCatching[_catsOwned[i]] = true; catThieves.push(_catsOwned[i]); } } emit StakedCats(msg.sender, _count); } function checkSteal(uint level) external view returns(address, uint, bool) { if (catThieves.length > 0) { ICat c = ICat(CAT_CONTRACT); uint count = catThieves.length; uint rand = block.timestamp + block.difficulty * 2; uint cat = catThieves[rand % count]; uint stealPct = 0; if ((20 + catLevel[cat]) > level) { stealPct = 20 + catLevel[cat] - level; } uint rand2 = rand + block.number; if ((rand2 % 100) > stealPct) { return (c.ownerOf(cat), cat, false); } else { return (c.ownerOf(cat), cat, true); } } else { return (address(this), 0, false); } } function checkCatLevel(uint cat) public view returns(uint) { return catLevel[cat]; } function increaseCatLevel(uint cat) external { require(msg.sender == KGOLD_CONTRACT, "Only King Pyro can call this function!"); catLevel[cat] += 1; } // <AdminStuff> function updateSteal(uint _stealPct) external onlyOwner { BASE_STEAL_PCT = _stealPct; } function addCheesyAddress(address account) external onlyOwner { cheesyAddresses[account] = true; } function setKingAddress(address _kAddr) public onlyOwner { KGOLD_CONTRACT = _kAddr; } function updateCatAddress(address cat) external onlyOwner { CAT_CONTRACT = cat; } }
[{"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":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"numCats","type":"uint256"}],"name":"StakedCats","type":"event"},{"inputs":[],"name":"BASE_STEAL_PCT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CAT_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"KGOLD_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addCheesyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"catLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"catThieves","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cat","type":"uint256"}],"name":"checkCatLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"checkSteal","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"cheesyAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cat","type":"uint256"}],"name":"increaseCatLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isCatching","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"_kAddr","type":"address"}],"name":"setKingAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startCatching","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"cat","type":"address"}],"name":"updateCatAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stealPct","type":"uint256"}],"name":"updateSteal","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052600280546001600160a01b03191673ee18dba45cb3ef6bd3211209efe997c5cb314193179055601460075534801561003b57600080fd5b506100453361004e565b6001805561009e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610c44806100ad6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063715018a6116100a2578063a4fb79fc11610071578063a4fb79fc1461027b578063b229254914610284578063d263e38a146102a7578063f2fde38b146102ba578063f4428671146102cd57610116565b8063715018a61461022157806378a7ed0a146102295780638da5cb5b14610257578063951ad9601461026857610116565b8063590b9195116100e9578063590b919514610186578063592093a21461018e5780635d088518146101a157806361af9abe146101db5780636c0305b0146101ee57610116565b80630e8fc2281461011b57806312c1224814610130578063230e386a146101605780635713aee314610173575b600080fd5b61012e6101293660046109f9565b6102ed565b005b600354610143906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600254610143906001600160a01b031681565b61012e610181366004610af7565b610342565b61012e610371565b61012e61019c366004610af7565b61057d565b6101b46101af366004610af7565b61060d565b604080516001600160a01b0390941684526020840192909252151590820152606001610157565b61012e6101e93660046109f9565b61081d565b6102116101fc3660046109f9565b60046020526000908152604090205460ff1681565b6040519015158152602001610157565b61012e61086b565b610249610237366004610af7565b60066020526000908152604090205481565b604051908152602001610157565b6000546001600160a01b0316610143565b610249610276366004610af7565b6108a1565b61024960075481565b610211610292366004610af7565b60056020526000908152604090205460ff1681565b61012e6102b53660046109f9565b6108c2565b61012e6102c83660046109f9565b61090e565b6102496102db366004610af7565b60009081526006602052604090205490565b6000546001600160a01b031633146103205760405162461bcd60e51b815260040161031790610b0f565b60405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461036c5760405162461bcd60e51b815260040161031790610b0f565b600755565b60025460405162438b6360e81b81523360048201526001600160a01b0390911690600090829063438b63009060240160006040518083038186803b1580156103b857600080fd5b505afa1580156103cc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103f49190810190610a38565b8051909150806104465760405162461bcd60e51b815260206004820152601860248201527f596f7520646f6e2774206861766520616e7920636174732100000000000000006044820152606401610317565b60005b8181101561053e576005600084838151811061047557634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182528101919091526040016000205460ff1661052c576001600560008584815181106104bd57634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550600883828151811061050c57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151825460018101845560009384529190922001555b8061053681610b92565b915050610449565b5060408051338152602081018390527f619cabb5bc14e79956913bc7c5db19f38cfff217471c0bb1a4d63408d08db69d910160405180910390a1505050565b6003546001600160a01b031633146105e65760405162461bcd60e51b815260206004820152602660248201527f4f6e6c79204b696e67205079726f2063616e2063616c6c20746869732066756e6044820152656374696f6e2160d01b6064820152608401610317565b6000818152600660205260408120805460019290610605908490610b44565b909155505050565b600854600090819081901561080c57600280546008546001600160a01b039091169160009061063d904490610b5c565b6106479042610b44565b9050600060086106578484610bad565b8154811061067557634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050600088600660008481526020019081526020016000205460146106a59190610b44565b11156106d45760008281526006602052604090205489906106c7906014610b44565b6106d19190610b7b565b90505b60006106e04385610b44565b9050816106ee606483610bad565b1115610780576040516331a9108f60e11b8152600481018490526001600160a01b03871690636352211e9060240160206040518083038186803b15801561073457600080fd5b505afa158015610748573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076c9190610a1c565b836000985098509850505050505050610816565b6040516331a9108f60e11b8152600481018490526001600160a01b03871690636352211e9060240160206040518083038186803b1580156107c057600080fd5b505afa1580156107d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f89190610a1c565b836001985098509850505050505050610816565b5030915060009050805b9193909250565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161031790610b0f565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b031633146108955760405162461bcd60e51b815260040161031790610b0f565b61089f60006109a9565b565b600881815481106108b157600080fd5b600091825260209091200154905081565b6000546001600160a01b031633146108ec5760405162461bcd60e51b815260040161031790610b0f565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109385760405162461bcd60e51b815260040161031790610b0f565b6001600160a01b03811661099d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610317565b6109a6816109a9565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610a0a578081fd5b8135610a1581610bf9565b9392505050565b600060208284031215610a2d578081fd5b8151610a1581610bf9565b60006020808385031215610a4a578182fd5b825167ffffffffffffffff80821115610a61578384fd5b818501915085601f830112610a74578384fd5b815181811115610a8657610a86610be3565b838102604051601f19603f83011681018181108582111715610aaa57610aaa610be3565b604052828152858101935084860182860187018a1015610ac8578788fd5b8795505b83861015610aea578051855260019590950194938601938601610acc565b5098975050505050505050565b600060208284031215610b08578081fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610b5757610b57610bcd565b500190565b6000816000190483118215151615610b7657610b76610bcd565b500290565b600082821015610b8d57610b8d610bcd565b500390565b6000600019821415610ba657610ba6610bcd565b5060010190565b600082610bc857634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146109a657600080fdfea2646970667358221220bb2e56ad94e52250fd2a4101f6f82207fd6b7f48fc2c7c375f5371ff3d573aca64736f6c63430008020033
Deployed ByteCode Sourcemap
30082:2535:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32412:97;;;;;;:::i;:::-;;:::i;:::-;;30216:29;;;;;-1:-1:-1;;;;;30216:29:0;;;;;;-1:-1:-1;;;;;2068:32:1;;;2050:51;;2038:2;2023:18;30216:29:0;;;;;;;;30137:72;;;;;-1:-1:-1;;;;;30137:72:0;;;32183:101;;;;;;:::i;:::-;;:::i;30552:513::-;;;:::i;31982:172::-;;;;;;:::i;:::-;;:::i;31073:795::-;;;;;;:::i;:::-;;:::i;:::-;;;;-1:-1:-1;;;;;2605:32:1;;;2587:51;;2669:2;2654:18;;2647:34;;;;2724:14;2717:22;2697:18;;;2690:50;2575:2;2560:18;31073:795:0;2542:204:1;32292:112:0;;;;;;:::i;:::-;;:::i;30254:47::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2916:14:1;;2909:22;2891:41;;2879:2;2864:18;30254:47:0;2846:92:1;5433:103:0;;;:::i;30354:37::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;4617:25:1;;;4605:2;4590:18;30354:37:0;4572:76:1;4782:87:0;4828:7;4855:6;-1:-1:-1;;;;;4855:6:0;4782:87;;30440:24;;;;;;:::i;:::-;;:::i;30400:31::-;;;;;;30308:39;;;;;;:::i;:::-;;;;;;;;;;;;;;;;32517:95;;;;;;:::i;:::-;;:::i;5691:201::-;;;;;;:::i;:::-;;:::i;31876:98::-;;;;;;:::i;:::-;31929:4;31953:13;;;:8;:13;;;;;;;31876:98;32412:97;4828:7;4855:6;-1:-1:-1;;;;;4855:6:0;3586:10;5002:23;4994:68;;;;-1:-1:-1;;;4994:68:0;;;;;;;:::i;:::-;;;;;;;;;32478:14:::1;:23:::0;;-1:-1:-1;;;;;;32478:23:0::1;-1:-1:-1::0;;;;;32478:23:0;;;::::1;::::0;;;::::1;::::0;;32412:97::o;32183:101::-;4828:7;4855:6;-1:-1:-1;;;;;4855:6:0;3586:10;5002:23;4994:68;;;;-1:-1:-1;;;4994:68:0;;;;;;;:::i;:::-;32250:14:::1;:26:::0;32183:101::o;30552:513::-;30611:12;;30662:27;;-1:-1:-1;;;30662:27:0;;30678:10;30662:27;;;2050:51:1;-1:-1:-1;;;;;30611:12:0;;;;30597:6;;30611:12;;30662:15;;2023:18:1;;30662:27:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;30662:27:0;;;;;;;;;;;;:::i;:::-;30714:17;;30635:54;;-1:-1:-1;30750:10:0;30742:47;;;;-1:-1:-1;;;30742:47:0;;4320:2:1;30742:47:0;;;4302:21:1;4359:2;4339:18;;;4332:30;4398:26;4378:18;;;4371:54;4442:18;;30742:47:0;4292:174:1;30742:47:0;30807:6;30802:208;30823:6;30819:1;:10;30802:208;;;30856:10;:25;30867:10;30878:1;30867:13;;;;;;-1:-1:-1;;;30867:13:0;;;;;;;;;;;;;;;;;;;;30856:25;;;;;;;;;;-1:-1:-1;30856:25:0;;;;30851:148;;30930:4;30902:10;:25;30913:10;30924:1;30913:13;;;;;;-1:-1:-1;;;30913:13:0;;;;;;;;;;;;;;;30902:25;;;;;;;;;;;;:32;;;;;;;;;;;;;;;;;;30953:10;30969;30980:1;30969:13;;;;;;-1:-1:-1;;;30969:13:0;;;;;;;;;;;;;;;;;;;;30953:30;;;;;;;-1:-1:-1;30953:30:0;;;;;;;;;30851:148;30831:3;;;;:::i;:::-;;;;30802:208;;;-1:-1:-1;31027:30:0;;;31038:10;2286:51:1;;2368:2;2353:18;;2346:34;;;31027:30:0;;2259:18:1;31027:30:0;;;;;;;30552:513;;;:::o;31982:172::-;32060:14;;-1:-1:-1;;;;;32060:14:0;32046:10;:28;32038:79;;;;-1:-1:-1;;;32038:79:0;;3552:2:1;32038:79:0;;;3534:21:1;3591:2;3571:18;;;3564:30;3630:34;3610:18;;;3603:62;-1:-1:-1;;;3681:18:1;;;3674:36;3727:19;;32038:79:0;3524:228:1;32038:79:0;32128:13;;;;:8;:13;;;;;:18;;32145:1;;32128:13;:18;;32145:1;;32128:18;:::i;:::-;;;;-1:-1:-1;;;31982:172:0:o;31073:795::-;31164:10;:17;31127:7;;;;;;31164:21;31160:701;;31216:12;;;31257:10;:17;-1:-1:-1;;;;;31216:12:0;;;;31202:6;;31319:20;;:16;;:20;:::i;:::-;31301:38;;:15;:38;:::i;:::-;31289:50;-1:-1:-1;31354:8:0;31365:10;31376:12;31383:5;31289:50;31376:12;:::i;:::-;31365:24;;;;;;-1:-1:-1;;;31365:24:0;;;;;;;;;;;;;;;;;31354:35;;31404:13;31465:5;31448:8;:13;31457:3;31448:13;;;;;;;;;;;;31443:2;:18;;;;:::i;:::-;31442:28;31438:106;;;31507:13;;;;:8;:13;;;;;;31523:5;;31502:18;;:2;:18;:::i;:::-;:26;;;;:::i;:::-;31491:37;;31438:106;31561:10;31574:19;31581:12;31574:4;:19;:::i;:::-;31561:32;-1:-1:-1;31630:8:0;31615:11;31623:3;31561:32;31615:11;:::i;:::-;31614:24;31610:175;;;31667:14;;-1:-1:-1;;;31667:14:0;;;;;4617:25:1;;;-1:-1:-1;;;;;31667:9:0;;;;;4590:18:1;;31667:14:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;31683:3;31688:5;31659:35;;;;;;;;;;;;;;31610:175;31743:14;;-1:-1:-1;;;31743:14:0;;;;;4617:25:1;;;-1:-1:-1;;;;;31743:9:0;;;;;4590:18:1;;31743:14:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;31759:3;31764:4;31735:34;;;;;;;;;;;;;;31160:701;-1:-1:-1;31833:4:0;;-1:-1:-1;31840:1:0;;-1:-1:-1;31840:1:0;31160:701;31073:795;;;;;:::o;32292:112::-;4828:7;4855:6;-1:-1:-1;;;;;4855:6:0;3586:10;5002:23;4994:68;;;;-1:-1:-1;;;4994:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;32365:24:0::1;;::::0;;;:15:::1;:24;::::0;;;;:31;;-1:-1:-1;;32365:31:0::1;32392:4;32365:31;::::0;;32292:112::o;5433:103::-;4828:7;4855:6;-1:-1:-1;;;;;4855:6:0;3586:10;5002:23;4994:68;;;;-1:-1:-1;;;4994:68:0;;;;;;;:::i;:::-;5498:30:::1;5525:1;5498:18;:30::i;:::-;5433:103::o:0;30440:24::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;30440:24:0;:::o;32517:95::-;4828:7;4855:6;-1:-1:-1;;;;;4855:6:0;3586:10;5002:23;4994:68;;;;-1:-1:-1;;;4994:68:0;;;;;;;:::i;:::-;32586:12:::1;:18:::0;;-1:-1:-1;;;;;;32586:18:0::1;-1:-1:-1::0;;;;;32586:18:0;;;::::1;::::0;;;::::1;::::0;;32517:95::o;5691:201::-;4828:7;4855:6;-1:-1:-1;;;;;4855:6:0;3586:10;5002:23;4994:68;;;;-1:-1:-1;;;4994:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;5780:22:0;::::1;5772:73;;;::::0;-1:-1:-1;;;5772:73:0;;3145:2:1;5772:73:0::1;::::0;::::1;3127:21:1::0;3184:2;3164:18;;;3157:30;3223:34;3203:18;;;3196:62;-1:-1:-1;;;3274:18:1;;;3267:36;3320:19;;5772:73:0::1;3117:228:1::0;5772:73:0::1;5856:28;5875:8;5856:18;:28::i;:::-;5691:201:::0;:::o;6052:191::-;6126:16;6145:6;;-1:-1:-1;;;;;6162:17:0;;;-1:-1:-1;;;;;;6162:17:0;;;;;;6195:40;;6145:6;;;;;;;6195:40;;6126:16;6195:40;6052:191;;:::o;14:257:1:-;;126:2;114:9;105:7;101:23;97:32;94:2;;;147:6;139;132:22;94:2;191:9;178:23;210:31;235:5;210:31;:::i;:::-;260:5;84:187;-1:-1:-1;;;84:187:1:o;276:261::-;;399:2;387:9;378:7;374:23;370:32;367:2;;;420:6;412;405:22;367:2;457:9;451:16;476:31;501:5;476:31;:::i;542:1162::-;;668:2;711;699:9;690:7;686:23;682:32;679:2;;;732:6;724;717:22;679:2;770:9;764:16;799:18;840:2;832:6;829:14;826:2;;;861:6;853;846:22;826:2;904:6;893:9;889:22;879:32;;949:7;942:4;938:2;934:13;930:27;920:2;;976:6;968;961:22;920:2;1010;1004:9;1032:2;1028;1025:10;1022:2;;;1038:18;;:::i;:::-;1085:2;1081;1077:11;1117:2;1111:9;1180:2;1176:7;1171:2;1167;1163:11;1159:25;1151:6;1147:38;1235:6;1223:10;1220:22;1215:2;1203:10;1200:18;1197:46;1194:2;;;1246:18;;:::i;:::-;1282:2;1275:22;1332:18;;;1366:15;;;;-1:-1:-1;1401:11:1;;;1431;;;1427:20;;1424:33;-1:-1:-1;1421:2:1;;;1475:6;1467;1460:22;1421:2;1502:6;1493:15;;1517:156;1531:2;1528:1;1525:9;1517:156;;;1588:10;;1576:23;;1549:1;1542:9;;;;;1619:12;;;;1651;;1517:156;;;-1:-1:-1;1692:6:1;648:1056;-1:-1:-1;;;;;;;;648:1056:1:o;1709:190::-;;1821:2;1809:9;1800:7;1796:23;1792:32;1789:2;;;1842:6;1834;1827:22;1789:2;-1:-1:-1;1870:23:1;;1779:120;-1:-1:-1;1779:120:1:o;3757:356::-;3959:2;3941:21;;;3978:18;;;3971:30;4037:34;4032:2;4017:18;;4010:62;4104:2;4089:18;;3931:182::o;4653:128::-;;4724:1;4720:6;4717:1;4714:13;4711:2;;;4730:18;;:::i;:::-;-1:-1:-1;4766:9:1;;4701:80::o;4786:168::-;;4892:1;4888;4884:6;4880:14;4877:1;4874:21;4869:1;4862:9;4855:17;4851:45;4848:2;;;4899:18;;:::i;:::-;-1:-1:-1;4939:9:1;;4838:116::o;4959:125::-;;5027:1;5024;5021:8;5018:2;;;5032:18;;:::i;:::-;-1:-1:-1;5069:9:1;;5008:76::o;5089:135::-;;-1:-1:-1;;5149:17:1;;5146:2;;;5169:18;;:::i;:::-;-1:-1:-1;5216:1:1;5205:13;;5136:88::o;5229:209::-;;5287:1;5277:2;;-1:-1:-1;;;5312:31:1;;5366:4;5363:1;5356:15;5394:4;5319:1;5384:15;5277:2;-1:-1:-1;5423:9:1;;5267:171::o;5443:127::-;5504:10;5499:3;5495:20;5492:1;5485:31;5535:4;5532:1;5525:15;5559:4;5556:1;5549:15;5575:127;5636:10;5631:3;5627:20;5624:1;5617:31;5667:4;5664:1;5657:15;5691:4;5688:1;5681:15;5707:131;-1:-1:-1;;;;;5782:31:1;;5772:42;;5762:2;;5828:1;5825;5818:12
Swarm Source
ipfs://bb2e56ad94e52250fd2a4101f6f82207fd6b7f48fc2c7c375f5371ff3d573aca
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.