-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
compilerGeneral compiler. Should eventually become more specific as the issue is triagedGeneral compiler. Should eventually become more specific as the issue is triagedteam:compilerCompiler TeamCompiler Team
Description
To support all the functionality of the transaction format supported with Fuel v2 I suggest the following top-level declarations:
contract
: defines a list of externally-callable functions that will be part of the contract's ABI, and a list of internally callable functions that are not part of the ABI. The ABI essentially replaces a main function with a giant switch statement to call different functions. Contracts will persist in the FuelVM's state.
contract {}
script
: defines a single function that operates at the transaction level. Scripts exist only for the duration of a transaction.
script (input) -> output {}
predicate
: defines a single function that must return abool
that operates at the input level. Predicates only exist for the duration of verifying the unlocking condition of an input.
predicate (input) -> bool {}
Smart contract developers will only use the first for writing their contract. Wallet and surrounding tooling can develop scripts and predicates using the latter two. But integration within a single language is important so that calls between them (say, a contract's function being called by a script) are type-safe, etc.
Metadata
Metadata
Assignees
Labels
compilerGeneral compiler. Should eventually become more specific as the issue is triagedGeneral compiler. Should eventually become more specific as the issue is triagedteam:compilerCompiler TeamCompiler Team
Type
Projects
Status
Done