Deploy spin-contracts
In future version, these contracts will only needed to be deployed once per chain.
zkSpin provides a series of on-chain smart contracts. They act as a central hub.
Prerequisite
Node.js >= 20.0
Obtain your chain's information
We need two piece of information:
1. RPC node URL
This can be a public node or from node vendor like Alchemy or Infura. For a local hardhat or ganache node, this could be http://localhost:8545
2. Private key of an account with enough gas fee to pay for deployment
Example
Deploy the smart contracts
This guide deploys the contracts via hardhat
Obtain the smart contracts
Go into
spin-contracts
Fill in
.env
with your account private key and node RPC following.env.template
Install hardhat and dependencies
Deploy the contracts
The above command will generate outputs of the contract address deployed like so:
Save the deployed contract addresses somewhere permanente
SpinOPZKGameContract is the contract we'll interact with the most.
Last updated