Skip to content

Instantly share code, notes, and snippets.

@angrymouse
Last active March 21, 2022 00:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angrymouse/1b552be58ad1e41e0d8b5b0e572fcf8f to your computer and use it in GitHub Desktop.
Save angrymouse/1b552be58ad1e41e0d8b5b0e572fcf8f to your computer and use it in GitHub Desktop.
SmartWeave Batched Calls Specification

Batched contract calls specification

Why

Batched Contract Calls (BCC) allows smartweave users to interact with many contracts using one transaction. It opens possibilities for one-time FCP (Foreign Call Protocol) execution, significantly increases time of calling contracts that require consistent execution, allows to do transfer of PST (Profit Sharing Tokens) to buch of addresses at once.

Suggested implementation

To call contract, program digs all transactions with tag "Contract" that equals to contract initial state transaction id.

Transaction can have many "Contract" tags, each "Contract" tag has own index.

Tags are sorted by position in transaction header (from low to high positions).

Each "Contract" tag should have "Input" tag that is linked to "Contract" tag by index (1st "Contract" tag is linked with 1st "Input" tag).

"Input" tags are sorted same way as "Contract" tags, by position in transaction headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment