1
    constructor(
    address _DEMO,
    address _principle,
    address _treasury,
    address _DAO,
    address _bondCalculator
) {
    require(_DEMO != address(0));
    DEMO = _DEMO;
    require(_principle != address(0));
    principle = _principle;
    require(_treasury != address(0));
    treasury = _treasury;
    require(_DAO != address(0));
    DAO = "_DAO;"
    // bondCalculator should be address(0) if not LP bond
    bondCalculator = _bondCalculator;
     isLiquidityBond = (_bondCalculator != address(0));
}

This is my code here but when i try to compile it in remix i keep getting that parser error from the title on the bondCalculator =_bondcalculator; line.I don't know what is wrong with my code as it looks alright to me but I am a inexperienced coder and feedback is greatly appreciated

2
  • Hi, I would like to help, but could you edit your question so the code is more readable. Thanks.
    – Sky
    Jan 12 at 14:16
  • Hi sorry i just edited it there it should be more readable Jan 12 at 14:25
1

I created new contract named Test.sol and added your code "edited". It now compiles. Though there are many warnings about unused variables. But that is okay for learning code.

pragma solidity >=0.4.21 <0.7.0;

contract Test {


 constructor (
    address _DEMO,
    address _principle,
    address _treasury,
    address _DAO,
    address _bondCalculator
) public {
    require(_DEMO != address(0));
    address DEMO = _DEMO;
    require(_principle != address(0));
    address principle = _principle;
    require(_treasury != address(0));
    address treasury = _treasury;
    require(_DAO != address(0));
    address DAO = _DAO;
    // bondCalculator should be address(0) if not LP bond
    address bondCalculator = _bondCalculator;
    bool isLiquidityBond = (_bondCalculator != address(0));
}

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.