mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
CW-1086: Polygon Issues (#2329)
* fix(polygon): Polygon wallets not showing in address book when sending tokens * feat(polygon_issues): Enhance gas price handling in EVM Chains This change: - Updates gas price calculation to account for minimum priority fee in Polygon - Adjusts gas price handling to use maxFeePerGas when gasPrice is not provided. - Fixes issue with send all for Polygon
This commit is contained in:
parent
5082dc20f3
commit
4434ad7363
5 changed files with 63 additions and 16 deletions
|
@ -84,6 +84,6 @@ class DefaultPolygonErc20Tokens {
|
|||
.iconPath;
|
||||
} catch (_) {}
|
||||
|
||||
return Erc20Token.copyWith(token, iconPath, 'POLY');
|
||||
return Erc20Token.copyWith(token, iconPath, 'POL');
|
||||
}).toList();
|
||||
}
|
||||
|
|
|
@ -18,13 +18,20 @@ class PolygonClient extends EVMChainClient {
|
|||
EtherAmount? gasPrice,
|
||||
EtherAmount? maxFeePerGas,
|
||||
}) {
|
||||
EtherAmount? finalGasPrice = gasPrice;
|
||||
|
||||
if (gasPrice == null && maxFeePerGas != null) {
|
||||
// If we have EIP-1559 parameters but no legacy gasPrice, then use maxFeePerGas as gasPrice
|
||||
finalGasPrice = maxFeePerGas;
|
||||
}
|
||||
|
||||
return Transaction(
|
||||
from: from,
|
||||
to: to,
|
||||
value: amount,
|
||||
// data: data,
|
||||
data: data,
|
||||
maxGas: maxGas,
|
||||
// gasPrice: gasPrice,
|
||||
gasPrice: finalGasPrice,
|
||||
// maxFeePerGas: maxFeePerGas,
|
||||
// maxPriorityFeePerGas: maxPriorityFeePerGas,
|
||||
);
|
||||
|
|
|
@ -45,7 +45,12 @@ class PolygonWallet extends EVMChainWallet {
|
|||
final initialErc20Tokens = DefaultPolygonErc20Tokens().initialPolygonErc20Tokens;
|
||||
|
||||
for (final token in initialErc20Tokens) {
|
||||
if (!evmChainErc20TokensBox.containsKey(token.contractAddress)) {
|
||||
if (evmChainErc20TokensBox.containsKey(token.contractAddress)) {
|
||||
final existingToken = evmChainErc20TokensBox.get(token.contractAddress);
|
||||
if (existingToken?.tag != token.tag) {
|
||||
evmChainErc20TokensBox.put(token.contractAddress, token);
|
||||
}
|
||||
} else {
|
||||
if (isMigration) token.enabled = false;
|
||||
evmChainErc20TokensBox.put(token.contractAddress, token);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue