BotcoinMiningV4 — Functions
BotcoinMiningV4 is the current main mining settlement contract on Base. It verifies coordinator receipts, records credits, accepts epoch funding, finalizes epochs, handles claims, exposes epoch context, and settles CoreTex receipts through the same reward ledger.
Standard Receipts
| Function | Description |
|---|---|
submitReceipt(...) |
Submit a coordinator-signed receipt to record a solve credit. Verifies the coordinator's EIP-712 signature, miner eligibility, and chain rules (nextIndex, prevReceiptHash). Credits earned follow the highest tier the miner's stake satisfies. |
nextIndex(address) |
View: the miner's next expected solve index. |
lastReceiptHash(address) |
View: hash of the miner's last submitted receipt. |
credits(uint64 epochId, address miner) |
View: the miner's accumulated credits in an epoch (scaled units). |
totalCredits(uint64 epochId) |
View: sum of credits across all miners in an epoch. |
CoreTex Receipts And Context
| Function | Description |
|---|---|
submitCoreTexReceipt(CoreTexReceipt) |
Submit a coordinator-signed CoreTex receipt for screener or state-advance work. |
setCoreTexEpochContext(uint64, CoreTexEpochContext) |
Pin the CoreTex epoch roots and context used by receipt validation and replay. |
activeCoreTexRulesVersion(uint64) |
View: active CoreTex rules version for an epoch. |
activeCoreTexPolicyHash(uint64) |
View: active on-chain CoreTex policy hash for receipt validation. |
coreTexEpochContextSet(uint64) |
View: whether the epoch context has been pinned. |
Epoch & Rewards
| Function | Description |
|---|---|
currentEpoch() |
View: current epoch ID. |
EPOCH_DURATION |
Immutable: epoch length in seconds (86400 on mainnet). |
genesisTimestamp() |
Immutable: genesis timestamp (epoch schedule anchor). |
fundEpoch(uint64 epochId, uint256 amount) |
Transfer BOTCOIN into the reward pool for a past epoch. Callable multiple times; amounts accumulate in epochReward until finalizeEpoch. Reverts if the epoch has no credits, is already finalized, or epochId has not ended. |
finalizeEpoch(uint64 epochId) |
Lock the epoch's reward pool and allow claim. No further fundEpoch for that epoch. Requires non-zero epochReward. |
epochFinalized(uint64 epochId) |
View: whether the epoch has been finalized. |
claim(uint64[] epochIds) |
Claim proportional rewards for finalized epochs. Payout: epochReward × (minerCredits / totalCredits) using the miner's credits in each epoch. |
epochReward(uint64 epochId) |
View: total BOTCOIN allocated to the epoch reward pool (after all fundEpoch calls). |
rewardBalance() |
View: BOTCOIN held for unclaimed reward obligations. |
setEpochCommit(uint64 epochId, bytes32 commit) |
Set the epoch randomness commitment (keccak256(epochSecret) at epoch start). |
revealEpochSecret(uint64 epochId, bytes32 secret) |
Reveal the epoch secret after the epoch ends. |
Coordinator & owner configuration
| Function | Description |
|---|---|
coordinatorSigner() |
View: authorized EIP-712 signing address (coordinator). |
setCoordinatorSigner(address) |
Update the coordinator signer (owner only). |
setFunder(address, bool) |
Authorize or revoke addresses allowed to call fundEpoch / finalizeEpoch (owner only). |
DOMAIN_SEPARATOR() |
View: EIP-712 domain separator for receipt signing. |