Contract Overview
Balance:
0 MATIC
My Name Tag:
Not Available
[ Download CSV Export ]
Contract Name:
Aution
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./StanToken.sol"; import "./StanNFT.sol"; import "./CollectionNFT.sol"; contract Aution is Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIds; mapping(address => uint256) public balanceOfFan; mapping(string => autionStruct) public autionIdToAution; mapping(string => address[]) public autionIdToParticipants; address public tokenStanAddress; address public stanWalletAddress; StanToken public tokenStan; StanNFT public stanNFT; CollectionNFT private collectionNFT; struct autionStruct { string autionId; uint160 nftId; StateOfAution state; address owner; address winner; mapping(address => uint256) userToBidnumber; } enum Method { BUY, AUTION } enum StateOfAution { ACTIVE, DONE, CANCEL, EXPIRED } event Winner( address _winner, uint256 _tokenId, address _artist, uint256 _bidNumber ); event Purchase( address _buyer, address _seller, uint160 _tokenId, uint256 _price ); event CreateAution( string _autionId, uint160 _nftId, StateOfAution _state, address _owner ); event MakeOffer( address _sender, uint256 _bidnumerInAution, uint256 _balanceFundOfUser, string _autionId, uint160 _tokenId ); event CancelOffer( string _autionId, uint256 _feeCharged, uint256 _balanceOfuser ); event TransferNFT( address _from, address _to, string _idCollection, uint160 _tokenIDs ); event Buy(address _buyer, uint160 _tokenId, uint256 _tokenIdToPrice); event SetStateAution(string _autionId, StateOfAution _state); event CancelListing(string _autionId, StateOfAution _state); event BackFeeToFund(bool _cancelListing, string _autionId); event Withdraw(uint256 _amount, address _user, uint256 _balanceOfuser); event Deposit(uint256 _balanceOfUser, address _user); constructor( address _tokenStan, address _stanNFT, address _collectionNFT, address _stanWalletAddress ) { tokenStan = StanToken(_tokenStan); stanNFT = StanNFT(_stanNFT); collectionNFT = CollectionNFT(_collectionNFT); stanWalletAddress = _stanWalletAddress; } modifier checkNFTOwnerShip(uint160 _tokenId) { stanNFT.isApprovedOrOwner(_tokenId); _; } modifier checkValidAmout(uint256 _amount) { require(_amount > 0, "Invalid amount"); _; } modifier checkStateOfAution(string memory _autionId) { require( autionIdToAution[_autionId].state == StateOfAution.ACTIVE, "Invalid aution state" ); _; } function Decimals() public pure returns (uint256) { return uint256(10**18); } function setTokenStan(address _tokenStan) external onlyOwner { tokenStan = StanToken(_tokenStan); } function setStateAution(string memory _autionId, StateOfAution _state) external onlyOwner { require( autionIdToAution[_autionId].state != StateOfAution.DONE, "Cannot change the aution in the past" ); autionIdToAution[_autionId].state = _state; emit SetStateAution(_autionId, _state); } function setStanNFT(address _stanNFT) external onlyOwner { stanNFT = StanNFT(_stanNFT); } function setStanAddress(address _stanAddress) external onlyOwner { stanWalletAddress = _stanAddress; } function setCollectionNFTAddress(address _collectionNFTAddress) external onlyOwner { collectionNFT = CollectionNFT(_collectionNFTAddress); } // Stan transfer fee to receivers function purchaseProcessing( string memory _idCollection, address _from, uint256 _amount, uint160 _tokenId ) internal { ( , uint256 ratioCreator, uint256 ratioStan, address creator, , ) = collectionNFT.getInfoCollection(_idCollection, _tokenId, _from); uint256 creatorAmount = (_amount * ratioCreator) / 100; uint256 creatorStan = (_amount * ratioStan) / 100; require( _amount - creatorAmount - creatorStan > 0, "The amount is not enough for the fee being charged" ); uint256 remainAmount = _amount - creatorAmount - creatorStan; tokenStan.purchase(address(this), creator, creatorAmount); tokenStan.purchase(address(this), stanWalletAddress, creatorStan); tokenStan.purchase(address(this), _from, remainAmount); } function purchase( address _buyer, address _seller, uint256 _amount, uint160 _tokenId, uint256 _feePurchase, string memory _idCollection ) external onlyOwner checkNFTOwnerShip(_tokenId) checkValidAmout(_amount) { require( tokenStan.transferFrom(_buyer, address(this), _amount), "Not enough money to proceed" ); uint256 feePurchase = (_amount * _feePurchase) / 100; uint256 amountAfterCharged = _amount - feePurchase; stanNFT.transfer(_idCollection, address(stanNFT), _buyer, _tokenId); purchaseProcessing( _idCollection, _seller, amountAfterCharged, _tokenId ); emit Purchase( _buyer, _seller, _tokenId, stanNFT.TokenIdToPrice(_tokenId) ); } function createAution( address _owner, string memory _autionId, uint160 _nftId ) external onlyOwner { autionIdToAution[_autionId].autionId = _autionId; autionIdToAution[_autionId].nftId = _nftId; autionIdToAution[_autionId].state = StateOfAution.ACTIVE; autionIdToAution[_autionId].owner = _owner; emit CreateAution(_autionId, _nftId, StateOfAution.ACTIVE, _owner); } function makeOffer( address _user, string memory _autionId, uint256 _bidNumber ) external onlyOwner checkStateOfAution(_autionId) { require(_bidNumber > 0, "Invalid bid number"); require( balanceOfFan[_user] >= _bidNumber - autionIdToAution[_autionId].userToBidnumber[_user], "Not enough balance to aution, please deposit more" ); uint256 _balanceUserAution = autionIdToAution[_autionId] .userToBidnumber[_user]; uint256 finalBidNumber = _bidNumber - _balanceUserAution; autionIdToParticipants[_autionId].push(_user); balanceOfFan[_user] -= finalBidNumber; autionIdToAution[_autionId].userToBidnumber[_user] += finalBidNumber; emit MakeOffer( _user, autionIdToAution[_autionId].userToBidnumber[_user], balanceOfFan[_user], _autionId, autionIdToAution[_autionId].nftId ); } function getWinner( address _winner, address _artist, uint256 _bidNumber, string memory _autionId, string memory _idCollection ) external onlyOwner checkNFTOwnerShip(autionIdToAution[_autionId].nftId) checkStateOfAution(_autionId) { require( autionIdToAution[_autionId].userToBidnumber[_winner] > 0 && autionIdToAution[_autionId].userToBidnumber[_winner] >= _bidNumber, "Invalid winner" ); autionIdToAution[_autionId].state = StateOfAution.DONE; backFeeToFund(false, _autionId); uint160 tokenId = autionIdToAution[_autionId].nftId; stanNFT.transfer(_idCollection, address(stanNFT), _winner, tokenId); purchaseProcessing(_idCollection, _artist, _bidNumber, tokenId); emit Winner(_winner, tokenId, _artist, _bidNumber); } function backFeeToFund(bool _cancelListing, string memory _autionId) internal { uint256 length = autionIdToParticipants[_autionId].length; if (_cancelListing) { for (uint256 i = 0; i < length; ) { address addressUser = autionIdToParticipants[_autionId][i]; balanceOfFan[addressUser] += autionIdToAution[_autionId] .userToBidnumber[addressUser]; unchecked { ++i; } } } else { for (uint256 i = 0; i < length; ) { address addressUser = autionIdToParticipants[_autionId][i]; if (addressUser != autionIdToAution[_autionId].winner) { balanceOfFan[addressUser] += autionIdToAution[_autionId] .userToBidnumber[addressUser]; } unchecked { ++i; } } } emit BackFeeToFund(_cancelListing, _autionId); } function withdraw(uint256 _amount) external { require( balanceOfFan[msg.sender] > 0 && balanceOfFan[msg.sender] >= _amount, "The amount exceed the balance of user" ); balanceOfFan[msg.sender] -= _amount; payable(msg.sender).transfer(_amount); emit Withdraw(_amount, msg.sender, balanceOfFan[msg.sender]); } function deposit(uint256 _amount) external checkValidAmout(_amount) { balanceOfFan[msg.sender] += _amount; tokenStan.purchase(msg.sender, address(this), _amount); emit Deposit(balanceOfFan[msg.sender], msg.sender); } function cancelOffer( string memory _autionId, uint256 _feeCharged, address _from ) external onlyOwner { require( autionIdToAution[_autionId].userToBidnumber[_from] > 0, "You don't take partcipate in this aution" ); uint256 balanceOfUserAution = autionIdToAution[_autionId] .userToBidnumber[_from]; autionIdToAution[_autionId].userToBidnumber[_from] = 0; uint256 feeCharged = (balanceOfUserAution * _feeCharged) / 100; uint256 amountAfterCharged = balanceOfUserAution - feeCharged; balanceOfFan[_from] += amountAfterCharged; tokenStan.purchase(address(this), stanWalletAddress, feeCharged); emit CancelOffer(_autionId, _feeCharged, balanceOfFan[_from]); } function transferPvPNFT( address _from, address _to, uint256 _fee, string memory _idCollection, uint160 _tokenIDs ) external onlyOwner { require( _from != address(0) && _to != address(0), "The address is invalid" ); require( balanceOfFan[_from] >= _fee, "Your balance is not enough to pay the fee" ); balanceOfFan[_from] -= _fee; stanNFT.transfer(_idCollection, _from, _to, _tokenIDs); tokenStan.purchase(_from, stanWalletAddress, _fee); emit TransferNFT(_from, _to, _idCollection, _tokenIDs); } function cancelListing(string memory _autionId, uint256 _fee) external onlyOwner checkStateOfAution(_autionId) { address ownerAddress = autionIdToAution[_autionId].owner; require( ownerAddress != address(0) && balanceOfFan[ownerAddress] >= _fee, "Owner balance is not enough to pay the fee" ); autionIdToAution[_autionId].state = StateOfAution.CANCEL; backFeeToFund(true, _autionId); balanceOfFan[ownerAddress] -= _fee; tokenStan.purchase(ownerAddress, stanWalletAddress, _fee); emit CancelListing(_autionId, StateOfAution.CANCEL); } function getAutionInformation(string memory _autionId, address _user) public view returns ( string memory autionId, uint160 nftId, StateOfAution state, address owner, address winner, uint256 autionBalance ) { return ( _autionId, autionIdToAution[_autionId].nftId, autionIdToAution[_autionId].state, autionIdToAution[_autionId].owner, autionIdToAution[_autionId].winner, autionIdToAution[_autionId].userToBidnumber[_user] ); } }
// 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 v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract StanToken is ERC20, Ownable { constructor() ERC20("Stan", "STC") { _mint(msg.sender, 100000 * Decimals()); } function Decimals() public pure returns (uint256) { return 10**18; } function purchase( address _from, address _to, uint256 _amount ) external returns (bool) { _transfer(_from, _to, _amount); return true; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./CollectionNFT.sol"; contract StanNFT is ERC721Enumerable, ERC721URIStorage, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIds; CollectionNFT private collectionNFT; enum StateOfNFT { ACTIVE, DONE, CANCEL } mapping(uint256 => uint256) public TokenIdToPrice; mapping(uint256 => StateOfNFT) public TokenIdToState; constructor() ERC721("Stan", "STAN") {} function Decimals() public pure returns (uint256) { return uint256(10**18); } function setCollectionNFT(address _collectionNFTAdrress) external onlyOwner { collectionNFT = CollectionNFT(_collectionNFTAdrress); } function createNFT( string memory _idCollection, string memory _tokenURI, uint256 _price ) external returns (uint256) { uint256 newTokenId = _tokenIds.current(); _safeMint(msg.sender, newTokenId); _setTokenURI(newTokenId, _tokenURI); TokenIdToPrice[newTokenId] = _price; TokenIdToState[newTokenId] = StateOfNFT.ACTIVE; collectionNFT.addNFTtoCollection(_idCollection, newTokenId, msg.sender); collectionNFT.updateOwnerNFT(_idCollection, address(0), msg.sender); _tokenIds.increment(); return newTokenId; } function isApprovedOrOwner(uint160 _tokenId) external view { require( _isApprovedOrOwner(address(this), _tokenId), "The caller didn't transfer the NFT to StanNFT smart contract" ); } function transfer( string memory _idCollection, address _from, address _to, uint160 _tokenId ) external { _transfer(_from, _to, _tokenId); collectionNFT.updateOwnerNFT(_idCollection, _from, _to); } 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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./StanNFT.sol"; contract CollectionNFT is Ownable { using Counters for Counters.Counter; StanNFT public stanNFT; Counters.Counter private _collectionIds; mapping(string => bool) public collectionId; struct stateCollection { string id; Counters.Counter currentNumber; uint256 maxNumber; uint256 ratioCreator; uint256 ratioStan; mapping(uint256 => uint256) NFT; mapping(address => address) currentOwnerNFT; mapping(uint256 => address) creator; } mapping(string => stateCollection) internal _collectionNFT; event SetCollection(string _collectionId, uint256 _maxColletionNumber); event SetRatioCollection( string _collectionId, uint256 _ratioCreator, uint256 _ratioStan ); event AddNFTtoCollection( string _collectionId, uint256 _nftId, address _creator ); modifier OnlyStanOrOwner() { require( owner() == _msgSender() || _msgSender() == address(stanNFT), "Only Owner or Stan can call this function" ); _; } constructor(address _stanNFT) { stanNFT = StanNFT(_stanNFT); } function setStanNFT(address _stanNFT) external onlyOwner { stanNFT = StanNFT(_stanNFT); } function createCollection( string memory _collectionId, uint160 _maxColletionNumber, uint256 _ratioCreator, uint256 _ratioStan ) external { require( collectionId[_collectionId] == false, "This collection id has already been used" ); collectionId[_collectionId] = true; _collectionNFT[_collectionId].id = _collectionId; _collectionNFT[_collectionId].maxNumber = _maxColletionNumber; _collectionNFT[_collectionId].currentNumber.current(); _collectionNFT[_collectionId].ratioCreator = _ratioCreator; _collectionNFT[_collectionId].ratioStan = _ratioStan; _collectionIds.increment(); emit SetCollection(_collectionId, _maxColletionNumber); } function setRatioCollection( string memory _idCollection, uint256 _ratioCreator, uint256 _ratioStan ) external { _collectionNFT[_idCollection].ratioCreator = _ratioCreator; _collectionNFT[_idCollection].ratioStan = _ratioStan; emit SetRatioCollection(_idCollection, _ratioCreator, _ratioStan); } function addNFTtoCollection( string memory _idCollection, uint256 _nftId, address _creator ) external OnlyStanOrOwner { require( _collectionNFT[_idCollection].currentNumber.current() <= _collectionNFT[_idCollection].maxNumber, "This collection has already full of NFTs" ); _collectionNFT[_idCollection].NFT[_nftId] = _nftId; _collectionNFT[_idCollection].creator[_nftId] = _creator; _collectionNFT[_idCollection].currentNumber.increment(); emit AddNFTtoCollection(_idCollection, _nftId, _creator); } function updateOwnerNFT( string memory _idCollection, address _from, address _to ) external OnlyStanOrOwner { delete _collectionNFT[_idCollection].currentOwnerNFT[_from]; _collectionNFT[_idCollection].currentOwnerNFT[_to] = _to; } function getInfoCollection( string memory _idCollection, uint256 _nft, address _currentOwnerNFT ) external view returns ( uint256 maxNumber, uint256 ratioCreator, uint256 ratioStan, address creator, uint256 nft, address currentOwnerNFT ) { return ( _collectionNFT[_idCollection].maxNumber, _collectionNFT[_idCollection].ratioCreator, _collectionNFT[_idCollection].ratioStan, _collectionNFT[_idCollection].creator[_nft], _collectionNFT[_idCollection].NFT[_nft], _collectionNFT[_idCollection].currentOwnerNFT[_currentOwnerNFT] ); } }
// 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/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 (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 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 (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/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); }
// 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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_tokenStan","type":"address"},{"internalType":"address","name":"_stanNFT","type":"address"},{"internalType":"address","name":"_collectionNFT","type":"address"},{"internalType":"address","name":"_stanWalletAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_cancelListing","type":"bool"},{"indexed":false,"internalType":"string","name":"_autionId","type":"string"}],"name":"BackFeeToFund","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_buyer","type":"address"},{"indexed":false,"internalType":"uint160","name":"_tokenId","type":"uint160"},{"indexed":false,"internalType":"uint256","name":"_tokenIdToPrice","type":"uint256"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_autionId","type":"string"},{"indexed":false,"internalType":"enum Aution.StateOfAution","name":"_state","type":"uint8"}],"name":"CancelListing","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_autionId","type":"string"},{"indexed":false,"internalType":"uint256","name":"_feeCharged","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_balanceOfuser","type":"uint256"}],"name":"CancelOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_autionId","type":"string"},{"indexed":false,"internalType":"uint160","name":"_nftId","type":"uint160"},{"indexed":false,"internalType":"enum Aution.StateOfAution","name":"_state","type":"uint8"},{"indexed":false,"internalType":"address","name":"_owner","type":"address"}],"name":"CreateAution","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_balanceOfUser","type":"uint256"},{"indexed":false,"internalType":"address","name":"_user","type":"address"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_bidnumerInAution","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_balanceFundOfUser","type":"uint256"},{"indexed":false,"internalType":"string","name":"_autionId","type":"string"},{"indexed":false,"internalType":"uint160","name":"_tokenId","type":"uint160"}],"name":"MakeOffer","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":false,"internalType":"address","name":"_buyer","type":"address"},{"indexed":false,"internalType":"address","name":"_seller","type":"address"},{"indexed":false,"internalType":"uint160","name":"_tokenId","type":"uint160"},{"indexed":false,"internalType":"uint256","name":"_price","type":"uint256"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_autionId","type":"string"},{"indexed":false,"internalType":"enum Aution.StateOfAution","name":"_state","type":"uint8"}],"name":"SetStateAution","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"string","name":"_idCollection","type":"string"},{"indexed":false,"internalType":"uint160","name":"_tokenIDs","type":"uint160"}],"name":"TransferNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"_artist","type":"address"},{"indexed":false,"internalType":"uint256","name":"_bidNumber","type":"uint256"}],"name":"Winner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_balanceOfuser","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"Decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"autionIdToAution","outputs":[{"internalType":"string","name":"autionId","type":"string"},{"internalType":"uint160","name":"nftId","type":"uint160"},{"internalType":"enum Aution.StateOfAution","name":"state","type":"uint8"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"winner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"autionIdToParticipants","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOfFan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_autionId","type":"string"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"cancelListing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_autionId","type":"string"},{"internalType":"uint256","name":"_feeCharged","type":"uint256"},{"internalType":"address","name":"_from","type":"address"}],"name":"cancelOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_autionId","type":"string"},{"internalType":"uint160","name":"_nftId","type":"uint160"}],"name":"createAution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_autionId","type":"string"},{"internalType":"address","name":"_user","type":"address"}],"name":"getAutionInformation","outputs":[{"internalType":"string","name":"autionId","type":"string"},{"internalType":"uint160","name":"nftId","type":"uint160"},{"internalType":"enum Aution.StateOfAution","name":"state","type":"uint8"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"autionBalance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_winner","type":"address"},{"internalType":"address","name":"_artist","type":"address"},{"internalType":"uint256","name":"_bidNumber","type":"uint256"},{"internalType":"string","name":"_autionId","type":"string"},{"internalType":"string","name":"_idCollection","type":"string"}],"name":"getWinner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"string","name":"_autionId","type":"string"},{"internalType":"uint256","name":"_bidNumber","type":"uint256"}],"name":"makeOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_buyer","type":"address"},{"internalType":"address","name":"_seller","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint160","name":"_tokenId","type":"uint160"},{"internalType":"uint256","name":"_feePurchase","type":"uint256"},{"internalType":"string","name":"_idCollection","type":"string"}],"name":"purchase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionNFTAddress","type":"address"}],"name":"setCollectionNFTAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stanAddress","type":"address"}],"name":"setStanAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stanNFT","type":"address"}],"name":"setStanNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_autionId","type":"string"},{"internalType":"enum Aution.StateOfAution","name":"_state","type":"uint8"}],"name":"setStateAution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenStan","type":"address"}],"name":"setTokenStan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stanNFT","outputs":[{"internalType":"contract StanNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stanWalletAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenStan","outputs":[{"internalType":"contract StanToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenStanAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"string","name":"_idCollection","type":"string"},{"internalType":"uint160","name":"_tokenIDs","type":"uint160"}],"name":"transferPvPNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162002fe338038062002fe3833981016040819052620000349162000100565b6200003f3362000093565b600780546001600160a01b039586166001600160a01b03199182161790915560088054948616948216949094179093556009805492851692841692909217909155600680549190931691161790556200015c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000fb57600080fd5b919050565b6000806000806080858703121562000116578384fd5b6200012185620000e3565b93506200013160208601620000e3565b92506200014160408601620000e3565b91506200015160608601620000e3565b905092959194509250565b612e77806200016c6000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063c6ceb50b11610097578063e65a3ef911610071578063e65a3ef91461036e578063f2fde38b14610381578063f3956d3314610394578063f46f32f2146103b957600080fd5b8063c6ceb50b1461033a578063d009404214610348578063e528f36b1461035b57600080fd5b80638da5cb5b146102b9578063a0ef08da146102ca578063a24403f4146102dd578063b6b55f2514610301578063b895cc7614610314578063c035595f1461032757600080fd5b806356ef91cd1161014b5780637a0c117a116101255780637a0c117a14610252578063829683c414610280578063853677cf146102935780638594b21a146102a657600080fd5b806356ef91cd14610224578063644a276314610237578063715018a61461024a57600080fd5b8063095d2a0f1461019357806309f35c70146101a857806317f8608f146101d85780631c1d1549146101eb5780632e1a7d4d146101fe57806346202cdd14610211575b600080fd5b6101a66101a1366004612921565b6103cc565b005b6008546101bb906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101a66101e636600461257b565b61066b565b6101a66101f936600461257b565b6106b7565b6101a661020c36600461296f565b610703565b6005546101bb906001600160a01b031681565b6101bb6102323660046128de565b610840565b6101a661024536600461262e565b610887565b6101a6610af3565b61027261026036600461257b565b60026020526000908152604090205481565b6040519081526020016101cf565b6006546101bb906001600160a01b031681565b6101a66102a13660046128de565b610b29565b6101a66102b436600461257b565b610dd1565b6000546001600160a01b03166101bb565b6101a66102d836600461259e565b610e1d565b6102f06102eb36600461280b565b611167565b6040516101cf959493929190612bfd565b6101a661030f36600461296f565b61123d565b6101a6610322366004612896565b611386565b6101a6610335366004612732565b6114e0565b670de0b6b3a7640000610272565b6007546101bb906001600160a01b031681565b6101a661036936600461257b565b611662565b6101a661037c3660046126ad565b6116ae565b6101a661038f36600461257b565b6119d0565b6103a76103a2366004612846565b611a6b565b6040516101cf96959493929190612c4b565b6101a66103c7366004612794565b611b7e565b6000546001600160a01b031633146103ff5760405162461bcd60e51b81526004016103f690612cc4565b60405180910390fd5b60006003846040516104119190612a4b565b90815260200160405180910390206004016000836001600160a01b03166001600160a01b0316815260200190815260200160002054116104a45760405162461bcd60e51b815260206004820152602860248201527f596f7520646f6e27742074616b65207061727463697061746520696e20746869604482015267399030baba34b7b760c11b60648201526084016103f6565b60006003846040516104b69190612a4b565b90815260200160405180910390206004016000836001600160a01b03166001600160a01b0316815260200190815260200160002054905060006003856040516104ff9190612a4b565b90815260408051602092819003830190206001600160a01b0386166000908152600490910190925281209190915560646105398584612d5f565b6105439190612d3f565b905060006105518284612d7e565b6001600160a01b03851660009081526002602052604081208054929350839290919061057e908490612d27565b909155505060075460065460405163320220ab60e11b81526001600160a01b03928316926364044156926105bc923092909116908790600401612aa5565b602060405180830381600087803b1580156105d657600080fd5b505af11580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e91906127eb565b506001600160a01b038416600090815260026020526040908190205490517f5463f636ea2f8ccc6d75cef317b049ebeb2d762e8bd673016d284f1e669d5c0e9161065b9189918991612c9f565b60405180910390a1505050505050565b6000546001600160a01b031633146106955760405162461bcd60e51b81526004016103f690612cc4565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106e15760405162461bcd60e51b81526004016103f690612cc4565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b33600090815260026020526040902054158015906107305750336000908152600260205260409020548111155b61078a5760405162461bcd60e51b815260206004820152602560248201527f54686520616d6f756e7420657863656564207468652062616c616e6365206f66604482015264103ab9b2b960d91b60648201526084016103f6565b33600090815260026020526040812080548392906107a9908490612d7e565b9091555050604051339082156108fc029083906000818181858888f193505050501580156107db573d6000803e3d6000fd5b5033600081815260026020526040908190205490517f9da6493a92039daf47d1f2d7a782299c5994c6323eb1e972f69c432089ec52bf92610835928583526001600160a01b03919091166020830152604082015260600190565b60405180910390a150565b8151602081840181018051600482529282019185019190912091905280548290811061086b57600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000546001600160a01b031633146108b15760405162461bcd60e51b81526004016103f690612cc4565b6001600160a01b038516158015906108d157506001600160a01b03841615155b6109165760405162461bcd60e51b8152602060048201526016602482015275151a19481859191c995cdcc81a5cc81a5b9d985b1a5960521b60448201526064016103f6565b6001600160a01b0385166000908152600260205260409020548311156109905760405162461bcd60e51b815260206004820152602960248201527f596f75722062616c616e6365206973206e6f7420656e6f75676820746f20706160448201526879207468652066656560b81b60648201526084016103f6565b6001600160a01b038516600090815260026020526040812080548592906109b8908490612d7e565b90915550506008546040516376b92d4f60e11b81526001600160a01b039091169063ed725a9e906109f3908590899089908790600401612b27565b600060405180830381600087803b158015610a0d57600080fd5b505af1158015610a21573d6000803e3d6000fd5b505060075460065460405163320220ab60e11b81526001600160a01b03928316945063640441569350610a5c928a9216908890600401612aa5565b602060405180830381600087803b158015610a7657600080fd5b505af1158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae91906127eb565b507ff210d55b5b65fa58357164707bef801542dd8da69b2eeb2e37df0d680cd8625b85858484604051610ae49493929190612a67565b60405180910390a15050505050565b6000546001600160a01b03163314610b1d5760405162461bcd60e51b81526004016103f690612cc4565b610b276000611ee3565b565b6000546001600160a01b03163314610b535760405162461bcd60e51b81526004016103f690612cc4565b816000600382604051610b669190612a4b565b9081526040519081900360200190206001015460ff600160a01b909104166003811115610ba357634e487b7160e01b600052602160045260246000fd5b14610bc05760405162461bcd60e51b81526004016103f690612cf9565b6000600384604051610bd29190612a4b565b908152604051908190036020019020600201546001600160a01b031690508015801590610c1757506001600160a01b0381166000908152600260205260409020548311155b610c765760405162461bcd60e51b815260206004820152602a60248201527f4f776e65722062616c616e6365206973206e6f7420656e6f75676820746f20706044820152696179207468652066656560b01b60648201526084016103f6565b6002600385604051610c889190612a4b565b908152604051908190036020019020600101805460ff60a01b1916600160a01b836003811115610cc857634e487b7160e01b600052602160045260246000fd5b0217905550610cd8600185611f33565b6001600160a01b03811660009081526002602052604081208054859290610d00908490612d7e565b909155505060075460065460405163320220ab60e11b81526001600160a01b0392831692636404415692610d3e928692909116908890600401612aa5565b602060405180830381600087803b158015610d5857600080fd5b505af1158015610d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9091906127eb565b507fe554d35c2a68c3733e9d0f191329be0de3700eb15d107b3033ea0d563bbc2701846002604051610dc3929190612b63565b60405180910390a150505050565b6000546001600160a01b03163314610dfb5760405162461bcd60e51b81526004016103f690612cc4565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e475760405162461bcd60e51b81526004016103f690612cc4565b600382604051610e579190612a4b565b90815260405190819003602001812060010154600854631c337c4d60e31b83526001600160a01b03918216600484018190529291169063e19be2689060240160006040518083038186803b158015610eae57600080fd5b505afa158015610ec2573d6000803e3d6000fd5b5085925060009150610ed19050565b600382604051610ee19190612a4b565b9081526040519081900360200190206001015460ff600160a01b909104166003811115610f1e57634e487b7160e01b600052602160045260246000fd5b14610f3b5760405162461bcd60e51b81526004016103f690612cf9565b6000600385604051610f4d9190612a4b565b90815260200160405180910390206004016000896001600160a01b03166001600160a01b0316815260200190815260200160002054118015610fd3575084600385604051610f9b9190612a4b565b90815260200160405180910390206004016000896001600160a01b03166001600160a01b031681526020019081526020016000205410155b6110105760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103bb4b73732b960911b60448201526064016103f6565b60016003856040516110229190612a4b565b908152604051908190036020019020600101805460ff60a01b1916600160a01b83600381111561106257634e487b7160e01b600052602160045260246000fd5b0217905550611072600085611f33565b60006003856040516110849190612a4b565b908152604051908190036020018120600101546008546376b92d4f60e11b83526001600160a01b039182169350169063ed725a9e906110cd90879084908d908790600401612b27565b600060405180830381600087803b1580156110e757600080fd5b505af11580156110fb573d6000803e3d6000fd5b5050505061110b84888884612156565b604080516001600160a01b038a8116825283811660208301528916818301526060810188905290517fa317ea4f681a5f81f80c5588f31eb01b1d7f5f52f7e954f128f8d2c43268fe6c9181900360800190a15050505050505050565b805160208183018101805160038252928201919093012091528054819061118d90612dc5565b80601f01602080910402602001604051908101604052809291908181526020018280546111b990612dc5565b80156112065780601f106111db57610100808354040283529160200191611206565b820191906000526020600020905b8154815290600101906020018083116111e957829003601f168201915b505050506001830154600284015460039094015492936001600160a01b0380831694600160a01b90930460ff169350908116911685565b806000811161127f5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016103f6565b336000908152600260205260408120805484929061129e908490612d27565b909155505060075460405163320220ab60e11b81526001600160a01b03909116906364044156906112d790339030908790600401612aa5565b602060405180830381600087803b1580156112f157600080fd5b505af1158015611305573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132991906127eb565b5033600081815260026020526040908190205490517f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a539261137a9282526001600160a01b0316602082015260400190565b60405180910390a15050565b6000546001600160a01b031633146113b05760405162461bcd60e51b81526004016103f690612cc4565b60016003836040516113c29190612a4b565b9081526040519081900360200190206001015460ff600160a01b9091041660038111156113ff57634e487b7160e01b600052602160045260246000fd5b14156114595760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f74206368616e67652074686520617574696f6e20696e20746865206044820152631c185cdd60e21b60648201526084016103f6565b8060038360405161146a9190612a4b565b908152604051908190036020019020600101805460ff60a01b1916600160a01b8360038111156114aa57634e487b7160e01b600052602160045260246000fd5b02179055507fb9f9315e87fdf5f8a45250614a0ba407f7c4f92c2be443eaef43b9bac57285b7828260405161137a929190612b63565b6000546001600160a01b0316331461150a5760405162461bcd60e51b81526004016103f690612cc4565b8160038360405161151b9190612a4b565b9081526020016040518091039020600001908051906020019061153f92919061245b565b50806003836040516115519190612a4b565b908152602001604051809103902060010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060006003836040516115989190612a4b565b908152604051908190036020019020600101805460ff60a01b1916600160a01b8360038111156115d857634e487b7160e01b600052602160045260246000fd5b0217905550826003836040516115ee9190612a4b565b90815260405190819003602001812060020180546001600160a01b03939093166001600160a01b0319909316929092179091557fd0e508fc7340b328ba151c21bda562f7a960abd30cb042c4c5479e590f3e42729061165590849084906000908890612bb8565b60405180910390a1505050565b6000546001600160a01b0316331461168c5760405162461bcd60e51b81526004016103f690612cc4565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146116d85760405162461bcd60e51b81526004016103f690612cc4565b600854604051631c337c4d60e31b81526001600160a01b0380861660048301528592169063e19be2689060240160006040518083038186803b15801561171d57600080fd5b505afa158015611731573d6000803e3d6000fd5b5050505084600081116117775760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016103f6565b6007546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906117ab908b9030908b90600401612aa5565b602060405180830381600087803b1580156117c557600080fd5b505af11580156117d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117fd91906127eb565b6118495760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f756768206d6f6e657920746f2070726f63656564000000000060448201526064016103f6565b600060646118578689612d5f565b6118619190612d3f565b9050600061186f8289612d7e565b6008546040516376b92d4f60e11b81529192506001600160a01b03169063ed725a9e906118a690889084908f908d90600401612b27565b600060405180830381600087803b1580156118c057600080fd5b505af11580156118d4573d6000803e3d6000fd5b505050506118e4858a838a612156565b600854604051635149b5fb60e01b81526001600160a01b03808a1660048301527ffc694e668c8f115e48092216a48c7a3455f624a3f200290bc75395d1be0e2192928d928d928c921690635149b5fb9060240160206040518083038186803b15801561194f57600080fd5b505afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190612987565b6040516119bc94939291906001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b60405180910390a150505050505050505050565b6000546001600160a01b031633146119fa5760405162461bcd60e51b81526004016103f690612cc4565b6001600160a01b038116611a5f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b611a6881611ee3565b50565b6060600080600080600087600389604051611a869190612a4b565b908152604051908190036020018120600101546001600160a01b031690600390611ab1908c90612a4b565b9081526040519081900360200181206001015460ff600160a01b9091041690600390611ade908d90612a4b565b908152604051908190036020018120600201546001600160a01b031690600390611b09908e90612a4b565b9081526040519081900360200181206003908101546001600160a01b031691611b33908f90612a4b565b908152602001604051809103902060040160008d6001600160a01b03166001600160a01b03168152602001908152602001600020549550955095509550955095509295509295509295565b6000546001600160a01b03163314611ba85760405162461bcd60e51b81526004016103f690612cc4565b816000600382604051611bbb9190612a4b565b9081526040519081900360200190206001015460ff600160a01b909104166003811115611bf857634e487b7160e01b600052602160045260246000fd5b14611c155760405162461bcd60e51b81526004016103f690612cf9565b60008211611c5a5760405162461bcd60e51b815260206004820152601260248201527124b73b30b634b2103134b210373ab6b132b960711b60448201526064016103f6565b600383604051611c6a9190612a4b565b90815260200160405180910390206004016000856001600160a01b03166001600160a01b031681526020019081526020016000205482611caa9190612d7e565b6001600160a01b0385166000908152600260205260409020541015611d2b5760405162461bcd60e51b815260206004820152603160248201527f4e6f7420656e6f7567682062616c616e636520746f20617574696f6e2c20706c60448201527065617365206465706f736974206d6f726560781b60648201526084016103f6565b6000600384604051611d3d9190612a4b565b90815260408051602092819003830190206001600160a01b038816600090815260049091019092528120549150611d748285612d7e565b9050600485604051611d869190612a4b565b9081526040805160209281900383019020805460018101825560009182528382200180546001600160a01b0319166001600160a01b038b169081179091558152600290925281208054839290611ddd908490612d7e565b9250508190555080600386604051611df59190612a4b565b90815260200160405180910390206004016000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254611e389190612d27565b925050819055507f41e2d0dce9a9466e8b4adeb52e80e82af04decd3ea7b27cdc27784235af5cb6886600387604051611e719190612a4b565b90815260408051602092819003830181206001600160a01b038c166000908152600490910184528281205460029094529190912054908990600390611eb7908390612a4b565b9081526040519081900360200181206001015461065b95949392916001600160a01b0390911690612ac9565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000600482604051611f459190612a4b565b90815260405190819003602001902054905082156120285760005b81811015612022576000600484604051611f7a9190612a4b565b90815260200160405180910390208281548110611fa757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546040516001600160a01b039091169150600390611fd1908690612a4b565b90815260408051602092819003830190206001600160a01b0384166000908152600490910183528181205460029093529081208054909190612014908490612d27565b909155505050600101611f60565b50612125565b60005b818110156121235760006004846040516120459190612a4b565b9081526020016040518091039020828154811061207257634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546040516001600160a01b03909116915060039061209c908690612a4b565b908152604051908190036020019020600301546001600160a01b0382811691161461211a576003846040516120d19190612a4b565b90815260408051602092819003830190206001600160a01b0384166000908152600490910183528181205460029093529081208054909190612114908490612d27565b90915550505b5060010161202b565b505b7f2229b158ef6d112723af6e7a0e79eed815f0f3748c795eb60525b8bac23697098383604051611655929190612b0c565b6009546040516372886a3760e01b8152600091829182916001600160a01b0316906372886a379061218f908a9088908b90600401612b85565b60c06040518083038186803b1580156121a757600080fd5b505afa1580156121bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121df919061299f565b5050935093509350506000606484876121f89190612d5f565b6122029190612d3f565b9050600060646122128589612d5f565b61221c9190612d3f565b905060008161222b848a612d7e565b6122359190612d7e565b1161229d5760405162461bcd60e51b815260206004820152603260248201527f54686520616d6f756e74206973206e6f7420656e6f75676820666f7220746865604482015271081999594818995a5b99c818da185c99d95960721b60648201526084016103f6565b6000816122aa848a612d7e565b6122b49190612d7e565b60075460405163320220ab60e11b81529192506001600160a01b0316906364044156906122e990309088908890600401612aa5565b602060405180830381600087803b15801561230357600080fd5b505af1158015612317573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233b91906127eb565b5060075460065460405163320220ab60e11b81526001600160a01b0392831692636404415692612375923092909116908790600401612aa5565b602060405180830381600087803b15801561238f57600080fd5b505af11580156123a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123c791906127eb565b5060075460405163320220ab60e11b81526001600160a01b03909116906364044156906123fc9030908d908690600401612aa5565b602060405180830381600087803b15801561241657600080fd5b505af115801561242a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061244e91906127eb565b5050505050505050505050565b82805461246790612dc5565b90600052602060002090601f01602090048101928261248957600085556124cf565b82601f106124a257805160ff19168380011785556124cf565b828001600101855582156124cf579182015b828111156124cf5782518255916020019190600101906124b4565b506124db9291506124df565b5090565b5b808211156124db57600081556001016124e0565b600082601f830112612504578081fd5b813567ffffffffffffffff8082111561251f5761251f612e16565b604051601f8301601f19908116603f0116810190828211818310171561254757612547612e16565b8160405283815286602085880101111561255f578485fd5b8360208701602083013792830160200193909352509392505050565b60006020828403121561258c578081fd5b813561259781612e2c565b9392505050565b600080600080600060a086880312156125b5578081fd5b85356125c081612e2c565b945060208601356125d081612e2c565b935060408601359250606086013567ffffffffffffffff808211156125f3578283fd5b6125ff89838a016124f4565b93506080880135915080821115612614578283fd5b50612621888289016124f4565b9150509295509295909350565b600080600080600060a08688031215612645578081fd5b853561265081612e2c565b9450602086013561266081612e2c565b935060408601359250606086013567ffffffffffffffff811115612682578182fd5b61268e888289016124f4565b925050608086013561269f81612e2c565b809150509295509295909350565b60008060008060008060c087890312156126c5578081fd5b86356126d081612e2c565b955060208701356126e081612e2c565b94506040870135935060608701356126f781612e2c565b92506080870135915060a087013567ffffffffffffffff811115612719578182fd5b61272589828a016124f4565b9150509295509295509295565b600080600060608486031215612746578283fd5b833561275181612e2c565b9250602084013567ffffffffffffffff81111561276c578283fd5b612778868287016124f4565b925050604084013561278981612e2c565b809150509250925092565b6000806000606084860312156127a8578283fd5b83356127b381612e2c565b9250602084013567ffffffffffffffff8111156127ce578283fd5b6127da868287016124f4565b925050604084013590509250925092565b6000602082840312156127fc578081fd5b81518015158114612597578182fd5b60006020828403121561281c578081fd5b813567ffffffffffffffff811115612832578182fd5b61283e848285016124f4565b949350505050565b60008060408385031215612858578182fd5b823567ffffffffffffffff81111561286e578283fd5b61287a858286016124f4565b925050602083013561288b81612e2c565b809150509250929050565b600080604083850312156128a8578182fd5b823567ffffffffffffffff8111156128be578283fd5b6128ca858286016124f4565b92505060208301356004811061288b578182fd5b600080604083850312156128f0578182fd5b823567ffffffffffffffff811115612906578283fd5b612912858286016124f4565b95602094909401359450505050565b600080600060608486031215612935578081fd5b833567ffffffffffffffff81111561294b578182fd5b612957868287016124f4565b93505060208401359150604084013561278981612e2c565b600060208284031215612980578081fd5b5035919050565b600060208284031215612998578081fd5b5051919050565b60008060008060008060c087890312156129b7578384fd5b86519550602087015194506040870151935060608701516129d781612e2c565b608088015160a089015191945092506129ef81612e2c565b809150509295509295509295565b60048110612a1b57634e487b7160e01b600052602160045260246000fd5b9052565b60008151808452612a37816020860160208601612d95565b601f01601f19169290920160200192915050565b60008251612a5d818460208701612d95565b9190910192915050565b600060018060a01b038087168352808616602084015260806040840152612a916080840186612a1f565b915080841660608401525095945050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060018060a01b03808816835286602084015285604084015260a06060840152612af760a0840186612a1f565b91508084166080840152509695505050505050565b821515815260406020820152600061283e6040830184612a1f565b608081526000612b3a6080830187612a1f565b6001600160a01b0395861660208401529385166040830152509216606090920191909152919050565b604081526000612b766040830185612a1f565b905061259760208301846129fd565b606081526000612b986060830186612a1f565b6001600160a01b0394851660208401529290931660409091015292915050565b608081526000612bcb6080830187612a1f565b6001600160a01b038681166020850152909150612beb60408401866129fd565b80841660608401525095945050505050565b60a081526000612c1060a0830188612a1f565b6001600160a01b038781166020850152909150612c3060408401876129fd565b80851660608401528084166080840152509695505050505050565b60c081526000612c5e60c0830189612a1f565b6001600160a01b038881166020850152909150612c7e60408401886129fd565b948516606083015292909316608084015260a0909201919091529392505050565b606081526000612cb26060830186612a1f565b60208301949094525060400152919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260149082015273496e76616c696420617574696f6e20737461746560601b604082015260600190565b60008219821115612d3a57612d3a612e00565b500190565b600082612d5a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612d7957612d79612e00565b500290565b600082821015612d9057612d90612e00565b500390565b60005b83811015612db0578181015183820152602001612d98565b83811115612dbf576000848401525b50505050565b600181811c90821680612dd957607f821691505b60208210811415612dfa57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611a6857600080fdfea26469706673582212208c623720cd24ba815b85de12739110dde8dced3159d091644cefac9c317444f664736f6c6343000804003300000000000000000000000009056a9dd7f50e544701015822e24fd27597247d000000000000000000000000988b2c1a5495c18aedd86c0f98a0699c666803b1000000000000000000000000d1e283f88bc1c2511463c85017c481f574bf8848000000000000000000000000d3f48a6f420904829bb82815a0d78ace694265b5
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000009056a9dd7f50e544701015822e24fd27597247d000000000000000000000000988b2c1a5495c18aedd86c0f98a0699c666803b1000000000000000000000000d1e283f88bc1c2511463c85017c481f574bf8848000000000000000000000000d3f48a6f420904829bb82815a0d78ace694265b5
-----Decoded View---------------
Arg [0] : _tokenStan (address): 0x09056a9dd7f50e544701015822e24fd27597247d
Arg [1] : _stanNFT (address): 0x988b2c1a5495c18aedd86c0f98a0699c666803b1
Arg [2] : _collectionNFT (address): 0xd1e283f88bc1c2511463c85017c481f574bf8848
Arg [3] : _stanWalletAddress (address): 0xd3f48a6f420904829bb82815a0d78ace694265b5
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000009056a9dd7f50e544701015822e24fd27597247d
Arg [1] : 000000000000000000000000988b2c1a5495c18aedd86c0f98a0699c666803b1
Arg [2] : 000000000000000000000000d1e283f88bc1c2511463c85017c481f574bf8848
Arg [3] : 000000000000000000000000d3f48a6f420904829bb82815a0d78ace694265b5
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|