Skip to main content

Warp Command Line Interface

Useful commands with the Warp Transpiler.

To query available commands, run warp --help.

Available Commands:

transpile [options] <files...>      Transpile Solidity contracts into Cairo contracts
transform [options] <file> Debug tool which applies any set of passes to the AST and writes out the transformed Solidity
test [options] Deprecated testing framework
analyse [options] <file> Debug tool to analyse the AST
status [options] <tx_hash> Get the status of a transaction
compile [options] <file> Compile cairo files with warplib in the cairo-path
gen_interface [options] <file> Use native Cairo contracts in your Solidity by creating a Solidity interface and a Cairo translation contract for the target Cairo contract
deploy [options] <file> Deploy a warped cairo contract
deploy_account [options] Deploy an account to Starknet
invoke [options] <file> Invoke a function on a warped contract using the Solidity abi
call [options] <file> Call a function on a warped contract using the Solidity abi
install [options] Install the python dependencies required for Warp
declare [options] <cairo_contract> Declare a Cairo contract
new_account [options] Command to create a new account
version
help [command] display help for command

Command Options:

transpile [options] <file...>:

--compile-cairo             Compile the output to bytecode
--check-trees Debug: Run sanity checks on all intermediate ASTs
--dev Run AST sanity checks on every pass instead of the final AST only (default: false)
--format-cairo Format the cairo output - can be slow on large contracts
--highlight <ids...> Debug: Highlight selected ids in the AST printed by --print-trees
--order <passOrder> Use a custom set of transpilation passes
-o, --output-dir <path> Output directory for transpiled Cairo files. (default: "warp_output")
-d, --debug-info Include debug information in the compiled bytecode produced by --compile-cairo (default: false)
--print-trees Debug: Print all the intermediate ASTs
--no-stubs Debug: Hide the stubs in the intermediate ASTs when using --print-trees
--no-strict Debug: Allow silent failure of AST consistency checks
--until <pass> Stops transpilation after the specified pass
--no-warnings Suppress warnings from the Solidity compiler
--include-paths <paths...> Pass through to solc --include-path option
--base-path <path> Pass through to solc --base-path option
-h, --help display help for command

transform [options] <file...>:

--check-trees               Debug: Run sanity checks on all intermediate ASTs
--highlight <ids...> Debug: highlight selected ids in the AST printed by --print-trees
--order <passOrder> Use a custom set of transpilation passes
-o, --output-dir <path> Output directory for transformed Solidity files
--print-trees Debug: Print all the intermediate ASTs
--no-stubs Debug: Hide the stubs in the intermediate ASTs when using --print-trees
--no-strict Debug: Allow silent failure of AST consistency checks
--until <pass> Stop processing at specified pass
--no-warnings Suppress printed warnings
--include-paths <paths...> Pass through to solc --include-path option
--base-path <path> Pass through to solc --base-path option
-h, --help display help for command

analyse [options] <file...>:

--highlight <ids...>  Highlight selected ids in the AST
-h, --help display help for command

status [options] <tx_hash...>:

--network <network>             Starknet network URL.
-h, --help display help for command

compile [options] <file...>:

-d, --debug_info                Include debug information. (default: false)
-h, --help display help for command

declare [options] <cairo_contract>:

--network <network>                        Starknet network URL
--account <account> The name of the account. If not given, the default for the wallet will be used.
--account_dir <account_dir> The directory of the account
--gateway_url <gateway_url> Starknet gateway URL
--feeder_gateway_url <feeder_gateway_url> Starknet feeder gateway URL
--wallet <wallet> The name of the wallet, including the python module and wallet class
--max_fee <max_fee> Maximum fee to pay for the transaction
-h, --help display help for command

deploy [options] <file...>:

-d, --debug_info                           Compile include debug information (default: false)
--inputs <inputs...> Arguments to be passed to constructor of the program as a comma separated list of strings, ints and lists
--use_cairo_abi Use the cairo abi instead of solidity for the inputs (default: false)
--network <network> Starknet network URL
--gateway_url <gateway_url> Starknet gateway URL
--feeder_gateway_url <feeder_gateway_url> Starknet feeder gateway URL
--no_wallet Do not use a wallet for deployment (default: false)
--wallet <wallet> Wallet provider to use
--account <account> Account to use for deployment
--account_dir <account_dir> The directory of the account.
--max_fee <max_fee> Maximum fee to pay for the transaction.
-h, --help display help for command

deploy_account [options]:

--account <account>                        The name of the account. If not given, the default for the wallet will be used
--account_dir <account_dir> The directory of the account.
--network <network> Starknet network URL
--gateway_url <gateway_url> Starknet gateway URL
--feeder_gateway_url <feeder_gateway_url> Starknet feeder gateway URL
--wallet <wallet> The name of the wallet, including the python module and wallet class
--max_fee <max_fee> Maximum fee to pay for the transaction.
-h, --help display help for command

invoke [options] <file...>:

--address <address>                        Address of contract to invoke
--function <function> Function to invoke
--inputs <inputs...> Input to function as a comma separated string, use square brackets to represent lists and structs. Numbers can be represented in decimal and hex.
--use_cairo_abi Use the cairo abi instead of solidity for the inputs (default: false)
--account <account> The name of the account. If not given, the default for the wallet will be used
--account_dir <account_dir> The directory of the account
--network <network> Starknet network URL
--gateway_url <gateway_url> Starknet gateway URL
--feeder_gateway_url <feeder_gateway_url> Starknet feeder gateway URL
--wallet <wallet> The name of the wallet, including the python module and wallet class
--max_fee <max_fee> Maximum fee to pay for the transaction
-h, --help display help for command

call [options] <file...>:

--address <address>                        Address of contract to call
--function <function> Function to call
--inputs <inputs...> Input to function as a comma separated string, use square brackets to represent lists and structs. Numbers can be represented in decimal and hex.
--use_cairo_abi Use the cairo abi instead of solidity for the inputs (default: false)
--account <account> The name of the account. If not given, the default for the wallet will be used
--account_dir <account_dir> The directory of the account
--network <network> Starknet network URL
--gateway_url <gateway_url> Starknet gateway URL
--feeder_gateway_url <feeder_gateway_url> Starknet feeder gateway URL
--wallet <wallet> The name of the wallet, including the python module and wallet class
--max_fee <max_fee> Maximum fee to pay for the transaction
-h, --help display help for command

install [options]:

--python <python>  Path to a python3.9 executable (default: "python3.9")
-v, --verbose Display python setup info
-h, --help display help for command

Global flags:

-h, --help                      display help for command

Example calls:

Deploys an account contract to a network​

warp deploy_account --wallet=starkware.starknet.wallets.open_zeppelin.OpenZeppelinAccount --account=demo --network=alpha-goerli

Output:

#Sent deploy account contract transaction.

NOTE: This is a modified version of the OpenZeppelin account contract. The signature is computed
differently.

Contract address: 0x0
Public key: 0x1
Transaction hash: 0x2

Get transaction status:​

warp status 0x4 --network=alpha-goerli

Output:

{
"block_hash": "0x5",
"tx_status": "ACCEPTED_ON_L2"
}