1

Hello guys,

I have a question

I try to smart contract functions from erc.json standarts with JavaScript. To example: I need a random number function with metamask user address(account number) referance for backend

To basicly:

Example JSON values:

    {
    inputs: [{ internalType: 'address', name: 'UserKey', type: 'address' }],
    name: 'RandomNumber',
    outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
    stateMutability: 'view',
    type: 'function',
  },

Example smart contract function:


        const daiToken = new web3.eth.Contract(
          ContractABI, // ABI
          address, // Sender address
          chainId
        )

        daiToken.methods
          .RandomNumber(address)
          .call(ContractABI)
          .then(function (result) {
            console.log(result)
          })
          .catch(function (err) {
            console.log(err, 'err')
          })

And here is the console prints:

ConsolePrint

i hope i explained :)

and happy weekends..

(updated new error)

zanthez
  • 45
  • 6

1 Answers1

1

Are you tried to change <React.StrictMode><App /><React.StrictMode> to <App /> in your index.js file?

Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79
  • 1
    Thanks for the answer but it didn't work. got rid of an external error thanks :) – zanthez Apr 30 '22 at 14:27
  • 1
    @zanthez Thank you for feedback. what error has remained? – Maik Lowrey Apr 30 '22 at 14:32
  • Actually, doing what you said did not provide a solution to the issue, it was an external error and it was there before this action. so i am where i started. maybe another way? :) – zanthez Apr 30 '22 at 14:34
  • hey @Maik Lowrey, i have a new step problem, i think it seems easier than the previous problem :) maybe if u want a check new error img? – zanthez May 01 '22 at 06:11