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

wip: EIP-7811 improvements #1001

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions ERCS/erc-7811.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,29 @@
}
```

## Dapp Migration

Check failure on line 265 in ERCS/erc-7811.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

error[markdown-order-section]: body has extra section(s) --> ERCS/erc-7811.md | 265 | ## Dapp Migration | ::: ERCS/erc-7811.md | 273 | ## Dapp use cases | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Check failure on line 265 in ERCS/erc-7811.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

error[markdown-order-section]: body has extra section(s) --> ERCS/erc-7811.md | 265 | ## Dapp Migration | ::: ERCS/erc-7811.md | 273 | ## Dapp use cases | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Check failure on line 265 in ERCS/erc-7811.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

error[markdown-order-section]: body has extra section(s) --> ERCS/erc-7811.md | 265 | ## Dapp Migration | ::: ERCS/erc-7811.md | 273 | ## Dapp use cases | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Dapps often rely on various backend services such as RPC or asset balance aggregators in order to display balances to the user or to restrict the actions the user can take in order to preserve user experience. It is recommended that apps take advantage of `wallet_getAssets` where possible to check what assets the user has to spend.

In order to further simplify dapp migration, it is recommended that libraries providing provider-compatible (TODO link ERC) implementations polyfill `wallet_getAssets` for wallet connections that do not support it. The response SHOULD be a simple balance check for the chain only, as it is not known what abstraction capabilities the wallet has.

Some dapps may not trust the `wallet_getAssets` value is correct or up-to-date with the latest balance, when compared with the current portfolio solution being used. In these cases it is recommended for dapps to merge the results of `wallet_getAssets` and their current solution by taking the maximum value of the two.

## Dapp use cases

When would dapps want to call this?

### Checking total spendable balance for an asset

E.g. DEX example with checking if enough USDC to execute the swap

### Checking available assets to spend - select token UI

E.g. DEX example, what assets do I have... greater than >$0.01 in value?

## Rationale

<!-- TODO -->

Check warning on line 287 in ERCS/erc-7811.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn`

warning[markdown-html-comments]: HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn` --> ERCS/erc-7811.md | 287 | <!-- TODO --> | ::: ERCS/erc-7811.md | 291 | <!-- TODO --> | = help: see https://ethereum.github.io/eipw/markdown-html-comments/

Check warning on line 287 in ERCS/erc-7811.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn`

warning[markdown-html-comments]: HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn` --> ERCS/erc-7811.md | 287 | <!-- TODO --> | ::: ERCS/erc-7811.md | 291 | <!-- TODO --> | = help: see https://ethereum.github.io/eipw/markdown-html-comments/

Check warning on line 287 in ERCS/erc-7811.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn`

warning[markdown-html-comments]: HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn` --> ERCS/erc-7811.md | 287 | <!-- TODO --> | ::: ERCS/erc-7811.md | 291 | <!-- TODO --> | = help: see https://ethereum.github.io/eipw/markdown-html-comments/

## Security Considerations

Expand Down
Loading