Deployment
deploy
Use this method in case you don't have a contract account. It creates a new contract account on which the contract is being deployed. The creator of the new contract account is the provider's default account.
Useful Scenario
We have two tests and one contract account. The first test writes to the contract storage, but you need this storage to be clear for the second test due to some assertions or something like that depending on the use-case.
deploy(wasmPath, abiPath, ?options)
Deploy a contract by providing the directory paths to your WASM and ABI files
deployRaw(rawWASM, abiJSON, ?options)
Deploy a contract from WASM string and ABI in JSON format
A typical use case for deployRaw
is in CI/CD. You don’t want to compile your contract every time, however your tests needs WASM and ABI. A good approach is to deploy your contract on a test network like Jungle one and retrieve its WASM and ABI for your tests
deployOnAccount
Use this method in case you already have an account on which you want to deploy a new contract or when you have an account with already deployed contract and you want to upgrade it.
deployOnAccount(wasmPath, abiPath, contractAccount, ?options)
Deploy a contract by providing the directory paths to your WASM and ABI files, and an account used to deploy the code on
deployRawOnAccount(rawWASM, abiJSON, contractAccount, ?options)
Deploy a contract by providing WASM string, ABI in JSON format and an account used to deploy the code on
Options
inline
If true, contract account's active authority obtains 'eosio.code' permission. In this way the contract has the ability to do inline actions (calls another contract)
Events
deploy
You can process some logic every time a new contract is deployed.
Last updated