> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aultblockchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Precompile: Miner

## Address

`0x0a01700000000000000000000000000000000002`

## Supported Methods

### Transactions

| Signature                       |
| ------------------------------- |
| `delegate(uint256[],address)`   |
| `redelegate(uint256[],address)` |
| `cancelDelegation(uint256[])`   |

### Queries

| Signature                               |
| --------------------------------------- |
| `epoch()`                               |
| `licenseMinerInfo(uint256)`             |
| `beacon(uint64)`                        |
| `ownerVRFKey(address)`                  |
| `operatorInfo(address)`                 |
| `operators(tuple)`                      |
| `licenseDelegation(uint256)`            |
| `delegatedLicenses(address,tuple)`      |
| `emissionInfo()`                        |
| `emissionSchedule()`                    |
| `licensePayouts(uint256,uint64,uint64)` |
| `epochInfo(uint64)`                     |
| `epochs(uint64,uint32,bool)`            |
| `params()`                              |

### Pure Utility

| Signature                 |
| ------------------------- |
| `derive(bytes32,bytes32)` |

## Query Examples

Set the current testnet EVM JSON-RPC endpoint and precompile address:

> Security note:
> Use a keystore or hardware wallet for real operations.
> Do not pass raw private keys directly in shell commands.

```bash theme={null}
export RPC_URL="https://test-json-rpc.cloud.aultblockchain.xyz"
export MINER_PRECOMPILE="0x0a01700000000000000000000000000000000002"
```

### Direct call

```bash theme={null}
cast call "$MINER_PRECOMPILE" \
  "epoch()(uint64,bytes32,bytes32)" \
  --rpc-url "$RPC_URL"
```

### Call from contract

```solidity theme={null}
address constant MINER = 0x0a01700000000000000000000000000000000002;

function queryMinerEpoch() external view returns (uint64, bytes32, bytes32) {
    (bool ok, bytes memory out) = MINER.staticcall(
        abi.encodeWithSignature("epoch()")
    );
    require(ok, "precompile call failed");
    return abi.decode(out, (uint64, bytes32, bytes32));
}
```

## Transaction Examples

### Environment Variables

```bash theme={null}
cast wallet import ault-ops --interactive

export CAST_ACCOUNT="ault-ops"
export FROM="$(cast wallet address --account "$CAST_ACCOUNT")"
export LICENSE_IDS="[1]"
export OPERATOR_EVM="<0xoperator...>"
```

### Direct call

```bash theme={null}
cast send "$MINER_PRECOMPILE" \
  "delegate(uint256[],address)" \
  "$LICENSE_IDS" \
  "$OPERATOR_EVM" \
  --rpc-url "$RPC_URL" \
  --account "$CAST_ACCOUNT"
```

### Call from contract

```solidity theme={null}
address constant MINER = 0x0a01700000000000000000000000000000000002;

function txMinerDelegate(
    uint256[] calldata licenseIds,
    address operator
) external {
    (bool ok, bytes memory out) = MINER.call(
        abi.encodeWithSignature(
            "delegate(uint256[],address)",
            licenseIds,
            operator
        )
    );
    require(ok, "precompile call failed");
}
```

## Notes

* Delegation methods are ownership-sensitive and should be called from the authorized owner's context.
* Pagination-style queries use pagination tuples in the ABI.

## ABI

<a href="/assets/abi/miner_precompile_abi.json" download>
  Download Miner ABI JSON
</a>
