Skip to content

Commit

Permalink
Improvement: Set initialzable for MarketV2
Browse files Browse the repository at this point in the history
  • Loading branch information
imsoso committed Nov 7, 2024
1 parent 92e0fc4 commit 1d6bae6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions solidity-scripting/src/W4D4/NFTMarketV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/*
➤ 签名 NFT 上架信息
➤ 使⽤离线签名和验证存储NFT上架, 展⽰最新的 NFT 上架清单
➤ 完善 NFTMarket合约,使⽤ETH买⼊NFT
➤ Option:在TheGraph中记录NFT记录,并在⽹页中展⽰NFT交易动态
*/

contract NFTMarketV2 is Ownable(msg.sender), EIP712("OpenSpaceNFTMarket", "1") {
contract NFTMarketV2 is
Ownable(msg.sender),
EIP712("OpenSpaceNFTMarket", "1"),
Initializable
{
address public constant ETH_FLAG =
address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
uint256 public constant feeBP = 30; // 30/10000 = 0.3%
Expand All @@ -34,6 +38,18 @@ contract NFTMarketV2 is Ownable(msg.sender), EIP712("OpenSpaceNFTMarket", "1") {
uint256 deadline;
}

// State variables
address public implAddress; // Implementation address for clone

function initialize(address owner_) public initializer {
_transferOwnership(owner_);
}

//only owner can set implAddress
function setImplAddress(address _implAddress) public onlyOwner {
implAddress = _implAddress;
}

function listing(
address nft,
uint256 tokenId
Expand Down

0 comments on commit 1d6bae6

Please sign in to comment.