Solidity

Abstract contract

Interface

The syntax construct that defines the minimum set of functions the token contract should support is called an interface

So let's say that I want to write a contract that interacts with this contract without knowing the code of this contract but we do know the function signatures of the functions. The question is how do we write a contract that interacts with this contract without having to copy paste all the source code of this contract. The way you do it is by using interfaces.

Events

Events in Ethereum haven't only a real-time notification purpose, but also a long-term purpose. Events are logged on the transaction log of the blockchain, and you can retrieve them later for analysis. To allow quick retrieval, events are indexed against a key that you can define when you declare the event. The key can be composite and contain up to three of its input parameters, as you can see in the definition of Transfer shown previously

Abstract class

A contract is considered abstract, rather than concrete, if at least one of its functions is abstract, which means it has been declared but not implemented

contract AbstractContract {
int256 public stateVar;
constructor(int256 param1)
stateVar = param1;
}
public {
function operation1(int256 opParam1, bool opParam2)
returns (int256) {
if (opParam2) return opParam1;
}
function operationA(int256 opParamA);
}
event Transfer(address indexed from, address indexed to, uint256
value);
Last updated on