mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-29 12:59:52 +00:00
CW-615-Add-Check-For-Contract-Address (#1387)
* feat: Check if address is a valid Externally Owned Address * feat: Check if the EVM address received when exchanging tokens is a valid EOA address * move the contract address check to be only in the case of ThorChain [skip ci] * some enhancements * feat: Implement check for contract address for inputAddress when exchanging to ETH * fix: Remove previous implementation and clean up current implementation for the check for contract address * chore: Remove unneed space * chore: Remove unneed space --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
dcfb2b2b73
commit
2ac81250c2
30 changed files with 146 additions and 18 deletions
|
@ -324,14 +324,16 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
Future<PendingTransaction?> createTransaction({ExchangeProvider? provider}) async {
|
||||
try {
|
||||
state = IsExecutingState();
|
||||
|
||||
pendingTransaction = await wallet.createTransaction(_credentials());
|
||||
if (provider is ThorChainExchangeProvider) {
|
||||
final outputCount = pendingTransaction?.outputCount ?? 0;
|
||||
if (outputCount > 10) {
|
||||
throw Exception("ThorChain does not support more than 10 outputs");
|
||||
throw Exception("THORChain does not support more than 10 outputs");
|
||||
}
|
||||
|
||||
if (_hasTaprootInput(pendingTransaction)) {
|
||||
throw Exception("ThorChain does not support Taproot addresses");
|
||||
throw Exception("THORChain does not support Taproot addresses");
|
||||
}
|
||||
}
|
||||
state = ExecutedSuccessfullyState();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue