Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (34 sloc) 1.33 KB

Scripts

Overview

You can create scrpits that can be run by solidbyte. Solidbyte will provide these scripts with some useful things, like an instantiated :class:`web3.Web3` object and :class:`web3.contract.Contract` representations of your smart contracts.

There's no reason it's necessary to create scripts this way, but it's intended to make things easier.

Example Implementations

For example scripts, see the scripts directory of the solidbyte-test-project repository.

Requirements

The following must be implemented in your script for Solidbyte to be able to run it.

main()

A main() function is expected by Solidbyte when running the sb script command. The following kwargs will be provided if you include them in your function definition:

  • network - The name of the network used in the CLI command
  • contracts - An AttrDict of your deployed contracts.
  • web3 - An instantiated :class:`web3.Web3` object.

A return value is not required, but if main() returns False, Solidbyte will consider that an error state.

You can’t perform that action at this time.