Skip to content

Fix: Restrict switchURI() to owner in ERC-721 example #2240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/base-docs/docs/pages/learn/erc-721-token/erc-721-sbs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ Start by opening the [OpenZeppelin] ERC-721 in Github. Copy the link and use it
pragma solidity ^0.8.17;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";

contract MyERC721Token is ERC721 {
contract MyERC721Token is ERC721, Ownable {
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {

}
Expand Down Expand Up @@ -199,8 +200,7 @@ function _baseURI() internal override view returns(string memory) {
}
}

function switchURI() public {
// TODO: Limit to contract owner
function switchURI() public onlyOwner {
nftMetadata = nftMetadata == NFTMetadata.BAYC ? NFTMetadata.DOODLES : NFTMetadata.BAYC;
}
```
Expand Down