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

Finance: MCD DAI migration #1048

Merged
merged 3 commits into from
Nov 23, 2019
Merged

Finance: MCD DAI migration #1048

merged 3 commits into from
Nov 23, 2019

Conversation

sohkai
Copy link
Contributor

@sohkai sohkai commented Nov 22, 2019

Based off #1045

  • Updates the verified token lists
  • Turns the "token information fallback" into an override instead, to handle SAI's token name and symbol
  • Migrates to using tokenIconUrl() while gracefully handling testnet tokens

Copy link
Contributor

@bpierre bpierre left a comment

Choose a reason for hiding this comment

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

LGTM

}

// On other networks, pretend any token with the same symbol is legit
const mainnetEquivalent = ETHER_TOKEN_VERIFIED_BY_SYMBOL.get(tokenSymbol)
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn’t that be an (minor) issue for people testing an org on rinkeby with a symbol in the list? What about doing it the other way, by having a list of test tokens by network?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes... we could add an extra check to make sure that the given token address is in the list of test tokens?

In that case, it would only be our test tokens that look "legit" with icons displayed in test networks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could add an extra check to make sure that the given token address is in the list of test tokens?

Done in 70d65d4.

DAI_MAINNET_TOKEN_ADDRESS,
{ symbol: 'DAI', name: 'Dai Stablecoin v1.0', decimals: '18' },
SAI_MAINNET_TOKEN_ADDRESS,
{ symbol: 'SAI', name: 'Sai Stablecoin v1.0', decimals: '18' },
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to see they fixed that in MCD DAI!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thankfully. I still don't know how they got to that bytes32 abomination.

@@ -44,18 +46,18 @@ export const isTokenVerified = (tokenAddress, networkType) =>
? ETHER_TOKEN_VERIFIED_ADDRESSES.has(tokenAddress.toLowerCase())
: true

export const tokenDataFallback = (tokenAddress, fieldName, networkType) => {
// The fallback list is without checksums
export const tokenDataOverride = (tokenAddress, fieldName, networkType) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 97.816% when pulling c68359e on finance-mcd-dai into 11a0540 on finance-polish.

@sohkai sohkai changed the base branch from finance-polish to master November 23, 2019 11:32
@sohkai sohkai merged commit cae0988 into master Nov 23, 2019
@sohkai sohkai deleted the finance-mcd-dai branch November 23, 2019 11:32
MickdeGraaf pushed a commit to MickdeGraaf/aragon-apps that referenced this pull request Jan 28, 2020
* Finance, Tokens: update verified tokens
* Finance: upgrade to MCD DAI and use tokenIconUrl() for token icons
* Finance: only show token icons on test networks for known test tokens
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
* Finance, Tokens: update verified tokens
* Finance: upgrade to MCD DAI and use tokenIconUrl() for token icons
* Finance: only show token icons on test networks for known test tokens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants