Type Alias hedera::ContractCreateTransaction
source · pub type ContractCreateTransaction = Transaction<ContractCreateTransactionData>;
Expand description
Start a new smart contract instance.
Aliased Type§
struct ContractCreateTransaction { /* private fields */ }
Implementations§
source§impl ContractCreateTransaction
impl ContractCreateTransaction
sourcepub fn get_bytecode_file_id(&self) -> Option<FileId>
pub fn get_bytecode_file_id(&self) -> Option<FileId>
Returns the FileId
to be used as the bytecode for this smart contract.
sourcepub fn bytecode_file_id(&mut self, file_id: FileId) -> &mut Self
pub fn bytecode_file_id(&mut self, file_id: FileId) -> &mut Self
Sets the file to use as the bytes for the smart contract.
sourcepub fn get_bytecode(&self) -> Option<&[u8]>
pub fn get_bytecode(&self) -> Option<&[u8]>
Returns the bytecode for the smart contract.
sourcepub fn bytecode(&mut self, bytecode: impl AsRef<[u8]>) -> &mut Self
pub fn bytecode(&mut self, bytecode: impl AsRef<[u8]>) -> &mut Self
Sets the bytes of the smart contract.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the admin key.
sourcepub fn get_initial_balance(&self) -> Hbar
pub fn get_initial_balance(&self) -> Hbar
Returns the initial balance to put into the cryptocurrency account associated with the new smart contract.
sourcepub fn initial_balance(&mut self, balance: Hbar) -> &mut Self
pub fn initial_balance(&mut self, balance: Hbar) -> &mut Self
Sets the initial balance to put into the cryptocurrency account associated with the new smart contract.
sourcepub fn get_auto_renew_period(&self) -> Duration
pub fn get_auto_renew_period(&self) -> Duration
Returns the auto renew period for this smart contract.
sourcepub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
pub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
Sets the auto renew period for this smart contract.
sourcepub fn get_constructor_parameters(&self) -> &[u8] ⓘ
pub fn get_constructor_parameters(&self) -> &[u8] ⓘ
Returns the parameters to pass to the constructor.
sourcepub fn constructor_parameters(
&mut self,
parameters: impl AsRef<[u8]>
) -> &mut Self
pub fn constructor_parameters( &mut self, parameters: impl AsRef<[u8]> ) -> &mut Self
Sets the parameters to pass to the constructor.
sourcepub fn get_contract_memo(&self) -> &str
pub fn get_contract_memo(&self) -> &str
Returns the memo for the new smart contract.
sourcepub fn contract_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn contract_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the memo for the new smart contract.
sourcepub fn get_max_automatic_token_associations(&self) -> u32
pub fn get_max_automatic_token_associations(&self) -> u32
Returns the maximum number of tokens that the contract can be automatically associated with.
sourcepub fn max_automatic_token_associations(&mut self, max: u32) -> &mut Self
pub fn max_automatic_token_associations(&mut self, max: u32) -> &mut Self
Sets the maximum number of tokens that this contract can be automatically associated with.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the account ot be used at the contract’s expiration time to extend the life of the contract
sourcepub fn auto_renew_account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn auto_renew_account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be used at the contract’s expiration time to extend the life of the contract.
sourcepub fn get_staked_account_id(&self) -> Option<AccountId>
pub fn get_staked_account_id(&self) -> Option<AccountId>
Returns the ID of the account to which this contract is staking.
sourcepub fn staked_account_id(&mut self, id: AccountId) -> &mut Self
pub fn staked_account_id(&mut self, id: AccountId) -> &mut Self
Sets the ID of the account to which this contract is staking.
This is mutually exclusive with staked_node_id
.
sourcepub fn get_staked_node_id(&self) -> Option<u64>
pub fn get_staked_node_id(&self) -> Option<u64>
Returns the ID of the node to which this contract is staking.
sourcepub fn staked_node_id(&mut self, id: u64) -> &mut Self
pub fn staked_node_id(&mut self, id: u64) -> &mut Self
Sets the ID of the node to which this contract is staking.
This is mutually exclusive with staked_account_id
.
sourcepub fn get_decline_staking_reward(&self) -> bool
pub fn get_decline_staking_reward(&self) -> bool
Returns true
if the contract will decline receiving staking rewards, false
otherwise.
sourcepub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
pub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
If true
the contract should declie receiving staking rewards. The default value is false
.