Logic functions can be called with several commands depending on the nature of function callsite as defined by the logic. The arguments for the call are parsed from rules specified in the Argument Values Section and encoded by the CallEncoder
generated for the callsite. The callsite must be valid and match the form of call for the logic call to succeed.
The calldata for the logic call can be provided as a series of key value pairs which will be encoded with the runtime CallEncoder for the input specification and validated accordingly. Alternately, the calldata can be directly provided as a POLO Document in its hex string form.
Logic calls are gated based on their state configuration. Logics need to be deployed if they have a persistent state, before invoke call can be performed on them. Similarly, if they have been deployed already, deploy calls cannot be performed on them.
Deploying Logic Calls
- Syntax
>> deploy [name].[callsite]([call arguments] | [raw calldata])
- Example (Field Params)
>> set addr1 0xf6cd8ee6a29ec442dbbf9c6124dd3aeb833ef58052237d521654740857716b34
>> deploy ERC20.Seeder!(name: "MOI-Token", symbol: "MOI", supply: 100000000, seeder: addr1)
Execution Complete! [150 FUEL]
- Example (Raw Calldata)
>> deploy ERC20.Seeder!(0x0def010645e601c502d606b5078608e5086e616d65064d4f492d546f6b656e73656564657206f6cd8ee6a29ec442dbbf9c6124dd3aeb833ef58052237d521654740857716b34737570706c790305f5e10073796d626f6c064d4f49)
Execution Complete! [150 FUEL]
Invoking Logic Calls
- Syntax
>> invoke [name].[callsite]([call arguments] | [raw calldata])
- Example (No Params)
>> invoke ERC20.Name()
Execution Complete! [70 FUEL]
Execution Outputs ||| name: MOI-Token
- Example (Field Params)
>> invoke ERC20.BalanceOf(addr: 0xf6cd8ee6a29ec442dbbf9c6124dd3aeb833ef58052237d521654740857716b34)
Execution Complete! [90 FUEL]
Execution Outputs ||| balance: 100000000
- Example (Raw Calldata)
>> invoke ERC20.BalanceOf(0x0d2f06456164647206f6cd8ee6a29ec442dbbf9c6124dd3aeb833ef58052237d521654740857716b34)
Execution Complete! [90 FUEL]
Execution Outputs ||| balance: 100000000