关于合约 在薄饼交易

各位大佬 打扰一下。 下面的这段代码 在薄饼上可以交易

if(totalSupply()>100000*10**18){
            amount =amount.sub(burnTokens);
            _burn(from,burnTokens);

        }

        super._transfer(from, address(this), fees);

下面的这段代码 在薄饼上却交易失败。纠结了半天,哪位大佬帮忙看看 getReferralRelationship方法是正常的

       address referrer;
        if (from==uniswapV2Pair){
            referrer=getReferralRelationship(to); 
        }else {
            referrer=getReferralRelationship(from); 
        }

        if (referrer!=address(0)){
            amount=amount.sub(invitationAmount1);
            super._transfer(from, referrer, invitationAmount1);
            address indirectReferrer=getReferralRelationship(referrer); 

            if(indirectReferrer!=address(0)){
                amount = amount.sub(invitationAmount2);
                super._transfer(from, indirectReferrer, invitationAmount2);

            }else{
                super._transfer(from, address(this), invitationAmount2);
            }

        }else{
            super._transfer(from, address(this), invitationAmount1);
        }

        super._transfer(from, address(this), fees);`
请先 登录 后评论

1 个回答

lanjue
请先 登录 后评论
  • 1 关注
  • 0 收藏,2208 浏览
  • 提出于 2022-05-09 23:16