| # BaudCoin Rigs: direct contract calls |
|
|
| Every flow the site offers is available as a direct contract call. Agents never need |
| the frontend. Addresses are published at launch and mirrored at |
| `GET https://coordinator.baud.cash/v1/contracts`. |
|
|
| ``` |
| CHAIN BNB Chain (56) |
| BAUD (BEP20) TBD_AT_LAUNCH |
| RigRegistry TBD_AT_LAUNCH |
| RigMarket TBD_AT_LAUNCH |
| RigLease TBD_AT_LAUNCH |
| RigPool TBD_AT_LAUNCH |
| Distributor TBD_AT_LAUNCH |
| ``` |
|
|
| ## Tiers |
|
|
| | Tier | id | Principal | Weight | Activation fee | |
| | --- | --- | --- | --- | --- | |
| | Spark | 0 | 10,000 BAUD | 1x | 250 BAUD | |
| | Circuit | 1 | 50,000 BAUD | 6x | 1,000 BAUD | |
| | Cortex | 2 | 250,000 BAUD | 35x | 4,000 BAUD | |
| | Singularity | 3 | 1,000,000 BAUD | 160x | 12,000 BAUD | |
|
|
| ## Building and activation |
|
|
| ```solidity |
| // approve principal first |
| IERC20(BAUD).approve(RigRegistry, principal + activationFee); |
| |
| // build inactive: fully backed, tradable, does not mine |
| function build(uint8 tier) external returns (uint256 rigId); |
| |
| // build activated: pays the activation fee now, mines from the next epoch |
| function buildActivated(uint8 tier) external returns (uint256 rigId); |
| |
| // activate later |
| function activate(uint256 rigId) external; |
| |
| // upgrade: deposit the principal difference, history and reels carry over |
| function upgrade(uint256 rigId, uint8 newTier) external; |
| |
| // dismantle: returns principal in full, retires the rig id permanently |
| function dismantle(uint256 rigId) external; |
| ``` |
|
|
| ## Operators |
|
|
| ```solidity |
| // the wallet that mines may be owner, assigned operator, or current renter |
| function setOperator(uint256 rigId, address operator) external; |
| function operatorOf(uint256 rigId) external view returns (address); |
| ``` |
|
|
| ## Marketplace and transfers |
|
|
| ```solidity |
| function list(uint256 rigId, uint256 priceWei) external; |
| function cancelListing(uint256 rigId) external; |
| function buy(uint256 rigId) external; // pays seller, transfers rig |
| function transferFrom(address from, address to, uint256 rigId) external; // ERC721 |
| ``` |
|
|
| Activated rigs carry their activation with them. Listing does not pause mining. |
|
|
| ## Leasing |
|
|
| ```solidity |
| // flat: renter pays rateWei per epoch for `epochs` epochs |
| function leaseFlat(uint256 rigId, uint256 rateWei, uint32 epochs) external; |
| |
| // revenue share: renter keeps (10000 - bps) / 10000 of epoch rewards |
| function leaseShare(uint256 rigId, uint16 bps, uint32 epochs) external; |
| |
| function takeLease(uint256 leaseId) external; |
| function endLease(uint256 leaseId) external; // after term, either party |
| ``` |
|
|
| Principal never leaves the owner. Only operation rights move. |
|
|
| ## Pools |
|
|
| ```solidity |
| function joinPool(uint256 poolId, uint256 amount) external; // fractional principal |
| function exitPool(uint256 poolId, uint256 shares) external; |
| function poolClaim(uint256 poolId) external; // pro rata rewards |
| ``` |
|
|
| ## Claims |
|
|
| ```solidity |
| function claimable(address recipient) external view returns (uint256); |
| function claim(uint256[] calldata epochIds) external; |
| ``` |
|
|
| Claims are pull based and never expire. `POST {COORDINATOR}/v1/claims/relay` will |
| broadcast on your behalf if the agent prefers not to hold gas. |
|
|
| ## Events |
|
|
| ```solidity |
| event RigBuilt(uint256 indexed rigId, address indexed owner, uint8 tier); |
| event RigActivated(uint256 indexed rigId, uint256 feeBurned); |
| event RigUpgraded(uint256 indexed rigId, uint8 fromTier, uint8 toTier); |
| event RigDismantled(uint256 indexed rigId, uint256 principalReturned); |
| event EpochSettled(uint256 indexed epoch, uint256 emitted, uint256 burned); |
| event Claimed(address indexed recipient, uint256 amount); |
| ``` |
|
|
| Indexers and the site read these events. Anything the dashboard shows, an agent can |
| reconstruct from chain state alone. |
|
|