From c05ade01810392861c95921330f7ea31c327b6de Mon Sep 17 00:00:00 2001 From: Guilherme Dantas Date: Thu, 18 Jul 2024 11:31:59 -0300 Subject: [PATCH] Link to vercel app (#29) --- .changeset/big-islands-study.md | 6 + README.md | 225 +------------------------------- apps/cli/package.json | 2 +- packages/core/package.json | 2 +- 4 files changed, 10 insertions(+), 225 deletions(-) create mode 100644 .changeset/big-islands-study.md diff --git a/.changeset/big-islands-study.md b/.changeset/big-islands-study.md new file mode 100644 index 0000000..51a9c0b --- /dev/null +++ b/.changeset/big-islands-study.md @@ -0,0 +1,6 @@ +--- +"@guidanoli/cmioc": patch +"@guidanoli/cmioc-cli": patch +--- + +Use Vercel app as package homepage diff --git a/README.md b/README.md index 52b3843..5d6a7ae 100644 --- a/README.md +++ b/README.md @@ -2,227 +2,6 @@ In the upcoming v2 release of the Cartesi Rollups SDK, inputs and outputs will be encoded as Solidity function calldata. This package aims to show front-end developers how inputs and outputs can be encoded or decoded using [`viem`](https://viem.sh/) and the contract ABIs exported by [`@cartesi/rollups`](https://www.npmjs.com/package/@cartesi/rollups). -It also comes with a handy-dandy CLI tool for encoding and decoding of inputs and outputs. +It also comes with a handy-dandy CLI tool. -## Installation - -You can install the package with `pnpm` by running: - -```sh -pnpm add -g @guidanoli/cmioc -``` - -## Encoding inputs - -### To hex - -```sh -cmioc encode input \ - --chain-id 1 \ - --app-contract 0x70ac08179605AF2D9e75782b8DEcDD3c22aA4D0C \ - --msg-sender 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ - --block-number 42 \ - --block-timestamp 70000 \ - --prev-randao 40823578488146031703637781058841789769586951870728503003341100870835983872788 \ - --index 10 \ - --payload 0xdeadbeef -``` - -Output: - -``` -0x415bf363000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070ac08179605af2d9e75782b8decdd3c22aa4d0c000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000111705a41539c3688747a1a8c7811b98b0427331ff73aab018eb5c9921993d617f314000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000 -``` - -### To binary - -Just add the `--binary` flag. - -## Decoding inputs - -### From hex - -```sh -cmioc decode input 0x415bf363000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070ac08179605af2d9e75782b8decdd3c22aa4d0c000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000111705a41539c3688747a1a8c7811b98b0427331ff73aab018eb5c9921993d617f314000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000 -``` - -or - -```sh -cat input.txt | cmioc decode input -``` - -### From binary - -```sh -cat input.bin | cmioc decode input --binary -``` - -Output: - -```json -{ - "chainId": "1", - "appContract": "0x70ac08179605AF2D9e75782b8DEcDD3c22aA4D0C", - "msgSender": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "blockNumber": "42", - "blockTimestamp": "70000", - "prevRandao": "40823578488146031703637781058841789769586951870728503003341100870835983872788", - "index": "10", - "payload": "0xdeadbeef" -} -``` - -## Encoding outputs - -### Notices - -#### To hex - -```sh -cmioc encode notice \ - --payload 0xdeadbeef -``` - -Output: - -``` -0xc258d6e500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000 -``` - -#### To binary - -Just add the `--binary` flag. - -### Vouchers - -#### To hex - -```sh -cmioc encode voucher \ - --destination 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ - --value 1000000000000000000 \ - --payload 0xfafafa -``` - -Output: - -``` -0x237a816f000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000003fafafa0000000000000000000000000000000000000000000000000000000000 -``` - -#### To binary - -Just add the `--binary` flag. - -### `DELEGATECALL` vouchers - -#### To hex - -```sh -cmioc encode delegatecallvoucher \ - --destination 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ - --payload 0xfafafa -``` - -Output: - -``` -0x10321e8b000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003fafafa0000000000000000000000000000000000000000000000000000000000 -``` - -#### To binary - -Just add the `--binary` flag. - -## Decoding outputs - -### Notices - -#### From hex - -```sh -cmioc decode output 0xc258d6e500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000 -``` - -or - -```sh -cat notice.txt | cmioc decode output -``` - -#### From binary - -```sh -cat notice.bin | cmioc decode output --binary -``` - -Output: - -```json -{ - "type": "notice", - "payload": "0xdeadbeef" -} -``` - -### Vouchers - -#### From hex - -```sh -cmioc decode output 0x237a816f000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000003fafafa0000000000000000000000000000000000000000000000000000000000 -``` - -or - -```sh -cat voucher.txt | cmioc decode output -``` - -#### From binary - -```sh -cat voucher.bin | cmioc decode output --binary -``` - -Output: - -```json -{ - "type": "voucher", - "destination": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "value": "1000000000000000000", - "payload": "0xfafafa" -} -``` - -### `DELEGATECALL` vouchers - -#### From hex - -```sh -cmioc decode output 0x10321e8b000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003fafafa0000000000000000000000000000000000000000000000000000000000 -``` - -or - -```sh -cat delegatecallvoucher.txt | cmioc decode output -``` - -#### From binary - -```sh -cat delegatecallvoucher.bin | cmioc decode output --binary -``` - -Output: - -```json -{ - "type": "delegatecallvoucher", - "destination": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "payload": "0xfafafa" -} -``` +For documentation, please visit **https://cmioc.vercel.app/**. diff --git a/apps/cli/package.json b/apps/cli/package.json index db9df16..3930278 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -9,7 +9,7 @@ "codec", "cli" ], - "homepage": "https://github.com/guidanoli/cmioc", + "homepage": "https://cmioc.vercel.app/", "bugs": { "url": "https://github.com/guidanoli/cmioc/issues" }, diff --git a/packages/core/package.json b/packages/core/package.json index 8f454fd..453a074 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -8,7 +8,7 @@ "solidity", "codec" ], - "homepage": "https://github.com/guidanoli/cmioc", + "homepage": "https://cmioc.vercel.app/", "bugs": { "url": "https://github.com/guidanoli/cmioc/issues" },