2

I'm trying to deploy a new contract for testing on the ropsten network. I'm using remix and metamask, but for some reason I can't select injected Web3 (what used to be the standard setting) and thus it can't deploy.

Anyone who can help?

Code is:

pragma solidity ^0.4.11;

contract ZorgPolisBasic {

address public patient;
address public huisarts;
address public specialist;
address public verzekeraar;
bool public verzekeraaraanvullenbasis;
bool public verzekeraaraanvullenspecialist;
bool public huisartsuitgevoerd;
bool public specialistuitgevoerd;
bool public doorverwijzen;
uint256 public huisartsentarief = 1 ether;
uint256 public specialistentarief = 2 ether;
string public akkoordgeven;
string public fraude;
string public artsendecla;

//alle parameters op 0
function ZorgPolisBasic(){
patient = msg.sender;
huisarts = 0x33E225e01bba3AA05ADDCD8F38142a8d47F9dC37;
specialist = 0xAB7fAE73effD38B5EdaD696E1fb062b0F6863459;
verzekeraar = 0xa8323F5fBcf1980B2093a633cF03020900B81d53;
verzekeraaraanvullenbasis = true;
fraude = "none";
}

//hier claimt de huisarts zijn consult
function huisartsclaim(){
huisartsuitgevoerd = true;
doorverwijzen = false;
akkoordgeven = "bevestig behandeling huisarts";
}

//hier verwijst huisarts door en claimt tegelijk zijn consult   
function huisartsdoorverwijzing(){
huisartsuitgevoerd = true;
doorverwijzen = true;
verzekeraaraanvullenspecialist = true;
akkoordgeven = "bevestig behandeling huisarts";
}

//deze twee bevestigen danwel ontkennen de behandeling huisarts
function patientbevestigdHA (){
if (huisartsuitgevoerd==true){
    huisarts.transfer(huisartsentarief);
    verzekeraaraanvullenbasis = true;
    huisartsuitgevoerd = false;
    akkoordgeven = "";
    artsendecla = "";
}else{
artsendecla = "Huisarts heeft nog niet geclaimd";   
}
}

function patientontkentHA (){
if (huisartsuitgevoerd==true){
fraude = "patient ontkent behandeling huisarts";
huisartsuitgevoerd = false;
doorverwijzen = false;
akkoordgeven = "";
}else{
}
}

//hier claimt de specialist
function specialistclaim(){
if (doorverwijzen==false){
    fraude = "specialist claimt zonder doorverwijzing";
        }else{
    specialistuitgevoerd = true;
    akkoordgeven = "bevestig behandeling specialist";
}
}

//deze twee bevestigen danwel ontkennen de behandeling specialist
function patientbevestigdS (){
if (specialistuitgevoerd==true){
    specialist.transfer(specialistentarief);
    specialistuitgevoerd = false;
    akkoordgeven = "";
    artsendecla = "";
}else{
artsendecla = "Specialist heeft nog niet geclaimd";
}
}

function patientontkentS() {
if (specialistuitgevoerd==true){
fraude = "patient ontkent behandeling specialist";
specialistuitgevoerd = false;
akkoordgeven = "";
}else{

}
}

function aanvullenverzekeraar () payable{
verzekeraaraanvullenbasis = false;
verzekeraaraanvullenspecialist = false;
}

function clearstatussen (){
verzekeraaraanvullenbasis = false;
verzekeraaraanvullenspecialist = false;
huisartsuitgevoerd = false;
specialistuitgevoerd = false;
doorverwijzen = false;
akkoordgeven = "";
fraude = "none";
artsendecla = "";
}

}

6
  • When I push create I get the error: callback contain no result Error: SyntaxError: Unexpected token < in JSON at position 0. I have no errors in my compiling and it has always worked just fine (have metamask 3.6.5) May 23, 2017 at 13:51
  • Interaction with existing smart contracts with metamask is going just fine. It's really deploying/creating smart contracts through remix. May 23, 2017 at 13:57
  • please add the sourcecode or gist to your contract here - otherwise it's hard to help. Did you try testing in JavascriptVM first? Constructor arguments required and correctly formatted? Also: are you connecting to a private net, via geth or some other node or directly via default metamask settings to a testnet or main chain?
    – SCBuergel
    May 23, 2017 at 14:06
  • Conneting directly via deault metamask setting to Ropsten May 23, 2017 at 14:17
  • I get no compiling errors (contract is just over 100 lines, but that shouldn't be a problem right.) May 23, 2017 at 14:18

1 Answer 1

1

Like I said when you asked in the MetaMask slack channel, this parsing error happens when the RPC provider returns a bad result. MetaMask should improve this error message, I'll open an issue on that.

To diagnose what is wrong with the provider, you'll need to open the background console and inspect the bad network response: https://github.com/#background-logs-chrome

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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