Giter Club home page Giter Club logo

2024-03-kitty-connect's Introduction

First Flight #12: Kitty Connect

Contest Details

Prize Pool

  • High - 100xp

  • Medium - 20xp

  • Low - 2xp

  • Starts: March 28, 2024 Noon UTC

  • Ends: April 04, 2024 Noon UTC

Stats

  • nSLOC: 235
  • Complexity Score: 193

About the Project

This project allows users to buy a cute cat from our branches and mint NFT for buying a cat. The NFT will be used to track the cat info and all related data for a particular cat corresponding to their token ids. Kitty Owner can also Bridge their NFT from one chain to another chain via Chainlink CCIP.

The codebase is broken up into 2 contracts (In Scope):

  • KittyConnect.sol
  • KittyBridge.sol

KittyConnect

This contract allows users to buy a cute cat from our branches and mint NFT for buying a cat. The NFT will be used to track the cat info and all related data for a particular cat corresponding to their token ids.

KittyBridge

This contract allows users to bridge their Kitty NFT from one chain to another chain via Chainlink CCIP.

How this Project Works

Buying a Cat

A user is required to visit our shop partner to buy a cat. The shop partner will call the function from KittyConnect contract to mint NFT for buying a cat. (This NFT will track all the data related to the cat)

Bridge Kitty NFT from one chain to another chain

User can bridge Kitty NFT from one chain to another chain by calling this function from KittyConnect contract. This involves burning of the kitty NFT on the source chain and minting on the destination chain. Bridging is powered by chainlink CCIP.

Transferring Ownership of cat to new owner

Sometimes a user wants to transfer their cat to a new owner, this can be easily done by transferring the Kitty NFT to that desired owner. A user is first required to approve the kitty NFT to the new owner, and is then required to visit our shop partner to finally facilitate transfer the ownership of the cat to the new owner.

Roles in the Project:

  1. Cat Owner
    • User who buy the cat from our branches and mint NFT for buying a cat.
  2. Shop Partner
    • Shop partner provide services to the cat owner to buy cat.
  3. KittyConnect Owner
    • Owner of the contract who can transfer the ownership of the contract to another address.

Getting Started

Requirements

  • git
    • You'll know you did it right if you can run git --version and you see a response like git version x.x.x
  • foundry
    • You'll know you did it right if you can run forge --version and you see a response like forge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)

Quickstart

git clone https://github.com/Cyfrin/2024-03-kitty-connect
cd 2024-03-kitty-connect

Install Dependencies

make

or

forge build

Testing

forge test

Test Coverage

forge coverage

Compiling

forge compile

Audit Scope Details

  • In Scope:
├── src
│   ├── KittyConnect.sol
│   ├── KittyBridge.sol
│   ├── base
│      ├── KittyBridgeBase.sol

Known Issues

  • there is one known bug while bridging the NFT to other chain, the previousOwners of the cat are not passed because they may cost a large amount of gas.

2024-03-kitty-connect's People

Contributors

equious avatar

Stargazers

 avatar Didier A. E. Gabiam avatar

Watchers

 avatar

2024-03-kitty-connect's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.