Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sponsored transaction enabled auction #32

Merged
merged 51 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0db9ee7
Initial sponsored transaction enabled auction
DOBEN Nov 29, 2023
3f93ac1
Add mint and addItem function
DOBEN Nov 30, 2023
1116128
Add viewItem display
DOBEN Dec 1, 2023
b8831ac
Add signature generation
DOBEN Dec 1, 2023
66b8a38
Fix bidding via browser wallet
DOBEN Dec 2, 2023
5879e28
Add bidding to backend
DOBEN Dec 2, 2023
f234f7e
Simplified wallet connection
DOBEN Dec 4, 2023
51191bf
Use components and scss styling
DOBEN Dec 4, 2023
05b3723
Add more components
DOBEN Dec 4, 2023
325f614
Move bid functionality into a component
DOBEN Dec 5, 2023
37f4296
Add event passing
DOBEN Dec 5, 2023
abe1121
Small improvements
DOBEN Dec 6, 2023
92a6629
Add input field validation
DOBEN Dec 6, 2023
3b3075d
Update README files
DOBEN Dec 6, 2023
55e35d5
Add to CI pipeline
DOBEN Dec 7, 2023
ab03f1c
Fix docker files
DOBEN Dec 7, 2023
328969d
Clean up pull request
DOBEN Dec 7, 2023
932daaf
Add comments
DOBEN Dec 7, 2023
98040b2
Increase fmt version
DOBEN Dec 18, 2023
9ba3797
Address comments
DOBEN Dec 18, 2023
d510a0e
Address comments
DOBEN Dec 18, 2023
3f7f077
Initial try to move to vite
DOBEN Dec 19, 2023
04ec156
Update dependencies
DOBEN Dec 19, 2023
4fc1841
Improve styling
DOBEN Dec 19, 2023
3d23272
Address linter errors and warnings
DOBEN Dec 20, 2023
ad08090
Fix waiting for event details
DOBEN Dec 20, 2023
53ffd94
Improve styling
DOBEN Dec 21, 2023
0aa8243
Add ccd-js-gen
DOBEN Dec 21, 2023
26e25fc
Use ccd-js-gen client to invoke the mint function
DOBEN Dec 21, 2023
5440fe7
Add script to generate clients
DOBEN Dec 21, 2023
ed3c738
Use ccd-js-gen client for nonceOf query
DOBEN Dec 22, 2023
e482fed
Fix manual conversion of input parameters
DOBEN Dec 22, 2023
20dd593
Use transaction hash type
DOBEN Dec 22, 2023
c9a7a79
Use ccd-js-gen tool for viewItemState
DOBEN Dec 22, 2023
73a98c4
Clean up chnages introduced by ccd-js-gen
DOBEN Dec 27, 2023
5b6a5c4
Fix look for item index only in addItemTxHash
DOBEN Dec 29, 2023
212bfe6
Fix dockerfile
DOBEN Dec 29, 2023
3ca632a
Use ccd-js-gen to parse return values
DOBEN Jan 1, 2024
a434d00
Update read.me
DOBEN Jan 2, 2024
e7fa16c
Improve error parsing
DOBEN Jan 2, 2024
23292f1
Small improvements back end
DOBEN Jan 2, 2024
9b9000d
Move backend from warp to axum
DOBEN Jan 2, 2024
2c66c11
Improve error parsing
DOBEN Jan 3, 2024
1e28544
Clean up server
DOBEN Jan 3, 2024
9c495ea
Fix conversion of types
DOBEN Jan 4, 2024
9cc24ad
Fix CI pipeline
DOBEN Jan 4, 2024
b55c8db
Check for account aliases
DOBEN Jan 4, 2024
ab7c3ec
Small improvements
DOBEN Jan 4, 2024
72c1321
Fix docker builds
DOBEN Jan 5, 2024
424b12e
Clean-up front end
DOBEN Jan 5, 2024
0d83292
Address comments
DOBEN Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/rust-fmt-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
workflow_dispatch: # allows manual trigger

env:
RUST_FMT: nightly-2022-06-09-x86_64-unknown-linux-gnu
RUST_CLIPPY: 1.65
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu
RUST_CLIPPY: 1.67

jobs:
"lint_fmt":
Expand All @@ -26,6 +26,7 @@ jobs:
crates:
- gallery/verifier/Cargo.toml
- sponsoredTransactions/backend/Cargo.toml
- sponsoredTransactionsAuction/backend/Cargo.toml

steps:
- name: Checkout
Expand Down Expand Up @@ -54,6 +55,7 @@ jobs:
crates:
- gallery/verifier/Cargo.toml
- sponsoredTransactions/backend/Cargo.toml
- sponsoredTransactionsAuction/backend/Cargo.toml

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ yarn-error.log*
target
dist
gallery/public
.eslintcache
.eslintcache
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ The following examples are available.

- [gallery](./gallery/) demonstrates a gallery which requires the user to authorize using ID proofs from the browser wallet.

- [sponsoredTransactions](./sponsoredTransactions/) demonstrates how a user (without holding CCD in the wallet) can sign a message with the browser wallet or mobile wallet through wallet connect and submit the signature to a backend. The backend pays for the transaction fee and submits the sponsored transaction on behalf of the user to the chain.
- [sponsoredTransactions](./sponsoredTransactions/) demonstrates how a user (without holding CCD in the wallet) can sign a message with the browser wallet and submit the signature to a backend. The backend pays for the transaction fee and submits the sponsored transaction on behalf of the user to the chain.

- [simple age verification](./simpleAgeVerification/) demonstrates in a simple use case of verifiying the users age with the browser wallet.
- [sponsoredTransactionsAuction](./sponsoredTransactionsAuction/) demonstrates how to use a sponsored-transaction-enabled token as a payment method in an auction contract so that the user does not have to hold CCD in their wallet. The user signs a bidding message with the browser wallet and submits the signature to a backend. The backend pays for the transaction fee and submits the sponsored transaction on behalf of the user to the chain.

- [simple age verification](./simpleAgeVerification/) demonstrates in a simple use case of verifying the user's age with the browser wallet.

## Setup

Some projects uses submodules, to initialize or update those, run:
Some projects use submodules, to initialize or update those, run:
```shell
git submodule update --init --recursive
```
6 changes: 3 additions & 3 deletions sponsoredTransactions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ FROM ${node_base_image} AS frontend
WORKDIR /app
COPY ./sponsoredTransactions/frontend ./

RUN yarn && yarn cache clean
RUN yarn
RUN yarn build

FROM ${rust_base_image} AS backend

WORKDIR /backend
WORKDIR /backend/app
COPY ./deps/concordium-rust-sdk /deps/concordium-rust-sdk
COPY ./sponsoredTransactions/backend ./

Expand All @@ -27,7 +27,7 @@ ENV SMART_CONTRACT_INDEX=6372

ENV ACCOUNT_KEY_FILE=/KEY_FILE

COPY --from=backend ./backend/target/release/sponsored-transaction-backend ./main
COPY --from=backend ./backend/app/target/release/sponsored-transaction-backend ./main
COPY --from=frontend ./app/dist ./public

RUN chmod +x ./main
Expand Down
2 changes: 0 additions & 2 deletions sponsoredTransactions/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@concordium/browser-wallet-api-helpers": "2.4.0",
"@concordium/react-components": "^0.3.0",
"@concordium/web-sdk": "^3.4.0",
"@thi.ng/leb128": "^2.1.18",
"@types/sha256": "^0.2.0",
"@walletconnect/types": "^2.1.4",
"eslint": "^8.37.0",
Expand All @@ -31,7 +30,6 @@
"cross-env": "^7.0.3",
"esbuild": "^0.14.42",
"esbuild-plugin-svgr": "^1.0.1",
"eslint": "7",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
Loading
Loading