Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
161 views

Invalid opcode OR Cannot read properties of undefined (reading 'length') (depending on the situation)

I'm working on a bot that loads in a bunch of values from an array and uses an event handler to take action upon an event. This was originally built as a bot to monitor a swap on two exchanges for a ...
Trent Kennelly's user avatar
0 votes
0 answers
74 views

Calling ethers.Contract crashes NodeJS

On arbitrum network... const prABI = require('./gmx-interface-master/src/abis/PositionRouter.json'); const PositionRouter = await new ethers.Contract("0xb87a436B93fFE9D75c5cFA7bAcFff96430b09868&...
yunstun's user avatar
1 vote
2 answers
946 views

Calling a state-changing function with ethers.js does not go through (no error message, not asking for approval)

I have a contract function that I cannot call from the front-end using ethers.js for some reason. I cannot even debug this call because it doesnt produce any errors. I tried to break the call by ...
Nikita Kulikov's user avatar
5 votes
0 answers
4k views

Contract call: data out of bounds

I'm working on a nextjs/react project in which i want to fetch the health factor of an address on AAVE. This can be done by calling getUserAcountData(address) on the lending pool contract. I can ...
Conviley's user avatar
  • 390
1 vote
2 answers
397 views

How to read data returned by a function? [duplicate]

Counter.sol: pragma solidity >=0.5.0 <0.7.0; contract Counter { uint public _counter = 0; function GenNextID() public returns (uint) { return _counter++; } } I use ...
warchantua's user avatar
2 votes
2 answers
806 views

The method eth_sendTransaction does not exist/is not available, when using Ropsten Network

My following code previously works perfectly at Ganache, but when i switched it to Ropsten Network, it give captioned error. Here is Code: async function finalSettersFunctions(){ var myFunc; ...
Amir Ali's user avatar
  • 447
5 votes
2 answers
3k views

How to insert multiple transactions into One Block in Ganache GUI

Is it possible to enable Ganache GUI to put multiple transactions into ONE block ?. The details about Why i need this thing, is given below; I am going to test Transaction Order Dependence (TOD) ...
Amir Ali's user avatar
  • 447
2 votes
1 answer
92 views

How to pass encoded parameters to call contract getter fuctions

I have an array (i.e. functionNames[]) of getter functions's names of my contract and another array (i.e. finalGettersParams) of encoded parameters (which has been populated from web3.eth.abi....
Amir Ali's user avatar
  • 447
1 vote
1 answer
171 views

How to print the value of encoded getter functions of contract

UPDATED: Sorry for Inconvenience, I have updated all my question and accept my apology , being naive user. I have encoded getter functions of my contract i.e. ...
Amir Ali's user avatar
  • 447
1 vote
0 answers
139 views

How to check current status of state variables

I have deployed my contract locally into Ganache (GUI) and then send/call lot of transactions. After these transactions, now I want to check the current status of all state variables. Is there any way/...
Amir Ali's user avatar
  • 447
0 votes
0 answers
42 views

Dataset of simple contracts with getter setters

Are there any repositories/datasets which provide smart contract with simple logic like having some getters and setter functions. So, that I could give some values to getter and setter functions, ...
Amir Ali's user avatar
  • 447
0 votes
1 answer
977 views

Calling contract functions using only ABI without source code

I have MyContract.json file of some contract(assume i haven't its source code). In .json file, there is abi and bytecode. If i want to deploy such contract (through web3js), I am facing following ...
Amir Ali's user avatar
  • 447
0 votes
1 answer
296 views

How to call external payable contract function from app.js (DApp)?

The contract has a function: function purchaseTokens() external payable { require(msg.value>0); ...etceteras... } What I need is an app.js part, something that would look like this (lets ...
Damir Olejar's user avatar
0 votes
1 answer
430 views

How to know the execution time of transaction when miner execute it

When i send three consecutive transactions to my contract (deployed on ethereum testnet), how can i know the exact time (at milli/micro/nano level) which transaction executed (on miner side) first and ...
Amir Ali's user avatar
  • 447
0 votes
1 answer
64 views

State Variable of solidity Contract could not be updated through JavaScript

I have following contract and just want to update its state variable values i.e. totalSupply. But when I try to attempt this task through JavaScript code (given below) by calling its function i.e. ...
Amir Ali's user avatar
  • 447
0 votes
3 answers
66 views

Could not assign contract state variable value to javascript variable

I want to retrieve and assign the value of my contract state variable to my javascript variable.I am doing as per guidlines provided on this community, but failed to assigned. my javascript code is ...
Amir Ali's user avatar
  • 447
0 votes
1 answer
1k views

Calling a "view" function using web3js

--- HEAVILY EDITED --- Solidity contract: pragma solidity ^0.4.24; contract PatientRecords { struct Patient { string ID; string weight; string height; string diseasehistory; ...
Yakko Majuri's user avatar
1 vote
1 answer
46 views

Doubt in javascript function execution

hi guys I have this contract function: function teste(uint _oX) public returns (uint value) { return 34; } And I try to call in JS this way : MyContract.teste(1).then(value => console.log(...
neo-_-man's user avatar
0 votes
1 answer
469 views

Adding quotation marks to string before calling a function [closed]

Alright, so I'm not sure if I should be asking this here or HTML/JavaScript forums, so please do let me know if I am in the wrong place. I believe it belongs here as you all understand dApps and ...
Yakko Majuri's user avatar
1 vote
0 answers
91 views

encodeABI() throws Uncaught (in promise) Error

I am trying to use encodeABI() on one of my contract methods like this: signTx = async () => { ... const response = await contract.methods.recoverAddr(fixed_msg_sha, v_decimal, r, s)....
Lovro Bilješković's user avatar
1 vote
1 answer
69 views

How can I call a function in a smart contract that is inherited from another

Hi I am trying to call the function transfer , however in remix it says that I can only call the transferOwnership method, here is my solidity contract pragma solidity ^0.4.18; contract Ownable { ...
kquinn's user avatar
  • 23
0 votes
0 answers
415 views

Trying to call a method in a contract, invalid address error/Type Error

Hi I have a deployed contract pragma solidity ^0.4.0; contract adderr { int total; function adder() public { total = 0; } function getTotal() constant returns (int){ ...
kquinn's user avatar
  • 23
0 votes
1 answer
198 views

Why I do not get returned value of function of my smart contract using testRPC and a Graphical User Interface?

I have a smart contract that is tested with remix and it works well. Its code is as follows : contract Weechain: pragma solidity ^0.4.15; // --------------------------------------------------------...
Questioner's user avatar
  • 2,700
1 vote
0 answers
310 views

(browserify) Error : Cannot find module 'web3/lib/solidity/coder.js'

When I use command browserify viz.js -o main.js to build this project, I receive following error message : C:\Users\KX5710\Downloads\GUI_solarchain\solarchain-dashboard-master>browserify viz.js -o ...
Questioner's user avatar
  • 2,700
0 votes
0 answers
188 views

Problem of interacting with Smart Contract via HTML and JavaScript application

I followed and tested "Creating a Web UI for our Smart Contract" tutorial and it works well. However, when I do exactly what I did in the above tutorial for THIS SMART CONTRACT, I do not see the ...
Questioner's user avatar
  • 2,700
0 votes
1 answer
141 views

A common error at time of using web3 options

When i use some web3 options as follows, I receive a common error i.e. TypeError: web3.[option] is not a function For example : TypeError: web3.toAscii is not a function web3.toAscii(...
Questioner's user avatar
  • 2,700
4 votes
1 answer
3k views

How to send ether to an account instead of creating a smart contract using ethers.js

I would like to send some ether to an account in ropsten testnet. I'm using the following code and the library https://docs.ethers.io/ethers.js/html/. However, instead of sending the ether to the to ...
Pol Alvarez Vecino's user avatar
2 votes
1 answer
1k views

Truffle exec failure

I'm trying to run an external script in truffle. Basically I deploy the contracts with 'migrate' then want to run this script to set the variables. I just can't seem to get it to call correctly with:...
thefett's user avatar
  • 3,920
13 votes
7 answers
30k views

How to get value of a contract public property using web3.eth

using web3 javascript library how do you get the current value of a public property. e.g. contract MyContract { address public owner; ... } Here's a snippet of the abi: [{ "constant": ...
mkaj's user avatar
  • 517
3 votes
1 answer
3k views

Uncaught Type Error when calling a contract function using the web3 JavaScript API?

I wrote a contract to enable registration of a name. As an example, one of the functions takes in a name as a string, then outputs information on the registration of the name (name, registrant, last ...
jberm's user avatar
  • 116
2 votes
1 answer
750 views

How do I find a list of the Golem Network Token (GNT) TokenTrader contracts?

The Golem Network Token (GNT) TokenTrader contracts enables the trustless and decentralised sale of GNTs for ethers (ETH). A seller deploys one of these TokenTrader contracts using the ...
BokkyPooBah's user avatar
  • 40.4k
4 votes
2 answers
2k views

Solidity return string not hex?

Currently I'm using ether.camp to create a contract. At this stage it simply gets and stores some values. However when I try and get the values they are in bytes/hex even though the return type is ...
user1202278's user avatar
2 votes
0 answers
26 views

Recovering Contract Address varies every time [duplicate]

I have a contract datafactorycontract that calls another contract dataproducercontract. For that, in datafactorycontract I have a mapping that stores the address of the dataproducercontract being its ...
macordu's user avatar
  • 61