Contract
0x2d44cb096207250d1a176f4f9b1c4f82806d978d
2
Contract Overview
[ Download CSV Export ]
Latest 2 internal transactions
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0x5e3d9478821910a83c86ba0278e9f17d47906cd83dac5dc7f39aa95666aecaf2 | 19876489 | 137 days 5 hrs ago | 0x2d44cb096207250d1a176f4f9b1c4f82806d978d | 0x8b5f87e42d5e16414a593875e4b7b1d20a273ae9 | 56 AVAX | ||
0xe448278c7fe95262d0698aa117d3828172e17ab420e50135d0a417f4f52e7a09 | 18029793 | 182 days 16 hrs ago | 0x2d44cb096207250d1a176f4f9b1c4f82806d978d | 0x8b5f87e42d5e16414a593875e4b7b1d20a273ae9 | 129 AVAX |
[ Download CSV Export ]
Contract Name:
FarmerCheems
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; contract FarmerCheems is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable { uint256 public _tokenIds; uint256 public price = 100000000000000000; event FarmersManufactured(address to, uint256 quantity); bytes4 ERC721_RECEIVED = 0x150b7a02; address public EmergencyAddress; address public Oracle; bool public transferFarmEnabled; uint256 public farmingPeriod; address public Cinu; uint public deposits; uint256 public stakeRequired = 500000 * 10 ** 9; mapping ( uint256 => Farm ) public Farms; mapping ( address => uint256[] ) public userFarms; mapping ( address =>uint256 ) public userFarmCount; uint256 public FarmCount=0; mapping ( address => uint256[] ) public usersFarmers; mapping ( uint256 => uint256 ) public FarmerPosition; mapping ( uint256 => uint256 ) public FarmerArrayPosition; mapping ( uint256 => uint256 ) public FarmArrayPosition; uint256 public globalfarmerproduction; uint256 public globalfarms; struct Farm { address _owner; uint256 _cinustaked; uint256 _timeofexpiration; uint256 _timeunitslocked; uint256 _timefarminitiated; uint256 _lastfarmersminted; uint256 _farmersminted; uint256 _periodproductionrate; uint256 _periodsmanufactured; bool _status; } string public contractURIstorefront = '{ "name": "Farmer Cheems", "description": "Farmer Cheems", "image": "", "external_link": "", "seller_fee_basis_points": 300, "fee_recipient": "0x42A1DE863683F3230568900bA23f86991D012f42"}'; string public _tokenURI = '{"description":"Farmer Cheems ","external_url":"","image":"","name":"Farmer Cheems" ,"seller_fee_basis_points": 500, "fee_recipient": "0x42A1DE863683F3230568900bA23f86991D012f42" }'; uint256 public royaltyPerc; address payable public royaltyContract; constructor(address cinuAddress) ERC721("Farmer Cheems", "Farmer Cheems") { EmergencyAddress = msg.sender; farmingPeriod = 60 days; royaltyContract = payable(msg.sender); Cinu = cinuAddress; } function setCinu ( address _cinu ) public onlyOwner { Cinu = _cinu; } function setPrice ( uint256 _price ) public onlyOwner { price = _price; } function setOracle ( address _oracle ) public onlyOwner { Oracle = _oracle; } function setCinuStakeRequired ( uint256 _stakerequired ) public onlyOwner { require ( _tokenIds == 0,"Too Late" ); stakeRequired = _stakerequired; } function emergencyWithdrawAnyToken( address _address) public OnlyEmergency { IERC20 _token = IERC20(_address); _token.transfer( msg.sender, _token.balanceOf (address(this)) ); } function emergencyWithdrawBNB() public OnlyEmergency { payable(msg.sender).transfer( address(this).balance ); } function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes memory _data) public view returns(bytes4){ _operator; _from; _tokenId; _data; return ERC721_RECEIVED; } function setTokenURI ( string memory _uri ) public onlyOwner { _tokenURI = _uri; } function setStoreJSON ( string memory _uri ) public onlyOwner { contractURIstorefront = _uri; } function setTokenURIEngine ( uint256 tokenId, string memory __tokenURI) public onlyOwner { _setTokenURI( tokenId, __tokenURI); } function setTokenURIEngineByOracle ( uint256 tokenId, string memory __tokenURI) public onlyOracle { _setTokenURI( tokenId, __tokenURI); } function FarmTransferToggle () public onlyOwner { transferFarmEnabled = !transferFarmEnabled; } function transferFarm ( address _owner , uint256 _farm, address _newowner ) public { require ( Farms[_farm]._owner == _owner, "Not rightful owner" ); require ( transferFarmEnabled , "Not Enabled "); Farms[_farm]._owner = _newowner; userFarmCount[_owner]--; uint256 pos = FarmArrayPosition[_farm]; userFarms[_owner][pos] = userFarms[msg.sender][userFarms[msg.sender].length-1]; FarmArrayPosition[userFarms[_owner][pos]] = pos; userFarms[_owner].pop(); userFarms[_newowner].push(_farm); FarmArrayPosition[_farm] = userFarms[_newowner].length - 1; userFarmCount[_newowner]++; } function contractURI() public view returns (string memory) { return contractURIstorefront; } function mintFarmers( uint256 _farm ) public payable { require ( Farms[ _farm]._periodsmanufactured < Farms[ _farm]._timeunitslocked ); if ( Farms[ _farm]._farmersminted != 0 ) Farms[ _farm]._periodsmanufactured++; require ( Farms[ _farm]._owner == msg.sender ); require ( Farms[ _farm]._status == true ); require ( block.timestamp > Farms[ _farm]._lastfarmersminted + farmingPeriod, "manufacturing process not complete" ); for ( uint i = 0; i < Farms[ _farm]._periodproductionrate; i++ ) { _tokenIds++; uint256 newTokenId = _tokenIds; _safeMint( msg.sender , newTokenId); _setTokenURI(newTokenId, _tokenURI); usersFarmers[msg.sender].push(newTokenId); FarmArrayPosition[newTokenId] = usersFarmers[msg.sender].length -1; Farms[_farm]._farmersminted++; } Farms[_farm]._lastfarmersminted = block.timestamp; emit FarmersManufactured(msg.sender, Farms[ _farm]._periodproductionrate ); } function getUsersFarmers ( address _user ) public view returns(uint256[] memory){ return usersFarmers[_user]; } function manufactureUnits( uint256 _timeunitslocked, uint256 _units ) public pure returns(uint256){ return _timeunitslocked * _units; } function getUserFarms(address _user ) public view returns(uint256[] memory) { return userFarms[_user]; } function stakeCinu( uint256 _timeperiod ) public payable { require ( msg.value == price, "Not enough native paid"); uint256 _units = 1; require ( manufactureUnits( _timeperiod, _units ) <= 12 ); require ( _timeperiod > 0 && _timeperiod <=12); deposits += stakeRequired; IERC20 _token = IERC20(Cinu); _token.transferFrom( msg.sender, address(this) , stakeRequired ); FarmCount++; Farms[FarmCount]._owner = msg.sender; Farms[FarmCount]._timeofexpiration = block.timestamp + ( farmingPeriod * _timeperiod); Farms[FarmCount]._timeunitslocked = _timeperiod; Farms[FarmCount]._cinustaked = stakeRequired; Farms[FarmCount]._timefarminitiated = block.timestamp; Farms[FarmCount]._lastfarmersminted = 0; Farms[FarmCount]._farmersminted = 0; Farms[FarmCount]._periodproductionrate = _timeperiod; Farms[FarmCount]._status = true; userFarms[msg.sender].push(FarmCount); userFarmCount[msg.sender]++; FarmArrayPosition[FarmCount] = userFarms[msg.sender].length - 1; globalfarmerproduction += Farms[FarmCount]._periodproductionrate; globalfarms++; } function royaltyInfo( uint256 _tokenId, uint256 _salePrice ) public view returns ( address receiver, uint256 royaltyAmount ){ _tokenId; receiver = royaltyContract; royaltyAmount = _salePrice * royaltyPerc / 100; } function setRoyaltyPercent ( uint256 _perc ) public OnlyEmergency { royaltyPerc = _perc; } function unstakeCinu ( uint256 _farm ) public { require ( Farms[ _farm]._owner == msg.sender ); require ( Farms[ _farm]._status == true ); require ( block.timestamp > Farms[ _farm]._timeofexpiration , "time committed not yet fulfilled" ); require ( Farms[ _farm]._periodsmanufactured >= Farms[ _farm]._timeunitslocked ); Farms[_farm]._lastfarmersminted = block.timestamp; Farms[_farm]._status = false; uint256 _stake = Farms[_farm]._cinustaked; Farms[_farm]._cinustaked = 0; globalfarmerproduction = globalfarmerproduction - Farms[_farm]._periodproductionrate; globalfarms--; IERC20 _token = IERC20(Cinu); _token.transfer( msg.sender, _stake ); deposits -= Farms[_farm]._cinustaked; } function burn(uint256 tokenId) public onlyOwner { require(_isApprovedOrOwner(_msgSender(), tokenId), "caller is not owner nor approved"); uint256 pos = FarmerArrayPosition[tokenId]; usersFarmers[msg.sender][FarmerArrayPosition[tokenId]] = usersFarmers[msg.sender][ usersFarmers[msg.sender].length -1 ] ; FarmerArrayPosition[usersFarmers[msg.sender][ usersFarmers[msg.sender].length -1 ]] = pos; usersFarmers[msg.sender].pop(); _burn(tokenId); } function transfer(address from, address to, uint256 tokenId) public { popFarmer ( from, to, tokenId ); _transfer(from, to, tokenId); } function transferFrom(address from, address to, uint256 tokenId) public override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); popFarmer ( from, to, tokenId ); _transfer(from, to, tokenId); } function popFarmer (address from, address to, uint256 tokenId ) internal { usersFarmers[to].push(tokenId); uint256 pos = FarmerArrayPosition[tokenId]; usersFarmers[from][FarmerArrayPosition[tokenId]] = usersFarmers[from][ usersFarmers[from].length -1 ] ; FarmerArrayPosition[usersFarmers[from][ pos ]] = pos; usersFarmers[from].pop(); FarmerArrayPosition[tokenId] = usersFarmers[to].length -1; } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { super._burn(tokenId); } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } function _baseURI() internal pure override returns (string memory) { return ""; } modifier onlyOracle() { require( msg.sender == Oracle, "Oracle Only"); _; } modifier OnlyEmergency() { require( msg.sender == EmergencyAddress, " Emergency Only"); _; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @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 {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @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. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` 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 tokenId ) 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. * - `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 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"cinuAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"FarmersManufactured","type":"event"},{"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":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"Cinu","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EmergencyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"FarmArrayPosition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FarmCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FarmTransferToggle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"FarmerArrayPosition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"FarmerPosition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"Farms","outputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_cinustaked","type":"uint256"},{"internalType":"uint256","name":"_timeofexpiration","type":"uint256"},{"internalType":"uint256","name":"_timeunitslocked","type":"uint256"},{"internalType":"uint256","name":"_timefarminitiated","type":"uint256"},{"internalType":"uint256","name":"_lastfarmersminted","type":"uint256"},{"internalType":"uint256","name":"_farmersminted","type":"uint256"},{"internalType":"uint256","name":"_periodproductionrate","type":"uint256"},{"internalType":"uint256","name":"_periodsmanufactured","type":"uint256"},{"internalType":"bool","name":"_status","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_tokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURIstorefront","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"emergencyWithdrawAnyToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdrawBNB","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"farmingPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserFarms","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUsersFarmers","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalfarmerproduction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalfarms","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timeunitslocked","type":"uint256"},{"internalType":"uint256","name":"_units","type":"uint256"}],"name":"manufactureUnits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_farm","type":"uint256"}],"name":"mintFarmers","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyContract","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyPerc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_cinu","type":"address"}],"name":"setCinu","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stakerequired","type":"uint256"}],"name":"setCinuStakeRequired","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_perc","type":"uint256"}],"name":"setRoyaltyPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setStoreJSON","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"__tokenURI","type":"string"}],"name":"setTokenURIEngine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"__tokenURI","type":"string"}],"name":"setTokenURIEngineByOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timeperiod","type":"uint256"}],"name":"stakeCinu","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"stakeRequired","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_farm","type":"uint256"},{"internalType":"address","name":"_newowner","type":"address"}],"name":"transferFarm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferFarmEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_farm","type":"uint256"}],"name":"unstakeCinu","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userFarmCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userFarms","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"usersFarmers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
67016345785d8a0000600d55600e805463ffffffff191663150b7a021790556601c6bf52634000601355600060175561016060405260bb60808181529062003ee460a03980516200005991601e91602090910190620001e8565b506040518060e0016040528060b4815260200162003f9f60b4913980516200008a91601f91602090910190620001e8565b503480156200009857600080fd5b506040516200405338038062004053833981016040819052620000bb916200028e565b604080518082018252600d8082526c4661726d657220436865656d7360981b6020808401828152855180870190965292855284015281519192916200010391600091620001e8565b50805162000119906001906020840190620001e8565b50505062000136620001306200019260201b60201c565b62000196565b600e8054600160201b600160c01b03191633640100000000810291909117909155624f1a00601055602180546001600160a01b03199081169092179055601180549091166001600160a01b0392909216919091179055620002fd565b3390565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001f690620002c0565b90600052602060002090601f0160209004810192826200021a576000855562000265565b82601f106200023557805160ff191683800117855562000265565b8280016001018555821562000265579182015b828111156200026557825182559160200191906001019062000248565b506200027392915062000277565b5090565b5b8082111562000273576000815560010162000278565b600060208284031215620002a157600080fd5b81516001600160a01b0381168114620002b957600080fd5b9392505050565b600181811c90821680620002d557607f821691505b60208210811415620002f757634e487b7160e01b600052602260045260246000fd5b50919050565b613bd7806200030d6000396000f3fe6080604052600436106102e85760003560e01c8062f1ac30146102ed57806301ffc9a71461031857806305010105146103485780630522c8601461036c57806306fdde0314610382578063081812fc14610397578063095ea7b3146103c45780630d4ec783146103e65780630f956495146103fc578063150b7a021461041c5780631562d10b146104555780631663ee031461047557806318160ddd1461049557806323309719146104aa57806323b872dd146104d75780632a55205a146104f75780632f745c5914610525578063323a5e0b146105455780633a5c38a61461055b5780633c76724a1461062a57806342842e0e1461064a57806342966c681461066a5780634b3160f91461068a5780634f6ccce7146106ab578063570a47d0146106cb57806359868496146106f85780636352211e1461070b57806363bea36b1461072b578063673c2d73146107585780636cd50c2e1461077857806370a0823114610798578063715018a6146107b85780637adbf973146107cd57806380446eee146107ed5780638812de101461080d5780638da5cb5b1461082d57806391b7f5ed1461084257806395d89b41146108625780639a4fc640146108775780639f8621dd14610897578063a035b1fe146108ad578063a22cb465146108c3578063a35f84af146108e3578063a44d01271461090a578063a740a3401461092a578063a8957d931461093d578063aa46a4001461095d578063b4ce37d214610973578063b88d4fde14610988578063b9c926dc146109a8578063ba799c72146109d5578063bab1661e146109eb578063beabacc814610a18578063c87b56dd14610a38578063cdf4f9d714610a58578063d2b1985314610a6d578063e0df5b6f14610a8d578063e59df16514610aad578063e88f2e0314610ac3578063e8a3d48514610ae3578063e985e9c514610af8578063eb81d5fd14610b18578063f24a534e14610b38578063f26b854f14610b58578063f2fde38b14610b6d578063fd10299c14610b8d575b600080fd5b3480156102f957600080fd5b50610302610bad565b60405161030f91906138cc565b60405180910390f35b34801561032457600080fd5b506103386103333660046136bb565b610c3b565b604051901515815260200161030f565b34801561035457600080fd5b5061035e60135481565b60405190815260200161030f565b34801561037857600080fd5b5061035e601d5481565b34801561038e57600080fd5b50610302610c4c565b3480156103a357600080fd5b506103b76103b2366004613729565b610cde565b60405161030f919061381e565b3480156103d057600080fd5b506103e46103df366004613638565b610d6b565b005b3480156103f257600080fd5b5061035e60175481565b34801561040857600080fd5b5061035e610417366004613638565b610e7c565b34801561042857600080fd5b5061043c610437366004613586565b610ead565b6040516001600160e01b0319909116815260200161030f565b34801561046157600080fd5b506103e46104703660046136f5565b610ebc565b34801561048157600080fd5b506021546103b7906001600160a01b031681565b3480156104a157600080fd5b5060085461035e565b3480156104b657600080fd5b5061035e6104c5366004613729565b601b6020526000908152604090205481565b3480156104e357600080fd5b506103e46104f236600461354a565b610f02565b34801561050357600080fd5b506105176105123660046137a1565b610f3f565b60405161030f92919061386f565b34801561053157600080fd5b5061035e610540366004613638565b610f74565b34801561055157600080fd5b5061035e60125481565b34801561056757600080fd5b506105d4610576366004613729565b60146020526000908152604090208054600182015460028301546003840154600485015460058601546006870154600788015460088901546009909901546001600160a01b0390981698969795969495939492939192909160ff168a565b604080516001600160a01b03909b168b5260208b0199909952978901969096526060880194909452608087019290925260a086015260c085015260e084015261010083015215156101208201526101400161030f565b34801561063657600080fd5b506103e4610645366004613505565b61100a565b34801561065657600080fd5b506103e461066536600461354a565b61105b565b34801561067657600080fd5b506103e4610685366004613729565b611076565b34801561069657600080fd5b50600f5461033890600160a01b900460ff1681565b3480156106b757600080fd5b5061035e6106c6366004613729565b611207565b3480156106d757600080fd5b506106eb6106e6366004613505565b61129a565b60405161030f9190613888565b6103e4610706366004613729565b611306565b34801561071757600080fd5b506103b7610726366004613729565b6115bb565b34801561073757600080fd5b5061035e610746366004613729565b601a6020526000908152604090205481565b34801561076457600080fd5b506103e461077336600461375b565b611632565b34801561078457600080fd5b506011546103b7906001600160a01b031681565b3480156107a457600080fd5b5061035e6107b3366004613505565b61166b565b3480156107c457600080fd5b506103e46116f2565b3480156107d957600080fd5b506103e46107e8366004613505565b61172d565b3480156107f957600080fd5b5061035e6108083660046137a1565b61177e565b34801561081957600080fd5b506103e4610828366004613662565b611791565b34801561083957600080fd5b506103b7611a28565b34801561084e57600080fd5b506103e461085d366004613729565b611a37565b34801561086e57600080fd5b50610302611a6b565b34801561088357600080fd5b506103e4610892366004613729565b611a7a565b3480156108a357600080fd5b5061035e60205481565b3480156108b957600080fd5b5061035e600d5481565b3480156108cf57600080fd5b506103e46108de366004613601565b611ab0565b3480156108ef57600080fd5b50600e546103b790600160201b90046001600160a01b031681565b34801561091657600080fd5b506106eb610925366004613505565b611abb565b6103e4610938366004613729565b611b25565b34801561094957600080fd5b506103e4610958366004613505565b611de3565b34801561096957600080fd5b5061035e600c5481565b34801561097f57600080fd5b50610302611f0b565b34801561099457600080fd5b506103e46109a3366004613586565b611f18565b3480156109b457600080fd5b5061035e6109c3366004613729565b60196020526000908152604090205481565b3480156109e157600080fd5b5061035e601c5481565b3480156109f757600080fd5b5061035e610a06366004613505565b60166020526000908152604090205481565b348015610a2457600080fd5b506103e4610a3336600461354a565b610f29565b348015610a4457600080fd5b50610302610a53366004613729565b611f50565b348015610a6457600080fd5b506103e4611f5b565b348015610a7957600080fd5b506103e4610a88366004613729565b611fab565b348015610a9957600080fd5b506103e4610aa83660046136f5565b61217d565b348015610ab957600080fd5b5061035e60105481565b348015610acf57600080fd5b506103e4610ade36600461375b565b6121bf565b348015610aef57600080fd5b50610302612207565b348015610b0457600080fd5b50610338610b13366004613520565b612216565b348015610b2457600080fd5b5061035e610b33366004613638565b612244565b348015610b4457600080fd5b50600f546103b7906001600160a01b031681565b348015610b6457600080fd5b506103e4612260565b348015610b7957600080fd5b506103e4610b88366004613505565b6122c0565b348015610b9957600080fd5b506103e4610ba8366004613729565b61235d565b601e8054610bba90613a85565b80601f0160208091040260200160405190810160405280929190818152602001828054610be690613a85565b8015610c335780601f10610c0857610100808354040283529160200191610c33565b820191906000526020600020905b815481529060010190602001808311610c1657829003601f168201915b505050505081565b6000610c46826123cc565b92915050565b606060008054610c5b90613a85565b80601f0160208091040260200160405190810160405280929190818152602001828054610c8790613a85565b8015610cd45780601f10610ca957610100808354040283529160200191610cd4565b820191906000526020600020905b815481529060010190602001808311610cb757829003601f168201915b5050505050905090565b6000610ce9826123f1565b610d4f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610d76826115bb565b9050806001600160a01b0316836001600160a01b03161415610de45760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610d46565b336001600160a01b0382161480610e005750610e008133612216565b610e6d5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610d46565b610e77838361240e565b505050565b60156020528160005260406000208181548110610e9857600080fd5b90600052602060002001600091509150505481565b600e5460e01b5b949350505050565b33610ec5611a28565b6001600160a01b031614610eeb5760405162461bcd60e51b8152600401610d469061395a565b8051610efe90601e906020840190613385565b5050565b610f0d335b8261247c565b610f295760405162461bcd60e51b8152600401610d469061398f565b610f3483838361253e565b610e778383836126ce565b6021546020546001600160a01b0390911690600090606490610f619085613a0c565b610f6b91906139f8565b90509250929050565b6000610f7f8361166b565b8210610fe15760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610d46565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b33611013611a28565b6001600160a01b0316146110395760405162461bcd60e51b8152600401610d469061395a565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b610e7783838360405180602001604052806000815250611f18565b3361107f611a28565b6001600160a01b0316146110a55760405162461bcd60e51b8152600401610d469061395a565b6110ae33610f07565b6110fa5760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f74206f776e6572206e6f7220617070726f7665646044820152606401610d46565b6000818152601a60209081526040808320543384526018909252909120805461112590600190613a2b565b8154811061113557611135613b31565b6000918252602080832090910154338352601882526040808420868552601a909352909220548154811061116b5761116b613b31565b600091825260208083209091019290925533815260189091526040812080548392601a92909161119d90600190613a2b565b815481106111ad576111ad613b31565b60009182526020808320909101548352828101939093526040918201812093909355338352601890915290208054806111e8576111e8613b1b565b60019003818190600052602060002001600090559055610efe82612863565b600061121260085490565b82106112755760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610d46565b6008828154811061128857611288613b31565b90600052602060002001549050919050565b6001600160a01b0381166000908152601560209081526040918290208054835181840281018401909452808452606093928301828280156112fa57602002820191906000526020600020905b8154815260200190600101908083116112e6575b50505050509050919050565b600d5434146113505760405162461bcd60e51b8152602060048201526016602482015275139bdd08195b9bdd59da081b985d1a5d99481c185a5960521b6044820152606401610d46565b6001600c61135e838361177e565b111561136957600080fd5b60008211801561137a5750600c8211155b61138357600080fd5b6013546012600082825461139791906139e0565b90915550506011546013546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b039091169081906323b872dd90606401602060405180830381600087803b1580156113f457600080fd5b505af1158015611408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142c919061369e565b506017805490600061143d83613ac0565b9091555050601754600090815260146020526040902080546001600160a01b03191633179055601054611471908490613a0c565b61147b90426139e0565b601780546000908152601460209081526040808320600201949094558254825283822060030187905560135483548352848320600190810191909155835483528483204260049091015583548352848320600501839055835483528483206006018390558354835284832060070188905583548352848320600901805460ff191682179055338084526015835285842094548554928301865594845282842090910193909355918152601690915290812080549161153883613ac0565b90915550503360009081526015602052604090205461155990600190613a2b565b601b600060175481526020019081526020016000208190555060146000601754815260200190815260200160002060070154601c600082825461159c91906139e0565b9091555050601d80549060006115b183613ac0565b9190505550505050565b6000818152600260205260408120546001600160a01b031680610c465760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610d46565b3361163b611a28565b6001600160a01b0316146116615760405162461bcd60e51b8152600401610d469061395a565b610efe828261286c565b60006001600160a01b0382166116d65760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610d46565b506001600160a01b031660009081526003602052604090205490565b336116fb611a28565b6001600160a01b0316146117215760405162461bcd60e51b8152600401610d469061395a565b61172b60006128f7565b565b33611736611a28565b6001600160a01b03161461175c5760405162461bcd60e51b8152600401610d469061395a565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600061178a8284613a0c565b9392505050565b6000828152601460205260409020546001600160a01b038481169116146117ef5760405162461bcd60e51b81526020600482015260126024820152712737ba103934b3b43a333ab61037bbb732b960711b6044820152606401610d46565b600f54600160a01b900460ff166118375760405162461bcd60e51b815260206004820152600c60248201526b02737ba1022b730b13632b2160a51b6044820152606401610d46565b600082815260146020908152604080832080546001600160a01b0319166001600160a01b0386811691909117909155861683526016909152812080549161187d83613a6e565b90915550506000828152601b6020908152604080832054338452601590925290912080546118ad90600190613a2b565b815481106118bd576118bd613b31565b906000526020600020015460156000866001600160a01b03166001600160a01b0316815260200190815260200160002082815481106118fe576118fe613b31565b906000526020600020018190555080601b600060156000886001600160a01b03166001600160a01b03168152602001908152602001600020848154811061194757611947613b31565b906000526020600020015481526020019081526020016000208190555060156000856001600160a01b03166001600160a01b0316815260200190815260200160002080548061199857611998613b1b565b6000828152602080822083016000199081018390559092019092556001600160a01b038416808352601582526040832080546001818101835582865293852001879055925290546119e99190613a2b565b6000848152601b60209081526040808320939093556001600160a01b038516825260169052908120805491611a1d83613ac0565b919050555050505050565b600b546001600160a01b031690565b33611a40611a28565b6001600160a01b031614611a665760405162461bcd60e51b8152600401610d469061395a565b600d55565b606060018054610c5b90613a85565b600e54600160201b90046001600160a01b03163314611aab5760405162461bcd60e51b8152600401610d4690613931565b602055565b610efe338383612949565b6001600160a01b0381166000908152601860209081526040918290208054835181840281018401909452808452606093928301828280156112fa57602002820191906000526020600020908154815260200190600101908083116112e65750505050509050919050565b6000818152601460205260409020600381015460089091015410611b4857600080fd5b60008181526014602052604090206006015415611b82576000818152601460205260408120600801805491611b7c83613ac0565b91905055505b6000818152601460205260409020546001600160a01b03163314611ba557600080fd5b60008181526014602052604090206009015460ff161515600114611bc857600080fd5b601054600082815260146020526040902060050154611be791906139e0565b4211611c405760405162461bcd60e51b815260206004820152602260248201527f6d616e75666163747572696e672070726f63657373206e6f7420636f6d706c65604482015261746560f01b6064820152608401610d46565b60005b600082815260146020526040902060070154811015611d8d57600c8054906000611c6c83613ac0565b9091555050600c54611c7e3382612a14565b611d1281601f8054611c8f90613a85565b80601f0160208091040260200160405190810160405280929190818152602001828054611cbb90613a85565b8015611d085780601f10611cdd57610100808354040283529160200191611d08565b820191906000526020600020905b815481529060010190602001808311611ceb57829003601f168201915b505050505061286c565b336000818152601860209081526040822080546001818101835582855292842001859055929091529054611d469190613a2b565b6000828152601b602090815260408083209390935585825260149052908120600601805491611d7483613ac0565b9190505550508080611d8590613ac0565b915050611c43565b50600081815260146020526040908190204260058201556007015490517f49ca93c5fbf30abd6c76bee425710e831814d690f05451a55b56bc53314cc93791611dd89133919061386f565b60405180910390a150565b600e54600160201b90046001600160a01b03163314611e145760405162461bcd60e51b8152600401610d4690613931565b6040516370a0823160e01b815281906001600160a01b0382169063a9059cbb90339083906370a0823190611e4c90309060040161381e565b60206040518083038186803b158015611e6457600080fd5b505afa158015611e78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9c9190613742565b6040518363ffffffff1660e01b8152600401611eb992919061386f565b602060405180830381600087803b158015611ed357600080fd5b505af1158015611ee7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061369e565b601f8054610bba90613a85565b611f22338361247c565b611f3e5760405162461bcd60e51b8152600401610d469061398f565b611f4a84848484612a2e565b50505050565b6060610c4682612a61565b33611f64611a28565b6001600160a01b031614611f8a5760405162461bcd60e51b8152600401610d469061395a565b600f805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6000818152601460205260409020546001600160a01b03163314611fce57600080fd5b60008181526014602052604090206009015460ff161515600114611ff157600080fd5b60008181526014602052604090206002015442116120515760405162461bcd60e51b815260206004820181905260248201527f74696d6520636f6d6d6974746564206e6f74207965742066756c66696c6c65646044820152606401610d46565b60008181526014602052604090206003810154600890910154101561207557600080fd5b600081815260146020526040812042600582015560098101805460ff1916905560018101805492905560070154601c546120af9190613a2b565b601c55601d80549060006120c283613a6e565b909155505060115460405163a9059cbb60e01b81526001600160a01b0390911690819063a9059cbb906120fb903390869060040161386f565b602060405180830381600087803b15801561211557600080fd5b505af1158015612129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214d919061369e565b506000838152601460205260408120600101546012805491929091612173908490613a2b565b9091555050505050565b33612186611a28565b6001600160a01b0316146121ac5760405162461bcd60e51b8152600401610d469061395a565b8051610efe90601f906020840190613385565b600f546001600160a01b031633146116615760405162461bcd60e51b815260206004820152600b60248201526a4f7261636c65204f6e6c7960a81b6044820152606401610d46565b6060601e8054610c5b90613a85565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60186020528160005260406000208181548110610e9857600080fd5b600e54600160201b90046001600160a01b031633146122915760405162461bcd60e51b8152600401610d4690613931565b60405133904780156108fc02916000818181858888f193505050501580156122bd573d6000803e3d6000fd5b50565b336122c9611a28565b6001600160a01b0316146122ef5760405162461bcd60e51b8152600401610d469061395a565b6001600160a01b0381166123545760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d46565b6122bd816128f7565b33612366611a28565b6001600160a01b03161461238c5760405162461bcd60e51b8152600401610d469061395a565b600c54156123c75760405162461bcd60e51b8152602060048201526008602482015267546f6f204c61746560c01b6044820152606401610d46565b601355565b60006001600160e01b0319821663780e9d6360e01b1480610c465750610c4682612bd0565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612443826115bb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612487826123f1565b6124e85760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610d46565b60006124f3836115bb565b9050806001600160a01b0316846001600160a01b0316148061252e5750836001600160a01b031661252384610cde565b6001600160a01b0316145b80610eb45750610eb48185612216565b6001600160a01b03808316600090815260186020818152604080842080546001818101835591865283862001879055868552601a8352818520549589168552929091529091208054909161259191613a2b565b815481106125a1576125a1613b31565b60009182526020808320909101546001600160a01b0387168352601882526040808420868552601a90935290922054815481106125e0576125e0613b31565b906000526020600020018190555080601a600060186000886001600160a01b03166001600160a01b03168152602001908152602001600020848154811061262957612629613b31565b906000526020600020015481526020019081526020016000208190555060186000856001600160a01b03166001600160a01b0316815260200190815260200160002080548061267a5761267a613b1b565b6000828152602080822083016000199081018390559092019092556001600160a01b03851682526018905260409020546126b690600190613a2b565b6000928352601a602052604090922091909155505050565b826001600160a01b03166126e1826115bb565b6001600160a01b0316146127455760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610d46565b6001600160a01b0382166127a75760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610d46565b6127b2838383612c20565b6127bd60008261240e565b6001600160a01b03831660009081526003602052604081208054600192906127e6908490613a2b565b90915550506001600160a01b03821660009081526003602052604081208054600192906128149084906139e0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b038681169182179092559151849391871691600080516020613b8283398151915291a4505050565b6122bd81612c2b565b612875826123f1565b6128d85760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610d46565b6000828152600a602090815260409091208251610e7792840190613385565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156129a75760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610d46565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610efe828260405180602001604052806000815250612c6b565b612a398484846126ce565b612a4584848484612c9e565b611f4a5760405162461bcd60e51b8152600401610d46906138df565b6060612a6c826123f1565b612ad25760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610d46565b6000828152600a602052604081208054612aeb90613a85565b80601f0160208091040260200160405190810160405280929190818152602001828054612b1790613a85565b8015612b645780601f10612b3957610100808354040283529160200191612b64565b820191906000526020600020905b815481529060010190602001808311612b4757829003601f168201915b505050505090506000612b8260408051602081019091526000815290565b9050805160001415612b95575092915050565b815115612bc7578082604051602001612baf9291906137ef565b60405160208183030381529060405292505050919050565b610eb484612da8565b60006001600160e01b031982166380ac58cd60e01b1480612c0157506001600160e01b03198216635b5e139f60e01b145b80610c4657506301ffc9a760e01b6001600160e01b0319831614610c46565b610e77838383612e7f565b612c3481612f37565b6000818152600a602052604090208054612c4d90613a85565b1590506122bd576000818152600a602052604081206122bd91613409565b612c758383612fcc565b612c826000848484612c9e565b610e775760405162461bcd60e51b8152600401610d46906138df565b60006001600160a01b0384163b15612da057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612ce2903390899088908890600401613832565b602060405180830381600087803b158015612cfc57600080fd5b505af1925050508015612d2c575060408051601f3d908101601f19168201909252612d29918101906136d8565b60015b612d86573d808015612d5a576040519150601f19603f3d011682016040523d82523d6000602084013e612d5f565b606091505b508051612d7e5760405162461bcd60e51b8152600401610d46906138df565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610eb4565b506001610eb4565b6060612db3826123f1565b612e175760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610d46565b6000612e2e60408051602081019091526000815290565b90506000815111612e4e576040518060200160405280600081525061178a565b80612e58846130f8565b604051602001612e699291906137ef565b6040516020818303038152906040529392505050565b6001600160a01b038316612eda57612ed581600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612efd565b816001600160a01b0316836001600160a01b031614612efd57612efd83826131f5565b6001600160a01b038216612f1457610e7781613292565b826001600160a01b0316826001600160a01b031614610e7757610e778282613341565b6000612f42826115bb565b9050612f5081600084612c20565b612f5b60008361240e565b6001600160a01b0381166000908152600360205260408120805460019290612f84908490613a2b565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b03841690600080516020613b82833981519152908390a45050565b6001600160a01b0382166130225760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d46565b61302b816123f1565b156130775760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610d46565b61308360008383612c20565b6001600160a01b03821660009081526003602052604081208054600192906130ac9084906139e0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051839290600080516020613b82833981519152908290a45050565b60608161311c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613146578061313081613ac0565b915061313f9050600a836139f8565b9150613120565b6000816001600160401b0381111561316057613160613b47565b6040519080825280601f01601f19166020018201604052801561318a576020820181803683370190505b5090505b8415610eb45761319f600183613a2b565b91506131ac600a86613adb565b6131b79060306139e0565b60f81b8183815181106131cc576131cc613b31565b60200101906001600160f81b031916908160001a9053506131ee600a866139f8565b945061318e565b600060016132028461166b565b61320c9190613a2b565b60008381526007602052604090205490915080821461325f576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906132a490600190613a2b565b600083815260096020526040812054600880549394509092849081106132cc576132cc613b31565b9060005260206000200154905080600883815481106132ed576132ed613b31565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061332557613325613b1b565b6001900381819060005260206000200160009055905550505050565b600061334c8361166b565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b82805461339190613a85565b90600052602060002090601f0160209004810192826133b357600085556133f9565b82601f106133cc57805160ff19168380011785556133f9565b828001600101855582156133f9579182015b828111156133f95782518255916020019190600101906133de565b5061340592915061343f565b5090565b50805461341590613a85565b6000825580601f10613425575050565b601f0160209004906000526020600020908101906122bd91905b5b808211156134055760008155600101613440565b60006001600160401b038084111561346e5761346e613b47565b604051601f8501601f19908116603f0116810190828211818310171561349657613496613b47565b816040528093508581528686860111156134af57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146134e057600080fd5b919050565b600082601f8301126134f657600080fd5b61178a83833560208501613454565b60006020828403121561351757600080fd5b61178a826134c9565b6000806040838503121561353357600080fd5b61353c836134c9565b9150610f6b602084016134c9565b60008060006060848603121561355f57600080fd5b613568846134c9565b9250613576602085016134c9565b9150604084013590509250925092565b6000806000806080858703121561359c57600080fd5b6135a5856134c9565b93506135b3602086016134c9565b92506040850135915060608501356001600160401b038111156135d557600080fd5b8501601f810187136135e657600080fd5b6135f587823560208401613454565b91505092959194509250565b6000806040838503121561361457600080fd5b61361d836134c9565b9150602083013561362d81613b5d565b809150509250929050565b6000806040838503121561364b57600080fd5b613654836134c9565b946020939093013593505050565b60008060006060848603121561367757600080fd5b613680846134c9565b925060208401359150613695604085016134c9565b90509250925092565b6000602082840312156136b057600080fd5b815161178a81613b5d565b6000602082840312156136cd57600080fd5b813561178a81613b6b565b6000602082840312156136ea57600080fd5b815161178a81613b6b565b60006020828403121561370757600080fd5b81356001600160401b0381111561371d57600080fd5b610eb4848285016134e5565b60006020828403121561373b57600080fd5b5035919050565b60006020828403121561375457600080fd5b5051919050565b6000806040838503121561376e57600080fd5b8235915060208301356001600160401b0381111561378b57600080fd5b613797858286016134e5565b9150509250929050565b600080604083850312156137b457600080fd5b50508035926020909101359150565b600081518084526137db816020860160208601613a42565b601f01601f19169290920160200192915050565b60008351613801818460208801613a42565b835190830190613815818360208801613a42565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613865908301846137c3565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156138c0578351835292840192918401916001016138a4565b50909695505050505050565b60208152600061178a60208301846137c3565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252600f908201526e20456d657267656e6379204f6e6c7960881b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156139f3576139f3613aef565b500190565b600082613a0757613a07613b05565b500490565b6000816000190483118215151615613a2657613a26613aef565b500290565b600082821015613a3d57613a3d613aef565b500390565b60005b83811015613a5d578181015183820152602001613a45565b83811115611f4a5750506000910152565b600081613a7d57613a7d613aef565b506000190190565b600181811c90821680613a9957607f821691505b60208210811415613aba57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613ad457613ad4613aef565b5060010190565b600082613aea57613aea613b05565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146122bd57600080fd5b6001600160e01b0319811681146122bd57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204b97b5be05986701f5a9e7ec5fa995bf0bcf30fde5fd4a9c952db8e47d97d48a64736f6c634300080700337b20226e616d65223a20224661726d657220436865656d73222c20226465736372697074696f6e223a20224661726d657220436865656d73222c2022696d616765223a2022222c202265787465726e616c5f6c696e6b223a2022222c202273656c6c65725f6665655f62617369735f706f696e7473223a203330302c20226665655f726563697069656e74223a2022307834324131444538363336383346333233303536383930306241323366383639393144303132663432227d7b226465736372697074696f6e223a224661726d657220436865656d7320222c2265787465726e616c5f75726c223a22222c22696d616765223a22222c226e616d65223a224661726d657220436865656d7322202c2273656c6c65725f6665655f62617369735f706f696e7473223a203530302c20226665655f726563697069656e74223a202230783432413144453836333638334633323330353638393030624132336638363939314430313266343222207d00000000000000000000000083a9750883b82a86424f604c4cd418226f3c18fb
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000083a9750883b82a86424f604c4cd418226f3c18fb
-----Decoded View---------------
Arg [0] : cinuAddress (address): 0x83a9750883b82a86424f604c4cd418226f3c18fb
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000083a9750883b82a86424f604c4cd418226f3c18fb
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.