The Basics

If you're unfamiliar with the Melon Protocol, there are many resources here that can get you started.

This library is based on web3.js 2x (link to repo). Those imports are noted at the top of each example code block. We also use BigNumber.js to describe tokens numerically. In all cases where we use those libraries, the imports have been noted.

Finally, it's worth defining some primitives that will be used frequently when interacting with both the Ethereum blockchain in general and the Melon Protocol in particular. Understanding bothEnvironment and Contract is vital to make use of MelonJS; they're both defined and illustrated in the following sections.