SmartWeaveDAO / Protocol-spec

A specification of the base SmartWeave protocol
0 stars 1 forks source link

Disallow non-ESM module format #1

Closed littledivy closed 2 years ago

littledivy commented 2 years ago

CJS and other legacy systems are not portable. Contracts should never be using a module system in the first place, this just makes sure no syntax quirks are allowed in contracts.

Also, the handler must be in the global scope (OR exported) of the contract. This makes life easier for implementors. We probably don't want to promote this weird Smartweave hack: https://github.com/ArweaveTeam/SmartWeave/blob/master/src/utils.ts#L93-L108

IIFE is still allowed, unfortunately, for backward compatibility.