Skip to content

Commit

Permalink
update: nacho-rollup-contract package to v1.0.0 on NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
berzanorg committed May 7, 2024
1 parent 51bbe4b commit 8591c5b
Show file tree
Hide file tree
Showing 9 changed files with 1,103 additions and 68 deletions.
21 changes: 21 additions & 0 deletions rollup-contract/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Berzan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 48 additions & 0 deletions rollup-contract/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# nacho-rollup-contract

The rollup smart contract of [Nacho](https://github.com/berzanorg/nacho) built using [o1js](https://www.npmjs.com/package/o1js).

[`nacho-rollup-contract`](https://www.npmjs.com/package/nacho-rollup-contract) package is intended to be used for [Nacho](https://github.com/berzanorg/nacho) only as it is a naive implementation.

## 📦 Installation

If you are using [`npm`](https://docs.npmjs.com/cli/):

```shell
npm install nacho-rollup-contract
```

If you are using [`yarn`](https://classic.yarnpkg.com/lang/en/docs/cli/):

```shell
yarn add nacho-rollup-contract
```

If you are using [`pnpm`](https://pnpm.io/pnpm-cli):

```shell
pnpm add nacho-rollup-contract
```

## 🔍 Details

Nacho's rollup contract extends o1js's `SmartContract` by overriding existing `init` method and adding a new method called `settle`.
The method `init` is overridden to initialize the state of the contract as empty root hashes of Merkle trees that hold the rollup's state.

### 🛠️ Smart Contract Methods

- [`settle(zkProof)`](https://github.com/berzanorg/nacho/blob/main/rollup-contractr/src/rollup-contract.ts#L15):

Takes a [`ZkProof`](https://github.com/berzanorg/nacho/blob/main/proof-generator/src/zk-proof.ts) as the only parameter and checks if its public input is equal to the settled one, then updates the contract's state accordingly.

## 📝 License

This project is licensed under the MIT License.

You may use the source code of this project accordingly.

## 👤 About Me

I am [**Berzan**](https://berzan.org/) and I am developing [**Nacho**](https://nacho.finance/) to express my skills in the real world.

I built this library to use inside [**Nacho**](https://nacho.finance/).
Loading

0 comments on commit 8591c5b

Please sign in to comment.