Java实现以太坊空投工具

以太坊空投工具实现
代码展示

public class AirDropContract {
    
    
    // TODO: 节点URL
    private final static Web3j web3j = Web3j.build(new HttpService(""));
    // TODO: 代币合约地址
    public static final String coinAddress = "";
    // TODO: 部署合约地址
    public static final String contractaAddress = "";
    public static final BigInteger erc20GasLimit = new BigInteger("200000");
    // TODO: 支付的矿工费gas价格 100 Gwei
    public static final BigInteger gasPrice = new BigInteger("100000000000");
    // TODO: 授权数量 10000000000 代币 10000000000 = 10000000000 00000000000000  精度16
    public static final BigInteger approveAmount = new BigInteger("1000000000000000000000000");
    // TODO: 管理者地址
    public static final String mainAddress = "";
    // TODO: 管理者私钥
    public static final String mainPrivatekey = "";

    public static void main(String[] args) {
    
    
        // TODO: 添加需要空投的地址  add里填需要被空投的地址即可
        List<String> toAddressList = new ArrayList<>();
        toAddressList.add("");
        toAddressList.add("");
        List<BigInteger> value = new ArrayList<>();
        //	1000000000000000 = 0.1
        // TODO: 添加需要空投的金额
        value.add(new BigInteger("1000000000000000"));
        value.add(new BigInteger("1000000000000000"));
        // TODO: 1.先授权金额 能查询到授权则可转账  先完成第一步才可以走第二步
//        approve(mainAddress, mainPrivatekey);
//        allow(mainAddress, mainPrivatekey);
        // TODO: 2.批量转账 一对多
        //signTokenTransactionList(toAddressList, value, mainAddress, mainPrivatekey);
    }
}

这里是空投的测试网GBZZ代币

效果图
hash链接在这里插入图片描述
有疑问可加Q1172243570咨询

猜你喜欢

转载自blog.csdn.net/JST888_K/article/details/117651265