In the BAT token contract:


What is the purpose of declaring the contract "Token" (in which just the functions are declared) and just after creating another contract which inherits from "Token":

contract StandardToken is Token {...}

Why not just declaring AND defining all functions in one contract ?

1 Answer 1


The Token contract where just the methods are declared are referred to as interface contracts. These work in similar fashion to interfaces in traditional OOP world.

Abstract contract implementation using interfaces helps avoid cross compilation errors and also used to decouple inter contract communication.

These abstract contracts are only provided to make the interface known to the compiler. Interfaces are basically limited to what the Contract ABI can represent, and the conversion between the ABI and an Interface should be possible without any information loss.

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.