Closed littledivy closed 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.
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.