Sunday, December 23, 2018

ABI file misses some functions

While developing application with truffle it gives me this error

Uncaught (in promise): TypeError: ..... is not a function

Where as that function was present in my solidity code. I checked the abi file and figure out that the abi file is not having that function

Solution:

1) Delete the json file created
 2) Stop the TestRpc server
3) truffle network --clean
4) Compile again truffle compile

Error: insufficient data for uint128 type (arg="", coderType="uint128", value="0x00")

Error : Error: insufficient data for uint128 type (arg="", coderType="uint128", value="0x00")

I got this error message while deploying the contract. The issue comes up when i upgraded the solidity and truffle version as a result when i compile the code through truffle it throws me this error. This error happens when the address of the contract is not found which indicates some errors due to upgrade of version. After removing the error this error would be solve , further when yu have to deploy the contract you have to delete all the json file created

Thursday, September 13, 2018

truffle deploy not working


For some reason truffle shows me the contracts are deployed but actually they were not

$ truffle deploy
Using network 'development'.

Network up to date.

Solution: After checking i figure out the migration files were deleted and after having those file it works . A better addressing of error would save lots of time
 

ERROR Error: "Uncaught (in promise): Error: Users has not been deployed to detected network

This indicates that Json file of the contract has not correct network data
"networks": {},
"schemaVersion": "2.0.0",
"updatedAt": "2018-09-14T01:14:54.565Z"

To overcome that compile and deploy the contract again , if error remains re launch the testrpc

MetaMask - RPC Error: Error: Error: [ethjs-rpc] rpc error with payload

This error happen because of no amount or less amount in the account

Returning Array in Solidity

As still in the solidity the dynamic data of array is not supported or if you use pragma experimental ABIEncoderV2; you have to use the storage to store the data in the array that would be costly as every time you access the function you have to pay to execute the function.

One solution is to do multiple quieries from the client side and on the server side respone according the key of the data and everytime send the key to get the result

MetaMask takes long time and showing loading gif

Solution:

Just change the network of the metamask from top right to the main network and gif will be gone.
After that login to the metamask and change the network you want
 

Error: Expected parameter 'from' not passed to function.

I faced this problem while running Truffle. This error appears as my laptop restarted.

For me the software Parity Ethereum was running and after closing that it works fine

OR

The solution was to restart the testrpc

killall -9 node
testrpc --networkId 5777

and deploying the contract again. If you face the error again delete the json files and run

truffle compile
truffle deploy

Tuesday, September 11, 2018