Skip to content

Mapping Parity and Limitations

Neo DevPack for Solidity is source-compatible with many Solidity 0.8.x patterns, but not every EVM behavior has an exact Neo N3 equivalent.

Fidelity Levels

LevelMeaningExamples
ExactNeo N3 provides equivalent semantics.block.timestamp, block.number, address(this), storage reads/writes.
Compatible with warningCode compiles, but behavior is a Neo approximation.Ether units, block.coinbase, block.basefee, msg.data, msg.sig.
Neo-specific replacementUse a Neo pattern instead of the EVM pattern.Runtime.checkWitness instead of approval-heavy account assumptions.
UnsupportedThe EVM behavior cannot be represented safely.delegatecall, true transient storage, fixed-point numbers.

Common Porting Risks

PatternRiskNeo-Specific Fix
Relying on tx.origin for authSigner identity can be too broad for authorization.Use Runtime.checkWitness on the specific account.
Assuming Ether balance semanticsNeo assets are NEP tokens and GAS, not native Ether.Use GAS/NEP transfer APIs and callbacks.
Assuming EVM overflow behaviorNeoVM integers are arbitrary precision.Use explicit modulo arithmetic for wrapping.
Renaming state variables in upgradesStorage keys are name-derived.Migrate data or preserve state variable names.
Iterating mappingsSolidity mappings do not expose keys; Neo storage keys do not add enumeration automatically.Track inserted keys in arrays or explicit indexes.
Using delegate-call proxy patternsNeoVM has no caller-storage execution mode.Use ContractManagement.update / NEP-22 style upgrades.

Diagnostics

Approximate mappings should emit compiler diagnostics. Treat those diagnostics as migration tasks, not as noise, before deploying to Neo N3 MainNet.

More Detail

MIT Licensed