CryptoKitties AMB bridge extension Demo
A demonstration of Arbitrary Message Bridging using CryptoKitties
An AMB bridge extension is a pair of mediator contracts associated with a specific pair of Arbitrary Message Bridge contracts.
The CryptoKitties bridge extension allows users to transfer a NFT representing a cat from one chain to another. It demonstrates the ability to perform operations with NFTs through the Arbitrary Message Bridge (AMB), which is part of the TokenBridge project.
In the demos, we deploy contracts and then transfer an NFT between 2 testnets, Sokol and Kovan.
- Deployed on Sokol:
- A mediator contract (HomeMediator). Sokol is called the home bridge. Only the mediator contract communicating with the AMB is allowed to mint a cat.
It is possible to deploy the contracts in the opposite direction as well (where KittyCore & ForeignMediator are deployed on Sokol & SimpleBridgeKitty & HomeMediator on Kovan). For demo purposes, we arbitrarily chose Kovan as the foreign network.
A test cat deployed on Kovan
In the following example we deploy contracts enable test CryptoKitty creation. If you choose to deploy your own contracts, you can also create additional test cats using this instruction.
- KittyCore: ERC721 Token Contract for CryptoKitties (approximate replica of original CryptoKitty contract). Includes all functions that create a Kitty with unique attributes including ID, ownership, and metadata.
- SimpleBridgeKitty: Contract that creates a cat with identical attributes (id, ownership, & metadata) to the cat locked in the Kovan mediator contract. Cats can only be minted through a request from the Sokol mediator contract.