Skip to content

victorjambo/tokenkid-contract

Repository files navigation

TokenKid Contract

TokenKid is simple an NFT Marketplace built on Celo

This project hasn't been reviewed\Audited by other engineers. I might have missed some errors. 😀

Built on Truffle and Ganache

Deployed via Remix

To do Improvements before deploy to mainnet

  1. Line by line review of the contract
  2. Security Audit
  3. Write tests
  4. Make TokenKidFactory an upgradable smart contract.
    • This will separate logic and data.
    • Resource

Deployments

  1. Web3 App
  2. Smart Contract
  3. Subgraph Hosted-service

Repos & Docs

  1. Web3 App
  2. Subgraph

TokenKidFactory

Factory to create/mint ERC721 Tokens

constructor(address owner) (public)

Used to initialize the TokenKidFactory contract.

onlyExisting(uint256 _tokenId) (internal)

Modifier to check if TokenId exists

onlyOwner(uint256 _tokenId) (internal)

Modifier to check if Token is owned by msg.sender

onlyTokenOrContractOwner (internal)

Modifier to check if msg.sender is owner of token or smart contract owner

safeMint(string _tokenName, uint256 _price, string _tokenURI) (public)

Used to create/mint a token.

buyToken(uint256 _tokenId, address token) (public)

Transfer ownership of ERC721 token and Transfer ERC20 tokens to owner. This a payable function, remember to send price in msg.value.

getMintedToken(uint256 _tokenId) (public)

Get a Minted Token given the _tokenId

changeTokenPrice(uint256 _tokenId, uint256 _price) (public)

Update NFT Price

toggleOnSale(uint256 _tokenId) (public)

Update NFT On sale Availability

burnToken(uint256 _tokenId) (public)

Delete NFT Token