Solidity library compatibility¶
| Library type | How it works | On PQWERAI |
|---|---|---|
internal functions (e.g. Fees.bps, OpenZeppelin Math) |
Inlined into the contract; no deployment | ✅ Tested in TipJar |
public/external library functions |
Deployed separately; the contract is linked to the library address | ✅ Standard EVM DELEGATECALL; link with forge create --libraries src/L.sol:L:<addr> |
| OpenZeppelin Contracts 5.0.2 | Source-level dependency | ✅ ERC-20/721/1155, Ownable, Ownable2Step, AccessControl, Math tested |
| OpenZeppelin ≥ 5.1 | Uses MCOPY/PUSH0 depending on target |
Compiles for cancun; not tested for this release |
Compatibility rules:
- Compile with an EVM target the chain supports (
cancunor lower) — see EVM compatibility. - Avoid libraries that use
blobhash,block.blobbasefeeor EIP-7702 delegation — they cannot work here. - Libraries that read
block.prevrandaofor randomness are unsafe on PoW chains. - Pin library versions (git tag or lockfile); the Wallet Studio uses a bundled OpenZeppelin 5.0.2 so that compilation needs no network and is reproducible.
Sources at 72057fe3ec: developers/examples/patterns/src/TipJar.sol
Found a problem? Report a documentation issue · Build testnet-rc1+72057fe3ec