Skip to content

E. OOP Features

Back to Solidity Feature Support

FeatureStatusNotes
Single inheritanceC3 linearization with flatten_contract_inheritance.
Multiple inheritanceDiamond inheritance detected. Constructor arg conflicts reported.
interfaceInterface types tracked. Methods validated.
abstract contractUnimplemented functions detected. Non-abstract contracts get actionable errors.
library⚠️Builtin devpack libraries are compiler intrinsics. User-defined libraries are merged/inlined into consuming contracts.
using X for YLibrary member-call syntax fully supported. using X for * and using {f,g} for T included.
super keywordSupported via inheritance flattening with __super_ method preservation.
is (inheritance)Inheritance specifiers fully processed.
Constructor chainingBase constructor arguments resolved from inheritance specifiers.
Event inheritanceInterface events collected recursively via collect_interface_events_recursive.

Partial OOP details

library — The devpack ships built-in libraries (Runtime, Storage, Syscalls, etc.) that are compiler intrinsics — they lower directly to syscalls and native contract calls. User-defined libraries are merged into the consuming contract. internal calls work directly, and public / external library functions are accepted but normalized to internal helpers with warnings. Libraries still cannot maintain mutable state or behave like separately deployed/linkable EVM libraries.

solidity
// ✅ Works — using devpack intrinsic library
import "devpack/libraries/Runtime.sol";
require(Runtime.checkWitness(sender), "unauthorized");

// ✅ Works — user-defined library with internal functions
library MathLib {
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }
}

using MathLib for uint256;
uint256 result = x.add(y);

MIT Licensed