Skip to content

Commit

Permalink
remove token transfer contract method as its incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley committed Jan 31, 2025
1 parent 94c04df commit f3e0411
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/CacheTransactionsTokenName.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class CacheTransactionsTokenName extends Command
public function handle(TokenTransferCache $cache): void
{
/** @var Collection<int, Transaction> $transactions */
$transactions = Transaction::withScope(ContractDeploymentScope::class, ContractMethod::transfer())->get();
$transactions = Transaction::withScope(ContractDeploymentScope::class)->get();

foreach ($transactions as $transaction) {
if ($transaction->receipt === null) {
Expand Down
5 changes: 0 additions & 5 deletions app/Enums/ContractMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ public static function transfer(): ?string
return Network::contractMethod('transfer', 'a9059cbb');
}

public static function tokenTransfer(): ?string
{
return Network::contractMethod('token_transfer', '06fdde03');
}

public static function multiPayment(): ?string
{
return Network::contractMethod('multipayment', '084ce708');
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Transactions/TransactionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function isTransfer(): bool

public function isTokenTransfer(): bool
{
return $this->methodHash === ContractMethod::tokenTransfer();
return $this->methodHash === ContractMethod::transfer();
}

public function isMultiPayment(): bool
Expand Down
2 changes: 1 addition & 1 deletion database/factories/TransactionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function transfer(): Factory

public function tokenTransfer(string $address, int $amount, string $recipient): Factory
{
$payload = ContractMethod::tokenTransfer();
$payload = ContractMethod::transfer();
$payload .= str_pad(preg_replace('/^0x/', '', $address), 64, '0', STR_PAD_LEFT);
$payload .= str_pad(dechex($amount), 64, '0', STR_PAD_LEFT);

Expand Down

0 comments on commit f3e0411

Please sign in to comment.