1

I have the following functions

// from https://github.com/eidoo/icoengine/blob/master/contracts/KYCBase.sol
function buyTokens(uint64 buyerId, uint maxAmount, uint8 v, bytes32 r, bytes32 s) public payable returns (bool) 

// from https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/crowdsale/Crowdsale.sol
function buyTokens(address _beneficiary) public payable 

I need to make the buyTokens function revert and make it possible only to call the one from KYCBase (see link above).

As per instructions on eidoo/icoengine repository, the releaseTokensTo function must be overriden to implement the crowdsale logic.

I am really confuse about integrating the open-zeppelin crowdsale into eidoo icoengine KYCBase model. Anybody can help me?

I tried various ways:

  • Making an internal version of buyTokens

    // weiAmount is passed by the caller function as msg.value
    function buyTokensInternal(address _beneficiary, uint256 weiAmount) private  
    

    after that using it into the KYCBase releaseTokensTo, but I get errors I cannot debug.

  • Making the Crowdsale's buyTokens revert

    // kinda like this
    function buyTokens(address _beneficiary) public payable {
        revert();
    }
    

In any case I always get the following results from truffle tests

buyTokens : Expected to be fulfilled but got error: VM Error - revert

can anybody help me?

Your Answer

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

Browse other questions tagged or ask your own question.