Hi, I want to do add an auction functionality to an nft marketplace. Could someone please help me with the latest links and videos? I already have one auction contract although I dont know if it is the best:
pragma solidity ^0.8.0;
import "../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "../node_modules/@openzeppelin/contracts/utils/Counters.sol";
contract MorarableToken is ERC721 {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor () ERC721("MorarableToken", "MORA"){}
struct Item {
uint256 id;
address creator;
string uri;
}
mapping (uint256 => Item) public Items;
function createItem(string memory uri) public returns (uint256){
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_safeMint(msg.sender, newItemId);
Items[newItemId] = Item(newItemId, msg.sender, uri);
return newItemId;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
return Items[tokenId].uri;
}
}
morarable
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
contract Migrations {
address public owner = msg.sender;
uint public last_completedmigration;
modifier restricted() {
require(
msg.sender == owner,
"This function is restricted to the contract's owner"
);
;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
}
Besides I would like help in order to show a front in an html website of this contract.
Thanks!