-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify quotes from zero address (#3150)
# Description @nlordell's recent PR stack enabled the use case where a real trader (wallet is connected in the frontend) does not have the required balances by faking balances. But with the new ability to fake balances for many tokens we can even go one step further. # Changes If we know how to fake balances for the given sell token AND no wallet is connected (i.e. `verification.from.is_zero()`) we simply generate a random address and use that as the trader with fake balances. Using a non-zero address is important because many token transfer functions don't like sending tokens to or from the zero address. This should prevent the annoying UX where you sometime see a really good (unverified) price when your wallet is not connected and end up seeing worse (but verified) prices after you connect your wallet. ## How to test added an e2e test which produces a verified quote with `from: H160::zero()`
- Loading branch information
1 parent
d58ffd7
commit 78a1b81
Showing
2 changed files
with
78 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters