Skip to content

Approve / unlock functionality#66

Merged
chikeichan merged 6 commits intoUniswap:masterfrom
kennyt:approve-unlock-exchange
Oct 20, 2018
Merged

Approve / unlock functionality#66
chikeichan merged 6 commits intoUniswap:masterfrom
kennyt:approve-unlock-exchange

Conversation

@kennyt
Copy link
Contributor

@kennyt kennyt commented Oct 18, 2018

No description provided.


return drizzleCtx.contracts[inputExchange].methods.approve.cacheSend(
inputExchange,
300, // TODO: what is this number?
Copy link
Contributor

@chikeichan chikeichan Oct 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be the decimals * 10 ** 18 decimals * 10 ** 8 number

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decimals * 10**8

although decimals frequently equals 10**18

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick note maybe we should rename decimals to decimalsMultiplier or something. Since its technically:

input_decimals = input_tolen_contract.methods.decimals()
decimals = 10 ** input_decimals

I'm starting to think calling it decimals is a bit confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


validate = (balance) => {
const { value, addError, removeError, errors } = this.props;
const { value, addError, removeError, errors, validateBalance } = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is validateBalance being passed here?

Also, validateBalance implies that it is a function. should this be called isBalanceValid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validateBalance is telling the inputpanel whether or not it should even validate the input being greater than the balance. we don't always want it to validate that (the Output shouldn't validate it) so I added this prop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just changed the name from validateBalance to shouldValidateBalance to make the purpose more clear

return !deepEqual(nextProps, this.props) ||
!deepEqual(nextState, this.state);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chikeichan Added this shouldcomponentupdate function.

When I was testing the approval process, the app would always freeze after I confirmed with Metamask (and therefore the app never enters the 'Pending' state). After a long time debugging, it turns out the react components were rendering basically nonstop during the pending state, probably due to drizzle. Looked into it and the drizzle docs suggest adding a shouldComponentUpdate. added it and it works perfectly now. This probably fixes #49 also

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chikeichan chikeichan merged commit ade904d into Uniswap:master Oct 20, 2018
crisog pushed a commit to Levinswap/levinswap-interface that referenced this pull request Feb 5, 2021
* Initial approve / unlock functionality

* Refactor out getdecimal/getbalance. Add in approval limit

* Change validateBalance to shouldValidateBalance

* Add deepEqual and shouldComponentUpdate

* Use web3 toHex util

* Add pending icon and use
NameX44 pushed a commit to NameX44/uniswap-interface-skynet that referenced this pull request Aug 29, 2021
NameX44 pushed a commit to NameX44/uniswap-interface-skynet that referenced this pull request Aug 30, 2021
Add icon to expand more options on small screens
zzmp added a commit that referenced this pull request Jul 14, 2023
* add npm secret and modify github actions

* inject npm secret for tests as well

* revert changes to staging and prod actions because we arent going to use themmm

* remove unused github actions

* minor copy change for convenience lol

* feat: add DutchOrderTrade type to Swap components (#8)

* feat: add flag for gouda (#5)

* feat: add new signature details type (#4)

* feat: local gouda activity (#9)

* feat: Unified Routing API classic and dutch limit quote requests (#10)

* chore: Rebase 5/26 (#13)

Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: eddie <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>

* feat: add UniswapX to Settings (#7)

* feat: merge upstream 5/31 (#16)

* feat: Upgrade unified-routing-api URL (#15)

* chore: merge upstream 6/2 (#19)

Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>

* feat: uniswapx gas tooltip (#12)

Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>

* feat: swap callback (#17)

* feat: gouda gating (#14)

Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>

* fix: settings e2e test (#22)

* feat: update swap callback to add orders to redux state (#18)

* chore: Fix types for useBestTrade return result (#21)

* feat: gql gouda orders (#20)

* feat: show $0 for gas fee for now (#25)

* chore: Rebase 06/08 (#26)

Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: eddie <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Brendan Wong <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: Eddie Dugan <[email protected]>

* feat: poll on order submit (#23)

* feat: update gouda-sdk to 1.0.0-alpha.3 (#31)

* feat: rename gasUseEstimateUSD for dutch orders (#30)

Co-authored-by: Tina Zheng <[email protected]>

* chore: Fix response types (#36)

* feat: Gouda ETH input flow (#29)

Co-authored-by: Eddie Dugan <[email protected]>

* fix: use trade to determine what router label to show (#41)

* feat: open uniswapx modal on click (#32)

* feat: gouda logging new params in swap quote received (#33)

* fix: wrap step ui fixes (#40)

* feat: use BE deadline padding (#46)

* chore: merge 6/23 (#50)

Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: eddie <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Brendan Wong <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: Shubham Rasal <[email protected]>
Co-authored-by: Saro Vindigni <[email protected]>
Co-authored-by: Jordan Frankfurt <<[email protected]>
Co-authored-by: John Short <[email protected]>

* feat: Gouda opt-in flow request logic (#37)

Co-authored-by: eddie <[email protected]>

* feat: hide slippage and deadline settings when the current trade is gouda (#44)

* feat: use settled order amounts (#45)

* feat: fetch receipt before dispatch (#49)

* fix: updated order popups to launch modal (#48)

* feat: Use slippage value from URA response for UniswapX trades (#51)

* fix: Bump gouda-sdk to match backend response for quotes (#58)

* feat: Change gouda order status URL param from offerer -> swapper (#59)

* feat: disable opt in flow (#57)

* feat: Dont show USD value change for uniswapx trades (#55)

* fix: Don't use WETH as input currency for Classic ETH-in trades (#54)

* feat: Reset to WETH after wrap is complete (#52)

* fix: correct descriptor in UniswapX activity row items (#61)

* fix: align review modal and gouda activity modal (#60)

Co-authored-by: Charles Bachmeier <[email protected]>

* feat: Get wrap and approve gas info (#53)

Co-authored-by: eddie <[email protected]>

* fix: restore summary view when wrap is rejected (#66)

* fix: serialize tx receipts before storing (#64)

* fix: Insufficient balance check should read from the right currency (#65)

* feat: update designs for gas tooltips (#67)

* fix: UniswapX gas descriptor boolean (#69)

* chore: Bump conedison for better gas price formatting (#70)

* chore: Switch from gouda-sdk to uniswapx-sdk (#71)

* chore: Rename all variables `gouda` to UniswapX (#72)

* chore: Merge 7/8/23 (#73)

Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: eddie <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Brendan Wong <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: Shubham Rasal <[email protected]>
Co-authored-by: Saro Vindigni <[email protected]>
Co-authored-by: Jordan Frankfurt <<[email protected]>
Co-authored-by: John Short <[email protected]>
Co-authored-by: Charlie Bachmeier <[email protected]>
Co-authored-by: UL Service Account <[email protected]>

* chore(conedison): update package (#77)

* feat: add opt-in UI (#68)

* chore: address some todos (#79)

* chore: Rename feature flag from gouda_enabled to uniswapx_enabled (#81)

* feat: Copy changes (#82)

* fix: improve timings on animations for gouda opt-in (#80)

* chore: Use updated URLs (#84)

* chore: Merge 7/14 (#85)

Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: eddie <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Brendan Wong <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: Shubham Rasal <[email protected]>
Co-authored-by: Saro Vindigni <[email protected]>
Co-authored-by: Jordan Frankfurt <<[email protected]>
Co-authored-by: John Short <[email protected]>
Co-authored-by: Charlie Bachmeier <[email protected]>
Co-authored-by: UL Service Account <[email protected]>

* remove changes to github actions files

* fix import

* actually revert changes to yml

* remove method export

* feat: Add feature flag for synthetic quotes (#6938)

* fix: use Lingui Trans macro (#6943)

* fix: use trans macro

* add comments

* fix: update updater.tsx (#6942)

* fix: reformat variable to use ms

* move interval definition above getOrderStatus

* lint :)

* revert

* chore: bunch of nits (#6944)

bunch of nits

* fix: translations etc (#6945)

* chore: Remove placeholder signature types (#6937)

remove placeholder

* chore: merge main into branch (#6948)

* fix: Handle Scientific Notation for NFT Collection Activity Prices (#6936)

wrap nft activity price in

* fix: e2e tests (#6941)

* fix: e2e test

* fix: set flag for buy-crypto-modal test

* fix: fund DAI

---------

Co-authored-by: Zach Pomerantz <[email protected]>

---------

Co-authored-by: Charles Bachmeier <[email protected]>

* feat: make inputCurrency optional for swapheader (#6947)

* make inputCurrency optional for swapheader

* optional pass in

* fix: function defined twice (#6950)

fix lint

* test: add signatureToActivity undefined tests (#6949)

* fix: update token lists schema (#6951)

fix: update token list schema

* chore: some last nits (#6953)

* refactor: base type

* test: useUserDisabledUniswapX

* chore: simplify useAllSignatures usage

* chore: standard check order

* lint

---------

Co-authored-by: eddie <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: Mike Grabowski <[email protected]>
Co-authored-by: Zach Pomerantz <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Vignesh Mohankumar <[email protected]>
Co-authored-by: Jack Short <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: Jordan Frankfurt <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Nate Wienert <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Charles Bachmeier <[email protected]>
Co-authored-by: Brendan Wong <[email protected]>
Co-authored-by: cartcrom <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: clrdo <[email protected]>
Co-authored-by: Eddie Dugan <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: Shubham Rasal <[email protected]>
Co-authored-by: Saro Vindigni <[email protected]>
Co-authored-by: Jordan Frankfurt <<[email protected]>
Co-authored-by: John Short <[email protected]>
Co-authored-by: Charlie Bachmeier <[email protected]>
Co-authored-by: UL Service Account <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants