Vrf를 테스트하고 있는데 오류가 발생하여 문의드립니다

안녕하세요. Orakl Network를 테스트하다가 오류가 발생했는데 원인을 알수 없어 문의드립니다.

Baobab 네트워크에 VRFConsumer.sol을 Klaytn Web Remix를 이용하여 배포했고 그때 주소는 "0x1F25691a5aCEAc1fa083e3B7C7403dC27421E3f6"로 확인했ㅅ브니다.

배포했을 때는 baobab.wallet.klaytn~~에서 생성한 지갑으로 배포하였습니다.


그리고나서 위와같이 Account를 생성하고

image
이 캡쳐화면처럼 데이터를 입력하고 transact를 눌러 실행했을 때


이런 오류가 발생했습니다

이 원인은 어떻게 해결해야할까요?

1 Like

안녕하세요. Orakl 팀의 Bryan 입니다.

개발팀과 논의하여 질문주신 내용에 명일까지 답변 드릴 수 있도록 하겠습니다.

감사합니다,
Bryan

안녕하세요 ToTheMoon님,

numWords파라미터 값이 최대값을 초과하여 발생한 것으로 추측됩니다.
하단 코드스니펫 참고하시어 numWords값을 조정하시면 좋을 것 같습니다

감사합니다

@Nick_Park 답변 감사합니다

안내해주신 코드스니펫을 참고해서 numWords값을 500미만으로 설정해서 호출해보았지만
동일하게 오류가 발생했습니다

결과로 받은 TxHash는 "0xcdd2e34f9a86814c0484b0ae21a91a703e39386812e7a552b8eca2b78d4c9312"이고 요청한 인자값들을 캡쳐해서 보내드립니다.

image

확인가능하실까요??

안녕하세요 ToTheMoon님, 제공해주신 정보만으로는 원인 파악이 쉽지 않아보입니다.
remix에 작성하신 코드를 혹시 공유해주실 수 있으실까요?

혹시 공유가 곤란하시다면
하단 예시 repository를 참고하셔서 코드를 다시 한번 확인해주시면 감사하겠습니다

@Nick_Park

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import {VRFConsumerBase} from "@bisonai/orakl-contracts/src/v0.1/VRFConsumerBase.sol";
import {IVRFCoordinator} from "@bisonai/orakl-contracts/src/v0.1/interfaces/IVRFCoordinator.sol";
import {IPrepayment} from "@bisonai/orakl-contracts/src/v0.1/interfaces/IPrepayment.sol";

contract VRFConsumer is VRFConsumerBase {
    uint256 public sRandomWord;
    address private sOwner;

    IVRFCoordinator COORDINATOR;

    error OnlyOwner(address notOwner);

    modifier onlyOwner() {
        if (msg.sender != sOwner) {
            revert OnlyOwner(msg.sender);
        }
        _;
    }

    constructor(address coordinator) VRFConsumerBase(coordinator) {
        sOwner = msg.sender;
        COORDINATOR = IVRFCoordinator(coordinator);
    }

    // Receive remaining payment from requestRandomWordsPayment
    receive() external payable {}

    function requestRandomWords(
        bytes32 keyHash,
        uint64 accId,
        uint32 callbackGasLimit,
        uint32 numWords
    ) public onlyOwner returns (uint256 requestId) {
        requestId = COORDINATOR.requestRandomWords(keyHash, accId, callbackGasLimit, numWords);
    }

    function requestRandomWordsDirect(
        bytes32 keyHash,
        uint32 callbackGasLimit,
        uint32 numWords,
        address refundRecipient
    ) public payable onlyOwner returns (uint256 requestId) {
        requestId = COORDINATOR.requestRandomWords{value: msg.value}(
            keyHash,
            callbackGasLimit,
            numWords,
            refundRecipient
        );
    }

    function fulfillRandomWords(
        uint256 /* requestId */,
        uint256[] memory randomWords
    ) internal override {
        // requestId should be checked if it matches the expected request
        // Generate random value between 1 and 50.
        sRandomWord = (randomWords[0] % 50) + 1;
    }

    function cancelRequest(uint256 requestId) external onlyOwner {
        COORDINATOR.cancelRequest(requestId);
    }

    function withdrawTemporary(uint64 accId) external onlyOwner {
        address prepaymentAddress = COORDINATOR.getPrepaymentAddress();
        IPrepayment(prepaymentAddress).withdrawTemporary(accId, payable(msg.sender));
    }
}

Git 소스에 공개된 Contract 그대로 사용했습니다
혹시몰라서 같이 공유드립니다.

확인 후 답변드리겠습니다 공유 감사합니다.

안녕하세요 ToTheMoon님,

방금 Remix에서 vrf consumer repository를 클론하여 호출을 성공적으로 하였습니다.
하단은 해당 txHash입니다

혹시 어떤식으로 코드를 클론하셨는지 알려주실 수 있을까요?

git repository의 master branch를 다운로드하고 web remix에 업로드해서 실행했습니다
Java로 호출할 때는 업로드한 VRFConsumer.sol파일을 Flattend하고 Wrapper클래스를 만들어 호출했었습니다.

혹시 업로드하는 방식 말고
workspaces → clone → https://github.com/Bisonai/vrf-consumer 입력하여 다시 한번 시도해주실 수 있을까요?
image

그래도 동일한 오류가 발생합니다…

예, 혹시 컨트랙트 배포 단계부터 다시 시도해보신걸까요?

네 컨트랙트 배포단계부터 다시 했었습니다


이고곳에 있는 VRF Coordinator address 주소를 입력하고 배포했습니다

넵,

공유해주신 accountId 764기준으로는 4.19일 이후로 새로 추가된 consumer 컨트랙트가 없는것 같은데, 혹시 컨트랙트 배포 후 consumer로 등록을 하셨을까요?

아… consumer로 등록은 안했습니다
등록하고 다시 해보겠습니다

정상적으로 호출되었습니다
다운로드해서 소스를 업로드하는 방식으로는 왜 안됐을까요…
일단 해당 Contract로 테스트해볼게요

감사합니다

1 Like

넵, 해결되셔서 다행입니다 :slight_smile:

아무래도 다운로드하여 업로드 하는 과정에서 참조 컨트랙트가 유실되었던게 아닐까 추측됩니다.

또 언제든지 문의 남겨주세요
감사합니다.

정상적으로 호출된 Contract파일을 Flattened를 해서 Java Wrapper Class를 만들고 Junit 테스트로 동일하게 호출했는데 오류가 발생했습니다.

– 오류문구

org.web3j.ens.EnsResolutionException: Unable to determine sync status of node

	at org.web3j.ens.EnsResolver.obtainPublicResolver(EnsResolver.java:78)
	at org.web3j.ens.EnsResolver.resolve(EnsResolver.java:88)
	at org.web3j.tx.Contract.resolveContractAddress(Contract.java:717)
	at org.web3j.tx.Contract.<init>(Contract.java:101)
	at org.web3j.tx.Contract.<init>(Contract.java:112)
	at orakl.VRFConsumer.<init>(VRFConsumer.java:54)
	at requestRandomWords(OraklTest.java:176)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
Caused by: org.web3j.ens.EnsResolutionException: Unable to resolve ENS registry contract for network id: 1001
	at org.web3j.ens.Contracts.resolveRegistryContract(Contracts.java:33)
	at org.web3j.ens.EnsResolver.lookupResolver(EnsResolver.java:140)
	at org.web3j.ens.EnsResolver.obtainPublicResolver(EnsResolver.java:75)
	... 39 more

– 소스부분

@Test
    public void requestRandomWords() throws Exception {
        caverKasNodeUrl = "https://public-en-baobab.klaytn.net";

        HttpService httpService = new HttpService(caverKasNodeUrl);
//        httpService.addHeader("Authorization", okhttp3.Credentials.basic(accessKey, secretAccessKey));
        httpService.addHeader("x-chain-id", kasChainId);

        // web3j 객체생성
        Web3j web3j = Web3j.build(httpService);
        Credentials credentials = Credentials.create(privateKey);
        BigInteger GAS_LIMIT = new BigInteger("2000000");

        EthGasPrice gas = web3j.ethGasPrice().send();
        BigInteger gasPrice = gas.getGasPrice();

        VRFConsumer vrfConsumer = new VRFConsumer(vrfConsumerAddress, web3j, credentials, new StaticGasProvider(gasPrice, GAS_LIMIT));
        byte[] keyHashByte = Numeric.hexStringToByteArray(keyHash);

        log.info("=============== {} : ", objectToString(vrfConsumer.requestRandomWords(keyHashByte, BigInteger.valueOf(accId), GAS_LIMIT, BigInteger.valueOf(100)).send()));
    }

– Java Wrapper Class

package io.mcc.goodmorn.admin.orakl;

import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the
 * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 4.10.3.
 */
@SuppressWarnings("rawtypes")
public class VRFConsumer extends Contract {
    public static final String BINARY = "60a0604052348015600e575f80fd5b50604051610840380380610840833981016040819052602b91605e565b6001600160a01b03166080819052600180546001600160a01b031990811633179091556002805490911690911790556089565b5f60208284031215606d575f80fd5b81516001600160a01b03811681146082575f80fd5b9392505050565b6080516107986100a85f395f818161022d015261026f01526107985ff3fe608060405260043610610057575f3560e01c80630e5ff996146100625780631964176c146100885780631fe543e3146100a95780632f34077b146100c85780633015394c146100e7578063666e24aa14610106575f80fd5b3661005e57005b5f80fd5b34801561006d575f80fd5b506100765f5481565b60405190815260200160405180910390f35b348015610093575f80fd5b506100a76100a2366004610508565b610119565b005b3480156100b4575f80fd5b506100a76100c336600461053c565b610222565b3480156100d3575f80fd5b506100766100e2366004610614565b6102aa565b3480156100f2575f80fd5b506100a761010136600461065e565b610372565b61007661011436600461068c565b6103fb565b6001546001600160a01b0316331461014b57604051630543601560e11b81523360048201526024015b60405180910390fd5b600254604080516353486bd760e11b815290515f926001600160a01b03169163a690d7ae916004808301926020929190829003018187875af1158015610193573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101b791906106d8565b604051637813198560e11b815267ffffffffffffffff841660048201523360248201529091506001600160a01b0382169063f026330a906044015f604051808303815f87803b158015610208575f80fd5b505af115801561021a573d5f803e3d5ffd5b505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461029c5760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610142565b6102a682826104b5565b5050565b6001545f906001600160a01b031633146102d957604051630543601560e11b8152336004820152602401610142565b600254604051632f34077b60e01b81526004810187905267ffffffffffffffff8616602482015263ffffffff8086166044830152841660648201526001600160a01b0390911690632f34077b906084016020604051808303815f875af1158015610345573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061036991906106f3565b95945050505050565b6001546001600160a01b0316331461039f57604051630543601560e11b8152336004820152602401610142565b600254604051630c054e5360e21b8152600481018390526001600160a01b0390911690633015394c906024015f604051808303815f87803b1580156103e2575f80fd5b505af11580156103f4573d5f803e3d5ffd5b5050505050565b6001545f906001600160a01b0316331461042a57604051630543601560e11b8152336004820152602401610142565b6002546040516307a97fe360e11b81526004810187905263ffffffff8087166024830152851660448201526001600160a01b03848116606483015290911690630f52ffc690349060840160206040518083038185885af1158015610490573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061036991906106f3565b6032815f815181106104c9576104c961070a565b60200260200101516104db919061071e565b6104e690600161073d565b5f555050565b803567ffffffffffffffff81168114610503575f80fd5b919050565b5f60208284031215610518575f80fd5b610521826104ec565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561054d575f80fd5b8235915060208084013567ffffffffffffffff8082111561056c575f80fd5b818601915086601f83011261057f575f80fd5b81358181111561059157610591610528565b8060051b604051601f19603f830116810181811085821117156105b6576105b6610528565b6040529182528482019250838101850191898311156105d3575f80fd5b938501935b828510156105f1578435845293850193928501926105d8565b8096505050505050509250929050565b803563ffffffff81168114610503575f80fd5b5f805f8060808587031215610627575f80fd5b84359350610637602086016104ec565b925061064560408601610601565b915061065360608601610601565b905092959194509250565b5f6020828403121561066e575f80fd5b5035919050565b6001600160a01b0381168114610689575f80fd5b50565b5f805f806080858703121561069f575f80fd5b843593506106af60208601610601565b92506106bd60408601610601565b915060608501356106cd81610675565b939692955090935050565b5f602082840312156106e8575f80fd5b815161052181610675565b5f60208284031215610703575f80fd5b5051919050565b634e487b7160e01b5f52603260045260245ffd5b5f8261073857634e487b7160e01b5f52601260045260245ffd5b500690565b8082018082111561075c57634e487b7160e01b5f52601160045260245ffd5b9291505056fea2646970667358221220fef585109ddbf67e031bb5324b9989448de0d4b100f209bf69b3656d0ae183b264736f6c63430008190033";

    public static final String FUNC_CANCELREQUEST = "cancelRequest";

    public static final String FUNC_RAWFULFILLRANDOMWORDS = "rawFulfillRandomWords";

    public static final String FUNC_REQUESTRANDOMWORDS = "requestRandomWords";

    public static final String FUNC_REQUESTRANDOMWORDSDIRECT = "requestRandomWordsDirect";

    public static final String FUNC_SRANDOMWORD = "sRandomWord";

    public static final String FUNC_WITHDRAWTEMPORARY = "withdrawTemporary";

    @Deprecated
    public VRFConsumer(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    public VRFConsumer(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    public VRFConsumer(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public VRFConsumer(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public RemoteFunctionCall<TransactionReceipt> cancelRequest(BigInteger requestId) {
        final Function function = new Function(
                FUNC_CANCELREQUEST,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(requestId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> rawFulfillRandomWords(BigInteger requestId, BigInteger randomWord) {
        List<BigInteger> randomWords = new ArrayList<>();
        randomWords.add(randomWord);

        final Function function = new Function(
                FUNC_RAWFULFILLRANDOMWORDS,
                Arrays.<Type>asList(new Uint256(requestId),
                        new org.web3j.abi.datatypes.DynamicArray<Uint256>(
                                Uint256.class,
                                org.web3j.abi.Utils.typeMap(randomWords, Uint256.class))),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> rawFulfillRandomWords(BigInteger requestId, List<BigInteger> randomWords) {
        final Function function = new Function(
                FUNC_RAWFULFILLRANDOMWORDS,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(requestId),
                        new org.web3j.abi.datatypes.DynamicArray<org.web3j.abi.datatypes.generated.Uint256>(
                                org.web3j.abi.datatypes.generated.Uint256.class,
                                org.web3j.abi.Utils.typeMap(randomWords, org.web3j.abi.datatypes.generated.Uint256.class))),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> requestRandomWords(byte[] keyHash, BigInteger accId, BigInteger callbackGasLimit, BigInteger numWords) {
        final Function function = new Function(
                FUNC_REQUESTRANDOMWORDS,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(keyHash),
                        new org.web3j.abi.datatypes.generated.Uint64(accId),
                        new org.web3j.abi.datatypes.generated.Uint32(callbackGasLimit),
                        new org.web3j.abi.datatypes.generated.Uint32(numWords)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> requestRandomWordsDirect(byte[] keyHash, BigInteger callbackGasLimit, BigInteger numWords, String refundRecipient, BigInteger weiValue) {
        final Function function = new Function(
                FUNC_REQUESTRANDOMWORDSDIRECT,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(keyHash),
                        new org.web3j.abi.datatypes.generated.Uint32(callbackGasLimit),
                        new org.web3j.abi.datatypes.generated.Uint32(numWords),
                        new org.web3j.abi.datatypes.Address(160, refundRecipient)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function, weiValue);
    }

    public RemoteFunctionCall<BigInteger> sRandomWord() {
        final Function function = new Function(FUNC_SRANDOMWORD,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> withdrawTemporary(BigInteger accId) {
        final Function function = new Function(
                FUNC_WITHDRAWTEMPORARY,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(accId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    @Deprecated
    public static VRFConsumer load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return new VRFConsumer(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static VRFConsumer load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new VRFConsumer(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static VRFConsumer load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return new VRFConsumer(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static VRFConsumer load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new VRFConsumer(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<VRFConsumer> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String coordinator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, coordinator)));
        return deployRemoteCall(VRFConsumer.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor);
    }

    public static RemoteCall<VRFConsumer> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String coordinator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, coordinator)));
        return deployRemoteCall(VRFConsumer.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<VRFConsumer> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String coordinator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, coordinator)));
        return deployRemoteCall(VRFConsumer.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<VRFConsumer> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String coordinator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, coordinator)));
        return deployRemoteCall(VRFConsumer.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor);
    }
}

1001인 테스트넷으로 연결을 못한거 같은데 배포가 잘못된걸까요??
Baobab에서는 제가 배포한 Contract 주소"0xb96fa1c69f5e7809c6a6476cdf9cd70bdd3ac8108a0010fadb2cc2763046737f"는 조회할 수 있었습니다.

java를 통한 배포나 호출은 시도해보지 않아 정확하게는 모르겠으나
말씀하신 주소 0xb96fa1c69f5e7809c6a6476cdf9cd70bdd3ac8108a0010fadb2cc2763046737f는 컨트랙트 주소가 아니라 트랜잭션 해쉬인 것으로 보입니다.

혹시 주소를 다시 한번 확인해주실 수 있을까요?

아… 죄송힙니다… 제가 주소를 잘못입력했엇네요…
정상적으로 확인했습니다

1 Like