Skip to content

Commit

Permalink
Merge pull request MyEtherWallet#3094 from MyEtherWallet/bug/fix-toke…
Browse files Browse the repository at this point in the history
…nAddress-retrieval

bug: fix address property checks for one inch
  • Loading branch information
gamalielhere authored May 14, 2021
2 parents 481619a + f0cceec commit 1c4cfb5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Bug
* fix address property checks for one inch[#3094](https://github.com/MyEtherWallet/MyEtherWallet/pull/3094)


### Release v5.7.29

### Devop
Expand Down
2 changes: 1 addition & 1 deletion fetchLists/lists/tokens.json

Large diffs are not rendered by default.

76 changes: 29 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
"@ensdomains/dnsregistrar": "0.4.0",
"@ethereum-alarm-clock/lib": "0.3.5",
"@keepkey/keepkey.js": "1.2.3",
"@ledgerhq/hw-app-eth": "5.50.0",
"@ledgerhq/hw-app-eth": "5.51.1",
"@ledgerhq/hw-transport-u2f": "5.36.0-deprecated",
"@ledgerhq/hw-transport-webusb": "5.50.0",
"@ledgerhq/hw-transport-webusb": "5.51.1",
"@makerdao/currency": "0.9.9",
"@makerdao/dai": "0.29.0",
"@makerdao/dai-plugin-config": "0.2.15",
Expand Down
10 changes: 6 additions & 4 deletions src/partners/oneInch/oneInch.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,14 @@ export default class OneInch {
getTokenAddress(token) {
try {
if (utils.stringEqual(networkSymbols.ETH, token)) {
return this.EthereumTokens[token].contractAddress
? this.EthereumTokens[token].contractAddress
: this.tokenDetails[token].address;
return this.tokenDetails[token]?.address
? this.tokenDetails[token].address
: this.EthereumTokens[token].contractAddress;
}
return this.web3.utils.toChecksumAddress(
this.EthereumTokens[token].contractAddress
this.tokenDetails[token]?.address
? this.tokenDetails[token].address
: this.EthereumTokens[token].contractAddress
);
} catch (e) {
errorLogger(e);
Expand Down

0 comments on commit 1c4cfb5

Please sign in to comment.