GithubHelp home page GithubHelp logo

marekyggdrasil / mac Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 3.79 MB

A zkApp that makes zkApps!

Home Page: https://mac.sqrtxx.com/

License: Apache License 2.0

JavaScript 1.36% Shell 0.13% TypeScript 97.48% CSS 1.03%
mina smart-contract zero-knowledge zkapp

mac's Introduction

MAC!

I am MAC!, or Mina Arbitrated Contracts if you want to be formal. I am an zkApp that makes zkApps (yes, really!).

The best part is you do not even need to know how to code! Go visit https://mac.sqrtxx.com/ to read more about me and try me!

Setup

Install the dependencies for the smart contract, from the root of this repo run

cd contracts

then install the dependencies

npm install

and build it

npm run build

generate the cache

npx tsx scripts/gencompilecache.ts

( re-run it few times to see how the compile time improves with the cache )

and copy the cache to speed-up the compilation in the UI

cd ../
sh copy_cache_ui.sh

now to prepare the UI of the MAC! app, from same directory run

cd ui

to change the UI directory, now install the dependencies

npm install

and run the app locally

npm run dev

Running the build

cd ui/
npm run build
npm run export

Testing the network

If you notice problems connecting to the network via the frontend you can double check possibility to connect via command line as follows

npx tsx contracts/scripts/networkcheck.ts 

example output

testing https://proxy.testworld.minaexplorer.com/graphql
successfully set active instance
failed to fetch last block

testing https://proxy.berkeley.minaexplorer.com/graphql
successfully set active instance
blockchain length 37605

check the address

npx tsx contracts/scripts/accountcheck.ts https://proxy.berkeley.minaexplorer.com/graphql B62qkThtJWtKXN56efqC4ZXqv5NMD3mvjoVg5GpLLHRv9b3z2uMrkN4

example output

{
  account: {
    publicKey: PublicKey { x: [Field], isOdd: [Bool] },
    tokenId: Field { value: [Array] },
    tokenSymbol: '',
    balance: UInt64 { value: [Field] },
    nonce: UInt32 { value: [Field] },
    receiptChainHash: Field { value: [Array] },
    delegate: PublicKey { x: [Field], isOdd: [Bool] },
    votingFor: Field { value: [Array] },
    timing: {
      isTimed: [Bool],
      initialMinimumBalance: [UInt64],
      cliffTime: [UInt32],
      cliffAmount: [UInt64],
      vestingPeriod: [UInt32],
      vestingIncrement: [UInt64]
    },
    permissions: {
      editState: [Object],
      access: [Object],
      send: [Object],
      receive: [Object],
      setDelegate: [Object],
      setPermissions: [Object],
      setVerificationKey: [Object],
      setZkappUri: [Object],
      editActionState: [Object],
      setTokenSymbol: [Object],
      incrementNonce: [Object],
      setVotingFor: [Object],
      setTiming: [Object]
    },
    zkapp: undefined
  },
  error: undefined
}

mac's People

Contributors

marekyggdrasil avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

satyambnsal

mac'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.