-
Notifications
You must be signed in to change notification settings - Fork 1
Smart‐Contract
IosifKoen edited this page Dec 17, 2023
·
3 revisions
In this page we will explain the ItemBlocks
smart-contract. Give a brief review of smart-contract structure and lead the reader to smart-smart contract for function documentation.
The ItemBlocks
smart contract contains nine functions.
safeMint
createPassport
updatePassport
isEligible
setCreator
updateOwnership
getUserHistory
getCreatedItemTokens
getPassport
It contains four variables.
One structure that represents the item passport.
struct Passport {
string name;
string desc;
string family;
string url;
string img;
}
and three hash-maps.
mapping (uint256 => Passport) public itemPassports;
mapping (uint256 => address[]) public allItemOwners;
mapping (address => uint256[]) public createdItems;
The contract contains an import section where the authors imported the openzeppelin
module.
import "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
import "openzeppelin-contracts/contracts/access/Ownable.sol";
Authors have wrote documentation for each function of the smart-contract. The authors provides a NatSpec (Natural Language Specification) way of comments for each of the functions. You can read the documentation for the functions in the smart-contract here.