xiaoyong931011
2023-08-08 11f6a8c911c5ef241f42953976661a249aa8b83e
src/main/java/cc/mrbird/febs/dapp/contract/andao/AndaoContractMain.java
@@ -29,7 +29,7 @@
@Component
@ConditionalOnProperty(prefix = "system", name = "quartz-job", havingValue = "true")
@ConditionalOnProperty(prefix = "system", name = "chain-listener", havingValue = "true")
public class AndaoContractMain {
    @Autowired
@@ -77,6 +77,12 @@
    }
    private static Web3j getInstanceScope() {
        HttpService httpService = new HttpService(blockchainNode);
        return Web3j.build(httpService);
    }
    private static Web3j getInstanceScopes() {
        HttpService httpService = new HttpService(blockchainNode);
        return Web3j.build(httpService);
@@ -170,7 +176,7 @@
        System.out.println("启动投注监听事件");
        // 指定密钥文件并进行账号和密码的验证
        Credentials credentials = Credentials.create(privateKey);
        Abi contract = Abi.load(contractAddr, getInstanceScope(), credentials, new DefaultGasProvider());
        Abi contract = Abi.load(contractAddr, getInstanceScopes(), credentials, new DefaultGasProvider());
        EthFilter filter = getFilter(startBlock);
        contract.withdrawnEventFlowable(filter).subscribe(e->{
            try {
@@ -225,7 +231,7 @@
    public static void main(String[] args) {
        AndaoContractMain andaoContractMain = new AndaoContractMain();
        String address = "0x7a9bfE048d110EF90a467803653f9B8666f9096C";
        String address = "0xA60AaC0da34C76F3f60207ee09e9F75043319ab4";
        BigInteger bigInteger = new BigInteger(Convert.toWei("1", Convert.Unit.ETHER).setScale(0).toString());
        String hash = andaoContractMain.trans(bigInteger,address);
        System.out.println(hash);