Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Jan 16, 2025
1 parent ee88386 commit 3ef1363
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/yarn-build-fmt-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache-dependency-path: ${{ matrix.packages }}/yarn.lock

- name: Run install
working-directory: ${{ matrix.packages }}
Expand Down
10 changes: 5 additions & 5 deletions sponsoredTransactionsAuction/frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
## Unreleased changes

- Change the dApp to use new `signCIS3Message` function from the BrowserWallet.
- Change the dApp to use new `signCIS3Message` function from the BrowserWallet.

## 1.0.3

- Fix `Writable` error via polyfill in `walletConnect` dependency.
- Fix `Writable` error via polyfill in `walletConnect` dependency.

## 1.0.2

- Update `ccd-js-gen` tool to version "^1.2.0".
- Update `ccd-js-gen` tool to version "^1.2.0".

## 1.0.1

- Change `http` to `https` in the hardcoded node connection at the front end.
- Change `http` to `https` in the hardcoded node connection at the front end.

## 1.0.0

- Initial auction sponsored transaction front end
- Initial auction sponsored transaction front end
28 changes: 14 additions & 14 deletions sponsoredTransactionsAuction/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This front end interacts with the [sponsored-enabled-auction](https://github.com/Concordium/concordium-rust-smart-contracts/tree/main/examples/sponsored-tx-enabled-auction) and the [cis2-multi](https://github.com/Concordium/concordium-rust-smart-contracts/tree/main/examples/cis2-multi) smart contracts. Users can bid for the items in the auction contract by using a sponsored-transaction-enabled token as a payment method (no CCD required in the user's wallet). This web app supports the following flows with the browser wallet:

- Mint payment tokens to your wallet.
- Add an item to the auction contract.
- View your item from the auction contract.
- Bid for an item without sending a transaction from the browser wallet. In other words, without paying for the transaction fees from your browser wallet. This flow first computes the message hash for the bid transaction which you have to sign in your browser wallet. Then this signature is submit to the `/bid` backend endpoint.
- Mint payment tokens to your wallet.
- Add an item to the auction contract.
- View your item from the auction contract.
- Bid for an item without sending a transaction from the browser wallet. In other words, without paying for the transaction fees from your browser wallet. This flow first computes the message hash for the bid transaction which you have to sign in your browser wallet. Then this signature is submit to the `/bid` backend endpoint.

The backend creates a sponsored transaction and submits it to the `permit` function in the smart contract {index: CIS2_TOKEN_CONTRACT_INDEX, subindex: 0}. You can look up the CIS2_TOKEN_CONTRACT_INDEX in the `package.json` file. The backend returns the transaction hash to the frontend.

Expand All @@ -17,21 +17,21 @@ The smart contract code at {index: AUCTION_CONTRACT_INDEX, subindex: 0} can be f

## Prerequisites

- Browser wallet extension version 1.5.2 or above must be installed in Google Chrome and the Concordium testnet needs to be selected.
- Browser wallet extension version 1.5.2 or above must be installed in Google Chrome and the Concordium testnet needs to be selected.

## Running the sponsored txs example (without backend -> submitting the sponsored transaction to chain will fail)

- Run `yarn install` in a terminal in this folder.
- Run `yarn build` in a terminal in this folder.
- Run `yarn dev` in a terminal in this folder.
- Open URL logged in console (typically http://127.0.0.1:5173).
- Run `yarn install` in a terminal in this folder.
- Run `yarn build` in a terminal in this folder.
- Run `yarn dev` in a terminal in this folder.
- Open URL logged in console (typically http://127.0.0.1:5173).

Hot-reload (useful for development) is enabled.

## Running the sponsored txs example (with backend -> submitting the sponsored transaction to chain will work)

- Run `yarn install` in a terminal in this folder.
- Run `yarn build` in a terminal in this folder.
- Run `yarn install` in a terminal in this folder.
- Run `yarn build` in a terminal in this folder.

This creates a `dist` folder which can be served via the backend. Start the backend server by following the instructions in the [README.md file](../backend/README.md).

Expand All @@ -43,6 +43,6 @@ Run `yarn fmt` and `yarn lint-fix` before committing to ensure consistent format

The frontend uses smart contract clients generated by the [`ccd-js-gen`](https://github.com/Concordium/concordium-node-sdk-js/tree/main/packages/ccd-js-gen) package. To re-generate a client for the e.g. `cis2-multi` smart contract (after updating the logic of the smart contract) execute the following steps:

- Generate the smart contract module by running `cargo concordium build --out ./cis2_multi.wasm.v1` in the smart contract project folder [cis2-multi](https://github.com/Concordium/concordium-rust-smart-contracts/tree/main/examples/cis2-multi).
- Replace the `cis2_multi.wasm.v1` file in [this folder](https://github.com/Concordium/concordium-dapp-examples/tree/main/sponsoredTransactionsAuction/frontend/contracts) with the newly generated module.
- Re-generate the client by running the command `yarn generate-client` in this folder. Troubleshooting: Check that your node version is at least `18.0.0` (as specified in the `package.json` file) for the command.
- Generate the smart contract module by running `cargo concordium build --out ./cis2_multi.wasm.v1` in the smart contract project folder [cis2-multi](https://github.com/Concordium/concordium-rust-smart-contracts/tree/main/examples/cis2-multi).
- Replace the `cis2_multi.wasm.v1` file in [this folder](https://github.com/Concordium/concordium-dapp-examples/tree/main/sponsoredTransactionsAuction/frontend/contracts) with the newly generated module.
- Re-generate the client by running the command `yarn generate-client` in this folder. Troubleshooting: Check that your node version is at least `18.0.0` (as specified in the `package.json` file) for the command.

0 comments on commit 3ef1363

Please sign in to comment.