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:
David Adegoke 2025-06-24 03:41:43 +01:00 committed by GitHub
parent 5082dc20f3
commit 4434ad7363
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 63 additions and 16 deletions

View file

@ -109,7 +109,6 @@ abstract class EVMChainClient {
sender: senderAddress,
to: toAddress,
value: value,
// maxFeePerGas: maxFeePerGas,
);
return estimatedGas.toInt();
@ -165,6 +164,7 @@ abstract class EVMChainClient {
required int exponent,
String? contractAddress,
String? data,
int? gasPrice,
}) async {
assert(currency == CryptoCurrency.eth ||
currency == CryptoCurrency.maticpoly ||
@ -180,6 +180,7 @@ abstract class EVMChainClient {
data: data != null ? hexToBytes(data) : null,
maxGas: estimatedGasUnits,
maxFeePerGas: EtherAmount.fromInt(EtherUnit.wei, maxFeePerGas),
gasPrice: gasPrice != null ? EtherAmount.fromInt(EtherUnit.wei, gasPrice) : null,
);
Uint8List signedTransaction;
@ -224,6 +225,7 @@ abstract class EVMChainClient {
required EVMChainTransactionPriority priority,
required int exponent,
required String contractAddress,
int? gasPrice,
}) async {
final Transaction transaction = createTransaction(
@ -233,6 +235,7 @@ abstract class EVMChainClient {
amount: EtherAmount.zero(),
maxGas: estimatedGasUnits,
maxFeePerGas: EtherAmount.fromInt(EtherUnit.wei, maxFeePerGas),
gasPrice: gasPrice != null ? EtherAmount.fromInt(EtherUnit.wei, gasPrice) : null,
);
final erc20 = ERC20(