sway icon indicating copy to clipboard operation
sway copied to clipboard

Expand prelude

Open SwayStar123 opened this issue 3 years ago • 2 comments

Currently the standard library prelude is way too short. Essentials are required to be imported nearly in every contract. Heres some nominations for addition to the prelude

  • Address
  • ContractId
  • Identity
  • transfer()
  • msg_sender()
  • msg_amount()
  • msg_asset_id()
  • StorageMap
  • Vec
  • assert
  • require
  • revert

SwayStar123 avatar Jul 31 '22 19:07 SwayStar123

If I'm not mistaken, we need to create the prelude first and have the compiler include it in every module. https://github.com/FuelLabs/sway/issues/841 seems to be tracking that work. We can then start adding the symbols and functions above to it.

mohammadfawaz avatar Aug 01 '22 02:08 mohammadfawaz

Yeah, I was going to say, zero sized probably is too short. :slightly_smiling_face:

otrho avatar Aug 01 '22 02:08 otrho

Closing in favour of https://github.com/FuelLabs/sway/issues/841

mohammadfawaz avatar Sep 06 '22 15:09 mohammadfawaz