0

I have the following code:

Solidity contract

pragma solidity ^0.8.9;

contract Ctr {

  string[] private array;

  /*
  *  Stack element to array.
  *
  * @returns {uint256} Element Index.
  */
  function pushArr(string memory data) public returns(uint256) {
    array.push(data);

    return array.length-1;
  }
}

JS code interacting with contract

//
// this one returns only TX metadata, not the returned index.
//
console.log( await deployedTruffleContract.pushArr("some data", {
  from: "0x......."
});

Is it possible to retrieve the value from a typical "send" request?

0

Browse other questions tagged or ask your own question.