区块链技术作为一种前沿技术,其特有的区块链技术、分布式记账、区块链智能合约、防篡改及可溯源性的技术特点与电商存在非常高的匹配度。
区块链被认为是互联网发明以来最具有颠覆性的技术创新。区块链融合了密码学、经济学、博弈论以及计算机学科等多个学科,具有交易不可逆、数据不可篡改的特点,在很多领域具备商业价值,应用研究已拓展至金融、能源、物流、教育、文化和社会服务等领域。
区块链助推供应链上的数据更加透明,供应链上的企业可以准确的使用端到端的透明数据,区块链技术可以有效的对供应链上企业的交易进行数字化的处理,并且可以建立一个分散式的不可更改的所有交易记录,可以实现数据的实时共享,有效的降低数据信息获取的时间成本。
随着区块链技术的普及,智慧供应链下的数字经济将会更加真实可信,,随着区块链在供应链领域的深入应用与发展,未来的数字经济社会将会变得更加公正和透明
Liquidity mining usually requires the pledge of loan vouchers or LP vouchers.In other words,instead of pledging native tokens to obtain liquidity mining rewards,users need to first pledge native tokens in DeFi,obtain vouchers,and then pledge the vouchers to a specified contract to obtain liquidity mining rewards.
//remove bsv and token from liquidity pool
public function removeLiquidity(PubKey sender,int lpAmount,Sig senderSig,int oldTokenBalance,int senderKeyIndex,int senderBalance,
int lpSenderBalance,int lpSenderKeyIndex,SigHashPreimage txPreimage){
require(checkSig(senderSig,sender));
int oldBsvBalance=SigHash.value(txPreimage);
//withdraw amount
int bsvAmount=oldBsvBalance*lpAmount/this.lpToken.totalSupply();
int tokenAmount=oldTokenBalance*lpAmount/this.lpToken.totalSupply();
//burn the lp tokens
require(this.lpToken.burn(sender,lpSenderBalance,lpAmount,lpSenderKeyIndex));
//transfer tokens from pool to the sender
require(this.token.transferFrom(this.poolPubkey,sender,tokenAmount,oldTokenBalance,senderKeyIndex,senderBalance,senderKeyIndex));
//transfer bsvs to the sender
int newBsvBalance=oldBsvBalance-bsvAmount;
require(this.propagateState(newBsvBalance,txPreimage));
}
//swap tokens for bsvs
public function swapTokenToBsv(PubKey sender,int tokenAmount,Sig senderSig,int senderBalance,int senderKeyIndex,int oldTokenBalance,
int lpSenderBalance,SigHashPreimage txPreimage){
require(checkSig(senderSig,sender));
int oldBsvBalance=SigHash.value(txPreimage);
//calculate bsvs in return
int bsvsAmount=this.getAmount(tokenAmount,oldTokenBalance,oldBsvBalance);
int newBsvBalance=oldBsvBalance-bsvsAmount;
//transfer tokens to the pool
require(this.token.transferFrom(sender,this.poolPubkey,tokenAmount,senderBalance,senderKeyIndex,oldTokenBalance,senderKeyIndex));
require(this.propagateState(newBsvBalance,txPreimage));
}