USER-20230908AJ\Administrator il y a 6 mois
Parent
commit
e7b9af4bb1
2 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 4 2
      app/Console/Commands/TestCommand.php
  2. 1 1
      app/Servers/BroadcastServer.php

+ 4 - 2
app/Console/Commands/TestCommand.php

@@ -6,6 +6,7 @@ use App\Models\Contract;
 use App\Models\MemberClan;
 use App\Servers\ContractServer;
 use App\Servers\Icon\BanRPC;
+use App\Servers\Icon\Utils;
 use BitWasp\Bitcoin\Bitcoin;
 use BitWasp\Bitcoin\Address\PayToPubKeyHashAddress;
 use BitWasp\Bitcoin\Crypto\Random\Random;
@@ -50,8 +51,9 @@ class TestCommand extends Command
      */
     public function handle()
     {
-        $bnb_block = BanRPC::creatServer()->sendBlockNumber();
-        dd($bnb_block);
+        dd(Utils::hex2dec('0x12a05f200'));
+//        $bnb_block = BanRPC::creatServer()->sendBlockNumber();
+//        dd($bnb_block);
         $random = new Random();
         // 生成随机数(initial entropy)
         $entropy = $random->bytes(Bip39Mnemonic::MIN_ENTROPY_BYTE_LEN);

+ 1 - 1
app/Servers/BroadcastServer.php

@@ -149,7 +149,7 @@ class BroadcastServer
             $transaction['chain_id'] = $bnbServer->chainId;
             $transaction['value'] = Utils::dec2hex(Utils::fund2int($value['money'] )); // 转账金额
             $transaction['data'] = '0x0';
-//        $transaction['data'] = Utils::decodeSolMethod('transfer(address,uint256)', [$value['to'], Utils::fund2int($value['money'], 18)]);
+        $transaction['data'] = Utils::decodeSolMethod('transfer(address,uint256)', [$value['to'], Utils::fund2int($value['money'], 18)]);
             $nonce = $bnbServer->getTransactionCount($value['from']);
             $transaction['nonce'] = $nonce;
             $gas_price = $bnbServer->getGasPrice();