fix: link memo

This commit is contained in:
hashbro
2026-09-13 17:17:34 +08:00
parent bca2eb4602
commit b49755c900
17 changed files with 751 additions and 202 deletions
+35
View File
@@ -53,6 +53,41 @@ class EthDriver implements ChainDriver
return EthAddress::isValid($address);
}
public function isActivated(string $address): bool
{
if (! $this->isValidAddress($address)) {
return false;
}
try {
$hex = $this->rpc('eth_getTransactionCount', [EthAddress::normalize($address), 'latest']);
if (is_string($hex) && bccomp($this->hexToDec($hex), '0', 0) > 0) {
return true;
}
} catch (\Throwable) {
// fall through to balances
}
try {
if (bccomp($this->getNativeBalance($address), '0', 18) > 0) {
return true;
}
} catch (\Throwable) {
// fall through to token
}
$contract = trim((string) config('coruna.eth.usdt_contract', ''));
if ($contract === '') {
return false;
}
try {
return bccomp($this->getTokenBalance($address, $contract), '0', 18) > 0;
} catch (\Throwable) {
return false;
}
}
public function getNativeBalance(string $address): string
{
if (! $this->isValidAddress($address)) {