Feature: multiple balanced assets

Add support for interactions that involve multiple assets, wherein the fact that assets are balanced at all points is guaranteed by the language. Some assets may be fungible, others not.

Stretch goal: have a common abstraction for goods and services, so that transfer of goods is a service, and services can be sold.

In gerbil-ethereum assets.ss, a method for setting up the "expected-to-be-deposited-so-far" variable, updating that variable on deposit, and committing that on a transaction? And a similar thing for setting up withdrawls to each of the participants, and committing those at the end of a transaction

Subtasks:

  • Move block-context back to glow
  • Multiple assets in block context
    • Tracking balances of multiple assets in participant-runtime
    • Tracking balances to "variables" in the evm-runtime
  • Asset type with methods for committing transfers at the end of a transaction
  • Add assets to InteractionAgreement
  • Use ethereum-config network to filter the asset options in CLI
  • Pass assets through CLI into participant-runtime and consensus-code-generation
  • In runtime, set up asset environment (including block contexts)
    • In runtime, set up asset environment
    • including block contexts
  • For deposit/withdraw, use asset-environment/block-contexts to track balances
  • On participant committing transactions, check balances are valid
    • Check deposit native balance for native assets
    • Check deposit erc20 balances for erc20 assets
    • Check withdraw contract balances (balance variable, not necessarily contract balance, for multiple interactions per contract)
  • On participant committing transactions, transfers
    • Attach CALLVALUE for native assets
    • Check for zero, approve transfer-from for erc20 assets
  • On consensus committing transactions, use asset-environment to deposit/withdraw the asset amounts for the transaction
    • Check CALLVALUE for native asset deposits
    • Check for zero, invoke transfer-from for erc20 asset deposits
    • Check for zero, invoke transfer for native asset withdraws
    • Check for zero, invoke transfer for erc20 asset withdraws
  • Test all of this

Related branches:

Edited by Ian Denhardt