Function to deploy a smart contract from the connected Abstract Global Wallet.
The AbstractClient
includes a deployContract
method that can be used to deploy a smart contract from the connected Abstract Global Wallet.
It extends the deployContract function from Viem to include options for
contract deployment on Abstract.
The ABI of the contract to deploy.
The bytecode of the contract to deploy.
The account to deploy the contract from. Use the account
from the
AbstractClient to
use the Abstract Global Wallet.
The chain to deploy the contract on. e.g. abstractTestnet
.
Constructor arguments to call upon deployment.
Specifies the type of contract deployment. Defaults to create
.
'create'
: Deploys the contract using the CREATE
opcode.'create2'
: Deploys the contract using the CREATE2
opcode.'createAccount'
: Deploys a smart contract wallet
using the ContractDeployer’s
createAccount
function.'create2Account'
: Deploys a smart contract wallet
using the ContractDeployer’s
create2Account
function.An array of bytecodes of contracts that are dependencies for the contract being deployed. This is used for deploying contracts that depend on other contracts that are not yet deployed on the network.
Learn more on the Contract deployment page.
Specifies a unique identifier for the contract deployment.
The amount of gas to pay per byte of data on Ethereum.
Address of the paymaster smart contract that will pay the gas fees of the deployment transaction.
Must also provide a paymasterInput
field.
Input data to the paymaster.
Must also provide a paymaster
field.
Returns the Hex
hash of the transaction that deployed the contract.
Use waitForTransactionReceipt to get the transaction receipt from the hash.