Categories
Cryptocurrency Ethereum Mastering Development

Error while calling a function,

I created a Factory Contract which can create new ERC20 tokens with the parameters passed to it. Address of the contract: (Goerli Testnet) 0x482829Ba989fBC368F9A89dFf56cdF4036F39F28 I tested the contract on remix and it works fine. But when I’m calling this function using web3js. I’m getting this error: (node:10286) UnhandledPromiseRejectionWarning: Error: Returned error: The method eth_sendTransaction does […]

Categories
Cryptocurrency Ethereum Mastering Development

trying to write a contract for Hotel menu in solidity, and try to map order and table number

i am new to programming, can any one help me to understand how to map the order number and the table number in a hotel contact, i tryed up to map both order and table but not able to get the proper linkage for both and out put as order 2 table number 1. and […]

Categories
Cryptocurrency Ethereum Mastering Development

Error in smart contract solidity

Hello i have some problem when i compile my smart contract with truffle the message of the error is : ParserError: Expected ‘,’ but got identifier thank you in advance for your answers and here is my code, pragma solidity 0.6.8; // SPDX-License-Identifier: MIT import “./../installed_contracts/zeppelin/contracts/math/SafeMath.sol”; contract Marketplace { using SafeMath for uint; struct User […]

Categories
Cryptocurrency Ethereum Mastering Development

Populating struct throws error

Hi I am trying to run this code in remix. It deploys successfully but whenever I add a Customer using the addCustomer function, it shows this message “transact to MyContract.addCustomer pending …“. Afterwards if i try to interact with any other function it just prints for example “call to MyContract.totalRooms” and later the browser window […]

Categories
Cryptocurrency Ethereum Mastering Development

Create function with different prices

I’m coding a nft token, but I need them to have different prices. It is possible put all in one function. This is what I have and is working for me: function contribute1(string memory _name, string memory _description, string memory _autor) public payable returns (uint) { require(msg.value >= d1, “Not enough ether to mint this […]

Categories
Cryptocurrency Ethereum Mastering Development

set up 2 accounts

I am trying to implement a KYC system for banks. so for this, I will require the banks to have a respective account address so when the customer joins that bank he will pay to it. I have provided the sample code here. can someone help with how I can add the address to this? […]

Categories
Cryptocurrency Ethereum Mastering Development

“VM Exception while processing transaction: revert” in Truffle test and Truffle dev

This is my problem Issue “Error: Returned error: VM Exception while processing transaction: revert” when reaching the Transfer function. I think it is related to the fact that my Crowdsale smart contrat hasn’t any TotalSupply of my tokens. Steps to Reproduce Token Smart contract : pragma solidity 0.5.16; import “openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol”; import “openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol”; contract TokenSPC […]

Categories
Mastering Development

Flutter JSON The class doesn’t have a constructor named ‘fromJson’

can anyone explain me why this code doenst work? I have two classes IngredientEntry.dart import ‘package:CoolKiosk/MasterData/ingredient.dart’; import ‘package:decimal/decimal.dart’; class IngredientEntry { Decimal addOnPrice; Ingredient ingredient; IngredientEntry(Decimal addOnPrice, Ingredient ingredient) { this.addOnPrice = addOnPrice; this.ingredient = ingredient; } factory IngredientEntry.fromJson(Map<String, dynamic> json) { var _addOnPrice = Decimal.parse(json[‘price’].toString()); var _ingredient = Ingredient.fromJson(json[‘ingredient’]); return new IngredientEntry(_addOnPrice, _ingredient); } […]

Categories
Cryptocurrency Ethereum Mastering Development

org.web3j.abi.datatypes.Utf8String cannot be cast to java.lang.String

I have a problem when get string value from smart contact: pragma solidity >=0.4.22 <0.7.0; pragma experimental ABIEncoderV2; contract Election { // Model a Candidate struct Candidate { uint256 id; string name; uint256 voteCount; } // Store accounts that have voted mapping(address => bool) public voters; // Store Candidates // Fetch Candidate mapping(uint256 => Candidate) […]

Categories
Cryptocurrency Ethereum Mastering Development

org.web3j.abi.datatypes.Utf8String cannot be cast to java.lang.String

I have a problem when get string value from smart contact here is my smart contact pragma solidity >=0.4.22 <0.7.0; pragma experimental ABIEncoderV2; contract Election { // Model a Candidate struct Candidate { uint256 id; string name; uint256 voteCount; } // Store accounts that have voted mapping(address => bool) public voters; // Store Candidates // […]