> For the complete documentation index, see [llms.txt](https://docs.swttoken.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swttoken.com/api-reference/apache-thrift-api/smart-contract.md).

# Smart contract

This section contains a description of methods for working with smart contracts of the SWT platform

### SmartContractGet() <a href="#smartcontractget" id="smartcontractget"></a>

returns the smart contract code to its address

SmartContractGetResult SmartContractGet(1:general.Address address)

### SmartContractsListGet() <a href="#smartcontractslistget" id="smartcontractslistget"></a>

returns a list of smart contracts according to the list of the deployer starting with **offset** in the amount of **limit**

SmartContractsListGetResult SmartContractsListGet(1:general.Address deployer, 2:i64 offset, 3:i64 limit)

### SmartContractAddressesListGet() <a href="#smartcontractaddresseslistget" id="smartcontractaddresseslistget"></a>

returns a list of addresses of smart contracts of the deployer

SmartContractAddressesListGetResult SmartContractAddressesListGet(1:general.Address deployer)

// Blocks till `obsolete` is not the last block in chain.

PoolHash WaitForBlock(1:PoolHash obsolete)

// Blocks till there are transactions arrived to `smart_address`

// not yet reported by this method in current node's process lifetime.

TransactionId WaitForSmartTransaction(1:general.Address smart\_public)

### SmartContractsAllListGet() <a href="#smartcontractsalllistget" id="smartcontractsalllistget"></a>

Returns all smart contracts in the system

SmartContractsListGetResult SmartContractsAllListGet(1:i64 offset, 2:i64 limit)

Required parameters:

int64 offset - offset from the end of the list

int64 limit - number of smart contracts returned

Return value:

struct SmartContractsListGetResult

{

1: general.APIResponse status - response status message describing the problem, if any

2: i32 count - smart-contracts count

3: list smartContractsList - list of smart-contracts

},

where

struct SmartContract

{

1: required general.Address address

2: general.Address deployer

3: SmartContractDeploy smartContractDeploy

4: binary objectState

5: Time createTime

6: i32 transactionsCount

}

### TransactionsStateGet() <a href="#transactionsstateget" id="transactionsstateget"></a>

returns the state of a smart contract after a transaction with **id**

TransactionsStateGetResult TransactionsStateGet(1:general.Address address, 2:list id)

### ContractAllMethodsGet() <a href="#contractallmethodsget" id="contractallmethodsget"></a>

returns all smart contract methods

ContractAllMethodsGetResult ContractAllMethodsGet(1: list\<general.ByteCodeObject> byteCodeObjects)

### SmartMethodParamsGet() <a href="#smartmethodparamsget" id="smartmethodparamsget"></a>

returns all parameters of a smart contract

SmartMethodParamsGetResult SmartMethodParamsGet(1:general.Address address, 2:TransactionInnerId id)

### SmartContractDataGet() <a href="#smartcontractdataget" id="smartcontractdataget"></a>

get smart contract code

SmartContractDataResult SmartContractDataGet(1:general.Address address)

### SmartContractCompile() <a href="#smartcontractcompile" id="smartcontractcompile"></a>

returns the result of compiling a smart contract

SmartContractCompileResult SmartContractCompile(1:string sourceCode)
