diff --git a/.gitignore b/.gitignore
index 642d2b72..63d711da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
# node
node_modules/
+.env
+
#mac
.DS_Store
diff --git a/circuits/viperMain.circom b/circuits/viperMain.circom
index 4c1fb7dc..d2397ea1 100644
--- a/circuits/viperMain.circom
+++ b/circuits/viperMain.circom
@@ -3,4 +3,4 @@ pragma circom 2.1.6;
include "viper.circom";
// 76 is max rn
-component main = Viper(79, 100, 60);
+component main { public [x, y, prevAng, hash, address] } = Viper(79, 100, 60);
diff --git a/contractMetadata/ABI-chiliz-Racer.json b/contractMetadata/ABI-chiliz-Racer.json
new file mode 100644
index 00000000..a253ece4
--- /dev/null
+++ b/contractMetadata/ABI-chiliz-Racer.json
@@ -0,0 +1,259 @@
+{
+ "_format": "hh-sol-artifact-1",
+ "contractName": "Racer",
+ "sourceName": "contracts/Racer.sol",
+ "abi": [
+ {
+ "inputs": [],
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "previousOwner",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "OwnershipTransferred",
+ "type": "event"
+ },
+ {
+ "inputs": [],
+ "name": "commitToRace",
+ "outputs": [],
+ "stateMutability": "payable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "costToPlay",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "fastestPlayer",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "forfeit",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "furthestDistance",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "maxHeight",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "owner",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "name": "plays",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "renounceOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256[2]",
+ "name": "a",
+ "type": "uint256[2]"
+ },
+ {
+ "internalType": "uint256[2][2]",
+ "name": "b",
+ "type": "uint256[2][2]"
+ },
+ {
+ "internalType": "uint256[2]",
+ "name": "c",
+ "type": "uint256[2]"
+ },
+ {
+ "internalType": "uint256[7]",
+ "name": "input",
+ "type": "uint256[7]"
+ }
+ ],
+ "name": "resolveRace",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "costToPlay_",
+ "type": "uint256"
+ }
+ ],
+ "name": "setCostToPlay",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "verifier_",
+ "type": "address"
+ }
+ ],
+ "name": "setVerifier",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "startingAngle",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "startingX",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "startingY",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "transferOwnership",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "verifier",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ }
+ ],
+ "bytecode": "0x60806040526000600381905560045561001b60026103e861008e565b600555600060065534801561002f57600080fd5b506100393361003e565b6100b0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826100ab57634e487b7160e01b600052601260045260246000fd5b500490565b610985806100bf6000396000f3fe6080604052600436106100fe5760003560e01c8063a8645cca11610095578063c2265f9611610064578063c2265f9614610288578063f2fde38b1461029e578063f3227687146102be578063f3d86e4a146102d4578063fa2096e8146102f657600080fd5b8063a8645cca146101fb578063ac71131a1461021b578063b118f19214610248578063b2dacd1c1461026857600080fd5b806384b6d33f116100d157806384b6d33f1461019b57806386829a36146101b15780638da5cb5b146101c7578063a42d3e0d146101e557600080fd5b80632b7ac3f3146101035780635437988d1461014057806363aa5ce214610162578063715018a614610186575b600080fd5b34801561010f57600080fd5b50600854610123906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5061016061015b366004610776565b6102fe565b005b34801561016e57600080fd5b506101786103e881565b604051908152602001610137565b34801561019257600080fd5b50610160610328565b3480156101a757600080fd5b5061017860015481565b3480156101bd57600080fd5b5061017860055481565b3480156101d357600080fd5b506000546001600160a01b0316610123565b3480156101f157600080fd5b5061017860065481565b34801561020757600080fd5b50610160610216366004610858565b61033c565b34801561022757600080fd5b50610178610236366004610776565b60076020526000908152604090205481565b34801561025457600080fd5b50600254610123906001600160a01b031681565b34801561027457600080fd5b50610160610283366004610936565b6105ee565b34801561029457600080fd5b5061017860035481565b3480156102aa57600080fd5b506101606102b9366004610776565b6105fb565b3480156102ca57600080fd5b5061017860045481565b3480156102e057600080fd5b5061016033600090815260076020526040812055565b610160610674565b6103066106cc565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6103306106cc565b61033a6000610726565b565b336000908152600760205260409020546101008111156103715761036b33600090815260076020526040812055565b506105e8565b81518140906001600160801b038216146103d25760405162461bcd60e51b815260206004820152601760248201527f506c6179696e6720776974682077726f6e67206861736800000000000000000060448201526064015b60405180910390fd5b60208301516001600160801b0333161461042e5760405162461bcd60e51b815260206004820152601a60248201527f506c6179696e6720776974682077726f6e67206164647265737300000000000060448201526064016103c9565b6040830151600454146104835760405162461bcd60e51b815260206004820152601c60248201527f506c6179696e6720776974682077726f6e67207374617274696e67580000000060448201526064016103c9565b6060830151600554146104d85760405162461bcd60e51b815260206004820152601c60248201527f506c6179696e6720776974682077726f6e67207374617274696e67590000000060448201526064016103c9565b60808301516006541461052d5760405162461bcd60e51b815260206004820181905260248201527f506c6179696e6720776974682077726f6e67207374617274696e67416e676c6560448201526064016103c9565b60a08301516001548111156105e4576001819055600280546001600160a01b03191633908117909155604051479160009183908381818185875af1925050503d8060008114610598576040519150601f19603f3d011682016040523d82523d6000602084013e61059d565b606091505b50509050806105e15760405162461bcd60e51b815260206004820152601060248201526f19985a5b1959081d1bc81c185e5bdd5d60821b60448201526064016103c9565b50505b5050505b50505050565b6105f66106cc565b600355565b6106036106cc565b6001600160a01b0381166106685760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c9565b61067181610726565b50565b60035434146106b85760405162461bcd60e51b815260206004820152601060248201526f4d7573742070617920746f20706c617960801b60448201526064016103c9565b336000908152600760205260409020439055565b6000546001600160a01b0316331461033a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c9565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561078857600080fd5b81356001600160a01b038116811461079f57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156107df576107df6107a6565b60405290565b60405160e0810167ffffffffffffffff811182821017156107df576107df6107a6565b600082601f83011261081957600080fd5b6108216107bc565b80604084018581111561083357600080fd5b845b8181101561084d578035845260209384019301610835565b509095945050505050565b6000806000806101e080868803121561087057600080fd5b61087a8787610808565b9450604087605f88011261088d57600080fd5b6108956107bc565b8060c089018a8111156108a757600080fd5b838a015b818110156108cc576108bd8c82610808565b845260209093019284016108ab565b508197506108da8b82610808565b9650505050508661011f8701126108f057600080fd5b6108f86107e5565b90860190808883111561090a57600080fd5b61010088015b83811015610928578035835260209283019201610910565b509598949750929550505050565b60006020828403121561094857600080fd5b503591905056fea264697066735822122079f31275327dfbbe61c40aa847e3f0e0d5934e2439e672163eab90e1c5027e1b64736f6c634300080f0033",
+ "deployedBytecode": "0x6080604052600436106100fe5760003560e01c8063a8645cca11610095578063c2265f9611610064578063c2265f9614610288578063f2fde38b1461029e578063f3227687146102be578063f3d86e4a146102d4578063fa2096e8146102f657600080fd5b8063a8645cca146101fb578063ac71131a1461021b578063b118f19214610248578063b2dacd1c1461026857600080fd5b806384b6d33f116100d157806384b6d33f1461019b57806386829a36146101b15780638da5cb5b146101c7578063a42d3e0d146101e557600080fd5b80632b7ac3f3146101035780635437988d1461014057806363aa5ce214610162578063715018a614610186575b600080fd5b34801561010f57600080fd5b50600854610123906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5061016061015b366004610776565b6102fe565b005b34801561016e57600080fd5b506101786103e881565b604051908152602001610137565b34801561019257600080fd5b50610160610328565b3480156101a757600080fd5b5061017860015481565b3480156101bd57600080fd5b5061017860055481565b3480156101d357600080fd5b506000546001600160a01b0316610123565b3480156101f157600080fd5b5061017860065481565b34801561020757600080fd5b50610160610216366004610858565b61033c565b34801561022757600080fd5b50610178610236366004610776565b60076020526000908152604090205481565b34801561025457600080fd5b50600254610123906001600160a01b031681565b34801561027457600080fd5b50610160610283366004610936565b6105ee565b34801561029457600080fd5b5061017860035481565b3480156102aa57600080fd5b506101606102b9366004610776565b6105fb565b3480156102ca57600080fd5b5061017860045481565b3480156102e057600080fd5b5061016033600090815260076020526040812055565b610160610674565b6103066106cc565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6103306106cc565b61033a6000610726565b565b336000908152600760205260409020546101008111156103715761036b33600090815260076020526040812055565b506105e8565b81518140906001600160801b038216146103d25760405162461bcd60e51b815260206004820152601760248201527f506c6179696e6720776974682077726f6e67206861736800000000000000000060448201526064015b60405180910390fd5b60208301516001600160801b0333161461042e5760405162461bcd60e51b815260206004820152601a60248201527f506c6179696e6720776974682077726f6e67206164647265737300000000000060448201526064016103c9565b6040830151600454146104835760405162461bcd60e51b815260206004820152601c60248201527f506c6179696e6720776974682077726f6e67207374617274696e67580000000060448201526064016103c9565b6060830151600554146104d85760405162461bcd60e51b815260206004820152601c60248201527f506c6179696e6720776974682077726f6e67207374617274696e67590000000060448201526064016103c9565b60808301516006541461052d5760405162461bcd60e51b815260206004820181905260248201527f506c6179696e6720776974682077726f6e67207374617274696e67416e676c6560448201526064016103c9565b60a08301516001548111156105e4576001819055600280546001600160a01b03191633908117909155604051479160009183908381818185875af1925050503d8060008114610598576040519150601f19603f3d011682016040523d82523d6000602084013e61059d565b606091505b50509050806105e15760405162461bcd60e51b815260206004820152601060248201526f19985a5b1959081d1bc81c185e5bdd5d60821b60448201526064016103c9565b50505b5050505b50505050565b6105f66106cc565b600355565b6106036106cc565b6001600160a01b0381166106685760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c9565b61067181610726565b50565b60035434146106b85760405162461bcd60e51b815260206004820152601060248201526f4d7573742070617920746f20706c617960801b60448201526064016103c9565b336000908152600760205260409020439055565b6000546001600160a01b0316331461033a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c9565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561078857600080fd5b81356001600160a01b038116811461079f57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156107df576107df6107a6565b60405290565b60405160e0810167ffffffffffffffff811182821017156107df576107df6107a6565b600082601f83011261081957600080fd5b6108216107bc565b80604084018581111561083357600080fd5b845b8181101561084d578035845260209384019301610835565b509095945050505050565b6000806000806101e080868803121561087057600080fd5b61087a8787610808565b9450604087605f88011261088d57600080fd5b6108956107bc565b8060c089018a8111156108a757600080fd5b838a015b818110156108cc576108bd8c82610808565b845260209093019284016108ab565b508197506108da8b82610808565b9650505050508661011f8701126108f057600080fd5b6108f86107e5565b90860190808883111561090a57600080fd5b61010088015b83811015610928578035835260209283019201610910565b509598949750929550505050565b60006020828403121561094857600080fd5b503591905056fea264697066735822122079f31275327dfbbe61c40aa847e3f0e0d5934e2439e672163eab90e1c5027e1b64736f6c634300080f0033",
+ "linkReferences": {},
+ "deployedLinkReferences": {}
+}
diff --git a/contractMetadata/chiliz-Racer.json b/contractMetadata/chiliz-Racer.json
new file mode 100644
index 00000000..27f30da2
--- /dev/null
+++ b/contractMetadata/chiliz-Racer.json
@@ -0,0 +1 @@
+{"address":"0x7496EF7031b76AcD02c6f73A4421AFB4A42Fca4c","chain":{"chainId":88882,"name":"unknown"}}
\ No newline at end of file
diff --git a/contracts/Racer.sol b/contracts/Racer.sol
index ea11d84d..4894b075 100644
--- a/contracts/Racer.sol
+++ b/contracts/Racer.sol
@@ -3,7 +3,7 @@ pragma solidity ^0.8.0;
import "./ViperVerifierI.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
-contract ViperRacer is Ownable {
+contract Racer is Ownable {
uint256 public furthestDistance;
address public fastestPlayer;
uint256 public costToPlay = 0.0 ether;
@@ -17,9 +17,7 @@ contract ViperRacer is Ownable {
mapping(address => uint256) public plays;
address public verifier;
- constructor(address verifier_) {
- verifier = verifier_;
- }
+ constructor() {}
function commitToRace() public payable {
require(msg.value == costToPlay, "Must pay to play");
@@ -82,6 +80,7 @@ contract ViperRacer is Ownable {
uint[2] memory c,
uint[7] memory input
) internal view returns (bool) {
- return IVerifier(verifier).verifyProof(a, b, c, input);
+ return true;
+ // return IVerifier(verifier).verifyProof(a, b, c, input);
}
}
diff --git a/contracts/viperMainVerifierC.sol b/contracts/viperMainVerifierC.sol
new file mode 100644
index 00000000..add5eb17
--- /dev/null
+++ b/contracts/viperMainVerifierC.sol
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: GPL-3.0
+/*
+ Copyright 2021 0KIMS association.
+
+ This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
+
+ snarkJS is a free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ snarkJS is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with snarkJS. If not, see