Skip to content

Commit

Permalink
Fix/base get token address (#1160)
Browse files Browse the repository at this point in the history
* fix: getTokenAddress base eth

* feat: removes exposed signer

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
towanTG and github-actions[bot] authored Jan 15, 2025
1 parent 2d94a63 commit fed32e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/swift-lemons-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@swapkit/toolbox-evm": patch
---

Fixes getTokenAddress for Base
3 changes: 2 additions & 1 deletion packages/toolboxes/evm/src/toolbox/EVMToolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,10 @@ export const getChecksumAddressFromAsset = (asset: Asset, chain: EVMChain) => {
export const getTokenAddress = ({ chain, symbol, ticker }: Asset, baseAssetChain: EVMChain) => {
try {
if (
// TODO: refactor this to use simplify the logic
(chain === baseAssetChain && symbol === baseAssetChain && ticker === baseAssetChain) ||
(chain === Chain.BinanceSmartChain && symbol === "BNB" && ticker === "BNB") ||
(chain === Chain.Arbitrum && symbol === "ETH" && ticker === "ETH")
([Chain.Arbitrum, Chain.Base].includes(chain) && symbol === "ETH" && ticker === "ETH")
) {
return baseAssetAddress[baseAssetChain];
}
Expand Down

0 comments on commit fed32e2

Please sign in to comment.