Deploy CryptoKitty Contracts
You must be the contract owner in order to create a CryptoKitty
To create your own CryptoKitties to send across the bridge, you need to deploy your own set of contracts. Only the contract owner can create new cats. You can also create a group of cats during the deployment process using an env variable.
In this example, we will deploy contracts to the Kovan & Sokol testnets. You will need a small amount of test currency in your wallet for both testnets in order to deploy the contracts.
Kovan Faucet (Github account required. If prefered, you can get KETH through the gitter channel)
If you would like to try to the bridge feature without creating your own cat, please contact us on Discord or the TokenBridge forum with your wallet address, and we will send you a test cat to play with 😻. With a test cat, you can proceed from NiftyWallet Transfer or MEW transfer.
We use Nifty Wallet for the demonstration. Similar functionality can be achieved with MetaMask. Note that Nifty Wallet & MetaMask cannot be active extensions at the same time.
1) Clone Repository
Prerequisites
yarn v 1.19.1 (brew install yarn)
Node versions either: ^8.10.0 || ^10.13.0 ||| >=11.10.1
2) Install Dependencies
3) Compile Contracts
4) Create a .env file in the root directory
5) Paste/Change example parameters
Copy the following into the .env file, change parameters as needed and save.
Parameters to change based on your address information are noted with a <>. Notes and explanations are below the example file.
Parameter Notes:
DEPLOYMENT_ACCOUNT_PRIVATE_KEY=<Your Private Wallet Key>: This is the key associated with the account deploying the contracts. This wallet must have both test Ether and test POA. To retrieve a private key from Nifty Wallet:
Go to the deployment account and click the dots next to the account name. Select Export Private Key.
Enter in your Nifty Wallet password:
Copy your private key.
HOME_AMB_BRIDGE=0xFe446bEF1DbF7AFE24E81e05BC8B271C1BA9a560: This is the address for the currently deployed AMB bridge on the Sokol network. If you deploy elsewhere, use your deployed address address.
HOME_MEDIATOR_OWNER=<YOUR WALLET OWNER ADDRESS>: You should have access to this wallet address so you can create a cat later if needed. The following <YOUR WALLET OWNER ADDRESS> parameters can use the same address for the purposes of this tutorial. For more information, see TokenBridge roles.
FOREIGN_AMB_BRIDGE=0xFe446bEF1DbF7AFE24E81e05BC8B271C1BA9a560: This is the address for the currently deployed AMB bridge on the Kovan network. If you deploy elsewhere, use your deployed address.
KITTIES_AMOUNT=15: This is the number of kitties minted by the contract, select any number here. You can send these to other addresses or bridge yourself.
6) Deploy Contracts
On successful deployment, you will receive confirmation of the contract addresses: For example:
In our example, Sokol is the Home network, and Kovan is the Foreign Network. This means CryptoKitties are deployed on Kovan, and can be transferred to Sokol following the next instructions. Once they are bridged to Sokol, they can be bridged back to Kovan as well.
See View Kitties in BlockScout to view the kitties you have created.
Last updated