# State

### State Objects <a href="#state-objects" id="state-objects"></a>

The `x/feesplit` module keeps the following objects in state:

| State Object          | Description                           | Key                                                               | Value              | Store |
| --------------------- | ------------------------------------- | ----------------------------------------------------------------- | ------------------ | ----- |
| `FeeSplit`            | Fee split bytecode                    | `[]byte{1} + []byte(contract_address)`                            | `[]byte{feeSplit}` | KV    |
| `DeployerFeeSplits`   | Contract by deployer address bytecode | `[]byte{2} + []byte(deployer_address) + []byte(contract_address)` | `[]byte{1}`        | KV    |
| `WithdrawerFeeSplits` | Contract by withdraw address bytecode | `[]byte{3} + []byte(withdraw_address) + []byte(contract_address)` | `[]byte{1}`        | KV    |

#### FeeSplit <a href="#feesplit" id="feesplit"></a>

A FeeSplit defines an instance that organizes fee distribution conditions for the owner of a given smart contract

```go
type FeeSplit struct {
	// hex address of registered contract
	ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
	// bech32 address of contract deployer
	DeployerAddress string `protobuf:"bytes,2,opt,name=deployer_address,json=deployerAddress,proto3" json:"deployer_address,omitempty"`
	// bech32 address of account receiving the transaction fees it defaults to
	// deployer_address
	WithdrawerAddress string `protobuf:"bytes,3,opt,name=withdrawer_address,json=withdrawerAddress,proto3" json:"withdrawer_address,omitempty"`
}
```

#### ContractAddress <a href="#contractaddress" id="contractaddress"></a>

`ContractAddress` defines the contract address that has been registered for fee distribution.

#### DeployerAddress <a href="#deployeraddress" id="deployeraddress"></a>

A `DeployerAddress` is the EOA address for a registered contract.

#### WithdrawerAddress <a href="#withdraweraddress" id="withdraweraddress"></a>

The `WithdrawerAddress` is the address that receives transaction fees for a registered contract.

### Genesis State <a href="#genesis-state" id="genesis-state"></a>

The `x/feesplit` module's `GenesisState` defines the state necessary for initializing the chain from a previous exported height. It contains the module parameters and the feesplits for registered contracts:

```go
// GenesisState defines the module's genesis state.
type GenesisState struct {
	// module parameters
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// active registered contracts for fee distribution
	FeeSplits []FeeSplit `protobuf:"bytes,2,rep,name=fee_splits,json=feeSplits,proto3" json:"fee_splits"`
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blockxnet.com/protocol-developers/modules/feesplit/state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
