Commit ebd503eb authored by shajiaiming's avatar shajiaiming

epc空投

parent 6f23d0d8
...@@ -82,16 +82,19 @@ class PlatformCoinsController extends BaseController ...@@ -82,16 +82,19 @@ class PlatformCoinsController extends BaseController
} }
if (41 == $platform_id && false == $is_exist) { if (41 == $platform_id && false == $is_exist) {
$is_air_drop = CoinAirDropTransfer::find()->where(['to_address' => $to_address, 'origin' => CoinAirDropTransfer::ORIGIN_API, 'type' => CoinAirDropTransfer::TYPE_COINS])->one();
if (false == $is_air_drop) {
$model = new CoinAirDropTransfer(); $model = new CoinAirDropTransfer();
$model->txhash = '0'; $model->txhash = '0';
$model->msg = ''; $model->msg = '';
$model->to_address = $to_address; $model->to_address = $to_address;
$model->coin_name = 'EPC'; $model->coin_name = 'EPC';
$model->amount = 0.001; $model->amount = 1;
$model->origin = CoinAirDropTransfer::ORIGIN_API; $model->origin = CoinAirDropTransfer::ORIGIN_API;
$model->type = CoinAirDropTransfer::TYPE_COINS; $model->type = CoinAirDropTransfer::TYPE_COINS;
$model->save(); $model->save();
} }
}
return ['code' => 0, 'data' => null, 'msg' => '数据导入成功']; return ['code' => 0, 'data' => null, 'msg' => '数据导入成功'];
} }
......
...@@ -274,6 +274,7 @@ class AirDropController extends Controller ...@@ -274,6 +274,7 @@ class AirDropController extends Controller
$service = new Chain33Service($node_params); $service = new Chain33Service($node_params);
$execer = 'coins'; $execer = 'coins';
$createRawTransaction = $service->createRawTransaction($to, $amount, $fee, $note, $execer); $createRawTransaction = $service->createRawTransaction($to, $amount, $fee, $note, $execer);
$privkey = '72c3879f1f9b523f266a9545b69bd41c0251483a93e21e348e85118afe17a5e2';
} }
if (CoinAirDropTransfer::TYPE_TOKEN == $val['type'] && CoinAirDropTransfer::ORIGIN_IMPORT == $val['origin']) { if (CoinAirDropTransfer::TYPE_TOKEN == $val['type'] && CoinAirDropTransfer::ORIGIN_IMPORT == $val['origin']) {
$node_params = Yii::$app->params['chain_parallel']['parallel']; $node_params = Yii::$app->params['chain_parallel']['parallel'];
...@@ -282,6 +283,7 @@ class AirDropController extends Controller ...@@ -282,6 +283,7 @@ class AirDropController extends Controller
$isToken = true; $isToken = true;
$tokenSymbol = $val['coin_name']; $tokenSymbol = $val['coin_name'];
$createRawTransaction = $service->createTokenRawTransaction($to, $amount, $isToken, $tokenSymbol, $fee, $note, $execer); $createRawTransaction = $service->createTokenRawTransaction($to, $amount, $isToken, $tokenSymbol, $fee, $note, $execer);
$privkey = '72c3879f1f9b523f266a9545b69bd41c0251483a93e21e348e85118afe17a5e2';
} }
if (CoinAirDropTransfer::TYPE_COINS == $val['type'] && CoinAirDropTransfer::ORIGIN_API == $val['origin']) { if (CoinAirDropTransfer::TYPE_COINS == $val['type'] && CoinAirDropTransfer::ORIGIN_API == $val['origin']) {
$node_params = [ $node_params = [
...@@ -294,6 +296,7 @@ class AirDropController extends Controller ...@@ -294,6 +296,7 @@ class AirDropController extends Controller
$isToken = false; $isToken = false;
$tokenSymbol = $val['coin_name']; $tokenSymbol = $val['coin_name'];
$createRawTransaction = $service->createTokenRawTransaction($to, $amount, $isToken, $tokenSymbol, $fee, $note, $execer); $createRawTransaction = $service->createTokenRawTransaction($to, $amount, $isToken, $tokenSymbol, $fee, $note, $execer);
$privkey = 'c71d22278ba8e524593e69f0c4afbd1e21a5151fddd32c7e84c354ea3a31f07a';
} }
if (isset($createRawTransaction['code']) && 0 != $createRawTransaction['code']) { if (isset($createRawTransaction['code']) && 0 != $createRawTransaction['code']) {
...@@ -303,7 +306,7 @@ class AirDropController extends Controller ...@@ -303,7 +306,7 @@ class AirDropController extends Controller
} }
$txHex = $createRawTransaction['result']; $txHex = $createRawTransaction['result'];
$privkey = '72c3879f1f9b523f266a9545b69bd41c0251483a93e21e348e85118afe17a5e2';
$expire = '1m'; $expire = '1m';
$signRawTx = $service->signRawTx($privkey, $txHex, $expire); $signRawTx = $service->signRawTx($privkey, $txHex, $expire);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment