Hi, thanks for the reply. I decided to start over to see where I went wrong, and I think I found the error in the migration. When I use the command truffle --reset after creating my 2_token_migration file, I get this error:
2_token_migration.js
====================
Error: Migration /Users/devin/Desktop/Productive/contracts/migrations/2_token_migration.js invalid or does not take any parameters
at Migration._load (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:50:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration.run (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:217:1)
at Object.runMigrations (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:258:1)
at Object.run (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:223:1)
at Command.run (/Users/devin/.nvm/versions/node/v16.8.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:172:1)
Truffle v5.4.8 (core: 5.4.8)
Node v16.8.0
devin@Devins-MBP contracts %
Here is the file for my token, ProductiveToken.sol:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "../node_modules/@openzeppelin/contracts/utils/Counters.sol";
contract ProductiveToken is ERC721 {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor () ERC721("ProductiveToken", "PROD"){}
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;
}
}
And here is the file for the migration, 2_token_migration.js:
const ProductiveToken = artifacts.require("ProductiveToken");
module.exports = function (deployer) {
deployer.deploy(ProductiveToken);
};
Really not sure where I went wrong or whether I am missing something.