0
Function getTradingEnableStatus() external view returns (bool){
   //lock is used @ trading open
    Return lockused;
}

Function starttrading () external only owner {
    require(lockused == false);
    lockTilstart = false ;
    locktime = launchtime.add(Lockdiff);
    emit locktilstartupdate(locktilstart);
    emitTradeStarted(true):
}
1
  • Can you format the code? I tried to do it but the indentation is wrong. Can you clarify what are you trying to achieve?
    – Ismael
    Nov 20, 2022 at 17:11

1 Answer 1

0

external functions are part of the contract interface, which means they can be called from other contracts and via transactions. An external function cannot be called internally so you will not be able to call the function startTrading from getTradingEnableStatus, in order to be able to use startTrading from inside your smart contract change the external by private (or public if you want that function accesible from outside the smart contract too)

Function getTradingEnableStatus() external view returns (bool){
   ...
   startTrading();
}

Function startTrading () public only owner {
   ...
}

Your Answer

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

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