DAPP云算力質(zhì)押項(xiàng)目挖礦系統(tǒng)開發(fā)實(shí)現(xiàn)技術(shù)案例及代碼部署
DApp是指去中心化應(yīng)用,And one of the key concepts is smart contracts.A contract is a common regulation that is similar to a contract,agreement,contract,etc.And smart contracts are electronic contracts,digital contracts,and intelligent contracts,是將合同合約用代碼寫成一段程序。
DApp即為智能合約+App。從開發(fā)人員的角度來看,DApp是前端界面+智能合約。前端是與用戶交互的部分,用戶可以選擇各種命令。而智能合約則與區(qū)塊鏈(分布式數(shù)據(jù)庫)交互。
_,routerTx,_,err:=DeployToken(transactOpts,client,facR,wethR)
result,routerAddr:=getResult(client,routerTx.Hash())
if!result{
fatallog.Fatal("sendBaseContract routerTx",err)
return
}
mapTran,err:=cdc.NewTokenc(mapTR,client)
atx,err:=mapTran.Approve(transactOpts,routerAddr,new(big.Int).SetUint64(1000000000000000000))
result,_=getResult(client,atx.Hash())
if!result{
fatallog.Fatal("sendBaseContract atx",err)
return
}
tik:=new(big.Int).SetUint64(10000000000000000)
tik1:=new(big.Int).SetUint64(1000000000000)
transactOpts.Value=new(big.Int).SetUint64(1000000000000000000)
RTran,err:=NewToken(routerAddr,client)
aHash,_:=RTran.AddLiquidityETH(transactOpts,mapTR,tik,tik,tik1,addr,new(big.Int).SetUint64(1699658290))
result,_=getResult(client,aHash.Hash())