Skip to content

Commit

Permalink
Merge branch 'develop' into poc-fee-in-any-token
Browse files Browse the repository at this point in the history
  • Loading branch information
sgc-code authored Jul 3, 2024
2 parents e0d9cf4 + da52dcf commit 7659f54
Show file tree
Hide file tree
Showing 7 changed files with 256 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/integration-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,21 @@ jobs:

- name: Step 3 - Check correct linting
run: yarn eslint .

gas-report:
runs-on: ubuntu-latest
steps:
- name: Check out main branch
uses: actions/checkout@v3

- name: Setup Scarb
uses: software-mansion/[email protected]

- name: Install project
run: yarn install --frozen-lockfile

- name: Start devnet in background
run: scarb run start-devnet

- name: Gas report
run: scarb run profile --check
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ As the fee should be larger than the claiming transaction cost, there might be a
## Deposits

Deposits follow the flow described in the first 3 steps above.

![Sessions diagram](/docs/deposit_diagram.png)

For more details please see the `deposit` function at [Deposit example](./lib/deposit.ts).

## Claiming
Expand All @@ -25,6 +28,8 @@ Claiming can be done in two ways:

The recipient uses the private key to craft a transaction to claim the gift. The `fee_amount` will be used to cover the transaction fees, so the recipient only gets the `gift_amount`. The recipient doesn’t need to have any funds in their wallet or even a deployed wallet to claim the gift using this method.

![Sessions diagram](/docs/internal_claim.png)

Edge cases:

- Insufficient `fee_amount`: Alternative options are "external claiming", waiting for transaction price to go down, or canceling the gift (see below).
Expand All @@ -39,6 +44,8 @@ It is also possible for someone else to pay for the claim fees. This can be usef

The receiver can use the private key sign a message containing the address receiving the address (and optionally some address that will receive the dust). Using this signature, anybody can execute a transaction to perform the claim. To do so, they should call `claim_external` on the escrow account (through the `execute_action` entrypoint).

![Sessions diagram](/docs/external_claim.png)

For more details please see the `claimExternal` function at [Claim External Example](./lib/claim.ts).

## Cancelling Gifts
Expand Down
3 changes: 0 additions & 3 deletions deployments.md

This file was deleted.

Binary file added docs/deposit_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
231 changes: 231 additions & 0 deletions docs/diagrams.drawio

Large diffs are not rendered by default.

Binary file added docs/external_claim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/internal_claim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7659f54

Please sign in to comment.