added return statement

This commit is contained in:
miguelToscano 2022-10-11 16:02:35 -03:00
parent a872fe50f6
commit e5b64ef8e6
6 changed files with 26 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/0593067611bf3df2fd92fc9e7ccdc02c.json"
"buildInfo": "../../build-info/b939a90cc764b581362b954e5d4c1a71.json"
}

File diff suppressed because one or more lines are too long

View File

@ -2,8 +2,8 @@
"_format": "hh-sol-cache-2",
"files": {
"/Users/migue/Documents/psychedelic/sites_nfts/contracts/SitesNFTs.sol": {
"lastModificationDate": 1665508068244,
"contentHash": "e72dc1748efc4646c33553ef83e2462d",
"lastModificationDate": 1665514025103,
"contentHash": "28e17cde1dc2d621c69ac3d29df60e12",
"sourceName": "contracts/SitesNFTs.sol",
"solcConfig": {
"version": "0.8.7",

View File

@ -17,6 +17,7 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
constructor(string memory name, string memory symbol) ERC721(name, symbol) {
baseURI = "data:application/json;base64,";
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_;
}
// Token uri is the Base64 encoded json metadata
@ -40,4 +41,8 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
function getCurrentTokenId() public view returns (uint256) {
return _tokenIds.current();
}
receive() external payable {}
fallback() external {}
}

View File

@ -2,7 +2,7 @@ const { expect } = require("chai");
describe("SitesNFTs contract", function () {
describe("Deployment", () => {
it("Deployment should assign the name and the symbol of the ERC721 contract", async function () {
it("Deployment should assign the name and the symbol of the ERC721 contract", async () => {
const [owner] = await ethers.getSigners();
const name = "Sites NFTs";
@ -19,7 +19,7 @@ describe("SitesNFTs contract", function () {
expect(contractSymbol).to.equal(symbol);
});
it("Deployment should assign the deployer DEFAULT_ADMIN_ROLE", async function () {
it("Deployment should assign the deployer DEFAULT_ADMIN_ROLE", async () => {
const [owner] = await ethers.getSigners();
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
@ -33,7 +33,7 @@ describe("SitesNFTs contract", function () {
expect(hasAdminRole).to.equal(true);
});
it("Deployment should assign initial tokenId to 0", async function () {
it("Deployment should assign initial tokenId to 0", async () => {
const [owner] = await ethers.getSigners();
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
@ -47,7 +47,7 @@ describe("SitesNFTs contract", function () {
});
describe("Access control", () => {
it("User with DEFAULT_ADMIN_ROLE should be able to assign MINTER_ROLE to another user", async function () {
it("User with DEFAULT_ADMIN_ROLE should be able to assign MINTER_ROLE to another user", async () => {
const [owner, address1] = await ethers.getSigners();
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
@ -63,7 +63,7 @@ describe("SitesNFTs contract", function () {
expect(hasMinterRole).to.equal(true);
});
it("User with DEFAULT_ADMIN_ROLE should be able to assign DEFAULT_ADMIN_ROLE to another user", async function () {
it("User with DEFAULT_ADMIN_ROLE should be able to assign DEFAULT_ADMIN_ROLE to another user", async () => {
const [owner, address1] = await ethers.getSigners();
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
@ -79,7 +79,7 @@ describe("SitesNFTs contract", function () {
expect(hasAdminRole).to.equal(true);
});
it("User without DEFAULT_ADMIN_ROLE shouldnt be able to assign DEFAULT_ADMIN_ROLE to another user", async function () {
it("User without DEFAULT_ADMIN_ROLE shouldnt be able to assign DEFAULT_ADMIN_ROLE to another user", async () => {
const [owner, address1, address2] = await ethers.getSigners();
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
@ -99,7 +99,7 @@ describe("SitesNFTs contract", function () {
expect(hasAdminRole).to.equal(false);
});
it("User without DEFAULT_ADMIN_ROLE shouldnt be able to assign MINTER_ROLE to another user", async function () {
it("User without DEFAULT_ADMIN_ROLE shouldnt be able to assign MINTER_ROLE to another user", async () => {
const [owner, address1, address2] = await ethers.getSigners();
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");