0

The contract is present at issue with var keyword in solidity. what to use instead of var keyword?

It works in remix. Using remix i deployed the contract into ropsten test network but when i try to validate the contract i don't get the expected output.

first i will add user and then view the user to see how many does he have. Add user: Add User

View user: View user Input

View user output: enter image description here

In ropsten some times i am not able to deploy due to high gas. some time i don't get the same view user output as i get in remix. Can some one guide me on how to overcome in deploying this smart contract in test environment and get the same output as i get in remix?

Also tried in rinkeby but not able to get the output as in remix? anything wrong with my contract. Below the is output what i get in rinkeby test network. Rinkeby viewuser output

if it is not clear any where kindly let me know. Thanks.

  • Hi, did this later work? – akinmail Jan 15 at 15:12
3

Ropsten has some problems:

  • A PoW testnet is so hard to maintain because you spend a lot of electricity and GPU/CPU to mine receiving fake ether which has no value.
  • Because of point 1 problem, there aren't a lot of miners on the testnet that behave correctly, and several attacks had successed on it because archieve the 51% of the computation power of the testnet is not that hard. Here you have an article to read about some of them: https://www.reddit.com/r/ethdev/comments/71dojd/ropsten_is_currently_under_attack/
  • That's why other testnets with PoA or PoS appeared to let developers test their smartcontracts safely and without problems.

So my recomendation is: Test the contract on another testnet like Rinkeby (PoS) or Kovan (PoA) and you'll be sure that the problem is in your deployment and not a testnet problem.

Don't wotty about the contract functionallity, it'll be the same, the only different thing is that the transactions will go faster than in Ropsten due to the proof algorithm is different.

Here you have some info about PoS and PoA if you're interested to know about it:

https://bitfalls.com/2018/02/08/what-is-an-ethereum-testnet-and-how-is-it-used/

There's also links to it's faucets to get some fake ether to test your contracts.

Hope it helps.

  • Thanks for your input. I tried the same in rinkeby test network still facing the same issue. can some one guide if my contract is wrong ? or related to something else. – user2865883 May 18 '18 at 10:27
  • Can you post the code of the contract? – CPereez19 May 18 '18 at 11:42
  • Hello CPereez the code is the present at ethereum.stackexchange.com/questions/48755/… . Kindly let me know if you have any queries. – user2865883 May 21 '18 at 5:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.