Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 34 characters in body
Source Link

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
event AgreementCalled(address[] indexed initialParticipants);
function createAgreement(address[] memory initialParticipants) external {
    emit AgreementCalled (initialParticipants);
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26["0x26..7b'7b", '0xeA8"0xeA8..A3e'A3e" ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • UsinUsing Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache
  • From Remix it works just fine

Any idea on what can be going on?

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
event AgreementCalled(address[] indexed initialParticipants);
function createAgreement(address[] memory initialParticipants) external {
    emit AgreementCalled (initialParticipants);
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26..7b', '0xeA8..A3e' ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • Usin Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache

Any idea on what can be going on?

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
event AgreementCalled(address[] indexed initialParticipants);
function createAgreement(address[] memory initialParticipants) external {
    emit AgreementCalled (initialParticipants);
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(["0x26..7b", "0xeA8..A3e" ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • Using Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache
  • From Remix it works just fine

Any idea on what can be going on?

deleted 237 characters in body
Source Link

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
 event AgreementCalled(address[] indexed initialParticipants);
function createAgreement(        
        address[] memory initialParticipants
        
    ) external returns (address){
        agreement =emit newAgreementCalled Agreement(initialParticipants);
        return address(agreement);
        
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26..7b', '0xeA8..A3e' ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • If I remove all the internal logic, such as the new Agreement, I still get the same error. This pretty much ensures the problem is sending a parameter to a Solidity function with send
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • Usin Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache

Any idea on what can be going on?

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
    function createAgreement(        
        address[] memory initialParticipants
        
    ) external returns (address){
        agreement = new Agreement(initialParticipants);
        return address(agreement);
        
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26..7b', '0xeA8..A3e' ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • If I remove all the internal logic, such as the new Agreement, I still get the same error. This pretty much ensures the problem is sending a parameter to a Solidity function with send
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • Usin Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache

Any idea on what can be going on?

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
event AgreementCalled(address[] indexed initialParticipants);
function createAgreement(address[] memory initialParticipants) external {
    emit AgreementCalled (initialParticipants);
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26..7b', '0xeA8..A3e' ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • Usin Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache

Any idea on what can be going on?

added 261 characters in body
Source Link

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
    function createAgreement(        
        address[] memory initialParticipants
        
    ) external returns (address){
        agreement = new Agreement(initialParticipants);
        return address(agreement);
        
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26..7b', '0xeA8..A3e' ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • If I remove all the internal logic, such as the new Agreement, I still get the same error. This pretty much ensures the problem is sending a parameter to a Solidity function with send
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • Usin Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache

Any idea on what can be going on?

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
    function createAgreement(        
        address[] memory initialParticipants
        
    ) external returns (address){
        agreement = new Agreement(initialParticipants);
        return address(agreement);
        
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26..7b', '0xeA8..A3e' ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},
  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • If I remove all the internal logic, such as the new Agreement, I still get the same error. This pretty much ensures the problem is sending a parameter to a Solidity function with send
  • Usin Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache

Any idea on what can be going on?

I'm trying to call a function with parameters with web3 v1.7.0 .send() method which works fine without any parameters but fails when including them.

A simplified version:

contract Master{
constructor() {}
    function createAgreement(        
        address[] memory initialParticipants
        
    ) external returns (address){
        agreement = new Agreement(initialParticipants);
        return address(agreement);
        
    }
}

called from Javascript with web3

let contractTransaction =  await MasterContract.methods.createAgreement(['0x26..7b', '0xeA8..A3e' ])
          .send({from:currentAccount});

I get the following console error

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x680b1ed2c6c24f5150a4fa5d1c764d134d25ab122e14891a2348087e6e7eb51e":{"error":"revert","program_counter":81,"return":"0x"},

Interestingly enough, Ganache UI shows the transaction, including the array Ganache displays values

  • If I remove the parameter (an array of addresses) it works fine, like so: MasterContract.methods.createAgreement().send({from:currentAccount});
  • If I change the array with a simple string both in the contract and javascript, I get the same error.
  • If I remove all the internal logic, such as the new Agreement, I still get the same error. This pretty much ensures the problem is sending a parameter to a Solidity function with send
  • Adding lots of gas, like .send({from:this.eth.currentAccount, gas: 10000000}) doesn't solve it
  • Usin Web3 1.7.0, solidity >=0.7.0 <0.9.0, Ganache

Any idea on what can be going on?

Source Link
Loading