Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ink! smart-contract #2

Merged
merged 17 commits into from
Nov 10, 2022
Merged

Add ink! smart-contract #2

merged 17 commits into from
Nov 10, 2022

Conversation

realnimish
Copy link
Collaborator

The given implementation follows single-contract model which can be made ERC1155 compliant or ERC721 compliant (if complex tokenId allowed or we encode the complex key to u128) in the future.

Multi-contract model was avoided primarily because of the lack of event support in the cross-call contract environment (use-ink/ink#1000); otherwise a much simpler/elegant ERC721 impl could have been followed.

Additional notes

Path to ERC1155 compliance

  • Each canvas is a token with supply equivalent to the number of cells in the grid.
  • Non-dynamic NFTs (+ownership of individual cell shouldn't exist) are better represented by this.

Path to ERC721 compliance

  • (CanvasId, X-cord, Y-cord) represents an unique token
  • Better suited for [non-]dynamic NFTs where ownership of individual cell exists

Dynamic NFT implies that the owner of a cell in a canvas can change its color even after the minting and the whole collective canvas is effected by it

Methods implemented so far:
- new
- update_creation_fees
- create_canvas
- edit_canvas
- capture_cell
- change_cell_color
- change_multiple_cells_color
- get_game_details
- get_canvas_details
- get_grid_details
- get_cell_details
- get_user_created_canvas_ids
- get_user_participated_canvas_ids
- collect_fees
- mint_canvas
- get_canvas_stats
- get_user_cash_flow
- get_user_nfts
- get_owned_nft_count
- Improved Error messages
- Added checks to prevent user from creating non-functional canvas
- Disallowed owner to recapture their own tokens
- add_sudo
- remove_sudo
- has_sudo_powers
- capture_multiple_cells
- Introduced commission charges on cell capture
- Added get_canvases_by_popularity()
@vercel
Copy link

vercel bot commented Nov 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
gencom-nft ✅ Ready (Inspect) Visit Preview Nov 10, 2022 at 10:46AM (UTC)
gencom-nft-3qcv ✅ Ready (Inspect) Visit Preview Nov 10, 2022 at 10:46AM (UTC)

@hyp3r5pace
Copy link
Collaborator

Nice work!!

Copy link
Owner

@SayanKar SayanKar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@realnimish realnimish merged commit 5bac157 into main Nov 10, 2022
@realnimish realnimish deleted the smart-contract branch November 10, 2022 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants