added return statement
This commit is contained in:
parent
a872fe50f6
commit
e5b64ef8e6
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"_format": "hh-sol-dbg-1",
|
"_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
|
|
@ -2,8 +2,8 @@
|
||||||
"_format": "hh-sol-cache-2",
|
"_format": "hh-sol-cache-2",
|
||||||
"files": {
|
"files": {
|
||||||
"/Users/migue/Documents/psychedelic/sites_nfts/contracts/SitesNFTs.sol": {
|
"/Users/migue/Documents/psychedelic/sites_nfts/contracts/SitesNFTs.sol": {
|
||||||
"lastModificationDate": 1665508068244,
|
"lastModificationDate": 1665514025103,
|
||||||
"contentHash": "e72dc1748efc4646c33553ef83e2462d",
|
"contentHash": "28e17cde1dc2d621c69ac3d29df60e12",
|
||||||
"sourceName": "contracts/SitesNFTs.sol",
|
"sourceName": "contracts/SitesNFTs.sol",
|
||||||
"solcConfig": {
|
"solcConfig": {
|
||||||
"version": "0.8.7",
|
"version": "0.8.7",
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
|
||||||
constructor(string memory name, string memory symbol) ERC721(name, symbol) {
|
constructor(string memory name, string memory symbol) ERC721(name, symbol) {
|
||||||
baseURI = "data:application/json;base64,";
|
baseURI = "data:application/json;base64,";
|
||||||
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
||||||
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Token uri is the Base64 encoded json metadata
|
// Token uri is the Base64 encoded json metadata
|
||||||
|
|
@ -40,4 +41,8 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
|
||||||
function getCurrentTokenId() public view returns (uint256) {
|
function getCurrentTokenId() public view returns (uint256) {
|
||||||
return _tokenIds.current();
|
return _tokenIds.current();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
receive() external payable {}
|
||||||
|
|
||||||
|
fallback() external {}
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,7 @@ const { expect } = require("chai");
|
||||||
|
|
||||||
describe("SitesNFTs contract", function () {
|
describe("SitesNFTs contract", function () {
|
||||||
describe("Deployment", () => {
|
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 [owner] = await ethers.getSigners();
|
||||||
|
|
||||||
const name = "Sites NFTs";
|
const name = "Sites NFTs";
|
||||||
|
|
@ -19,7 +19,7 @@ describe("SitesNFTs contract", function () {
|
||||||
expect(contractSymbol).to.equal(symbol);
|
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 [owner] = await ethers.getSigners();
|
||||||
|
|
||||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||||
|
|
@ -33,7 +33,7 @@ describe("SitesNFTs contract", function () {
|
||||||
expect(hasAdminRole).to.equal(true);
|
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 [owner] = await ethers.getSigners();
|
||||||
|
|
||||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||||
|
|
@ -47,7 +47,7 @@ describe("SitesNFTs contract", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Access control", () => {
|
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 [owner, address1] = await ethers.getSigners();
|
||||||
|
|
||||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||||
|
|
@ -63,7 +63,7 @@ describe("SitesNFTs contract", function () {
|
||||||
expect(hasMinterRole).to.equal(true);
|
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 [owner, address1] = await ethers.getSigners();
|
||||||
|
|
||||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||||
|
|
@ -79,7 +79,7 @@ describe("SitesNFTs contract", function () {
|
||||||
expect(hasAdminRole).to.equal(true);
|
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 [owner, address1, address2] = await ethers.getSigners();
|
||||||
|
|
||||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||||
|
|
@ -99,7 +99,7 @@ describe("SitesNFTs contract", function () {
|
||||||
expect(hasAdminRole).to.equal(false);
|
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 [owner, address1, address2] = await ethers.getSigners();
|
||||||
|
|
||||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue