Skip to content

Commit 48ad83d

Browse files
Oxydixigitbook-bot
authored andcommitted
GITBOOK-87: rename USDC -> eccUSDC
1 parent 118f506 commit 48ad83d

5 files changed

Lines changed: 106 additions & 107 deletions

File tree

docs/accumulator-contract-system/api-reference.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Complete reference for all public/external functions, events, and error codes ac
55
## ShellAccumulatorRootUSDC
66

77
Source: `contracts/accumulator/ShellAccumulatorRootUSDC.sol` · Version: 1.0.2\
8-
&#xNAN;_It will be available after the next node release_
8+
\&#xNAN;_It will be available after the next node release_
99

1010
### Entry points
1111

@@ -15,15 +15,15 @@ Source: `contracts/accumulator/ShellAccumulatorRootUSDC.sol` · Version: 1.0.2\
1515
function buyShellFor(address buyer) public
1616
```
1717

18-
Accepts ECC USDC attached to the message and processes a buy on behalf of `buyer`. Used by Exchange to forward purchases. Does **not** check for multi-currency messages — only verifies ECC USDC is present.
18+
Accepts eccUSDC attached to the message and processes a buy on behalf of `buyer`. Used by Exchange to forward purchases. Does **not** check for multi-currency messages — only verifies eccUSDC is present.
1919

2020
#### `claimUSDC(uint16 D, uint64 orderId, address seller)`
2121

2222
```solidity
2323
function claimUSDC(uint16 D, uint64 orderId, address seller) public
2424
```
2525

26-
Called by a SellOrderLot to claim its USDC payout. Verifies caller address deterministically, checks the order is sold (`orderId <= soldPrefix[D]`), sends ECC USDC to `seller`, then calls `onReceiveUSDC` on the lot.
26+
Called by a SellOrderLot to claim its eccUSDC payout. Verifies caller address deterministically, checks the order is sold (`orderId <= soldPrefix[D]`), sends eccUSDC to `seller`, then calls `onReceiveUSDC` on the lot.
2727

2828
### Admin
2929

@@ -60,9 +60,9 @@ function getDetails() external view
6060

6161
Returns high-level contract state.
6262

63-
* `sellerShellPool` — total ECC SHELL held from seller deposits (nanoSHELL)
64-
* `usdcBalance` — total ECC USDC tracked by the contract (microUSDC)
65-
* `owedTotal` — total USDC owed to sellers awaiting claim (microUSDC)
63+
* `sellerShellPool` — total SHELL held from seller deposits (nanoSHELL)
64+
* `usdcBalance` — total eccUSDC tracked by the contract (microUSDC)
65+
* `owedTotal` — total eccUSDC owed to sellers awaiting claim (microUSDC)
6666

6767
#### `getSellOrderAddress(uint16 D, uint64 orderId)`
6868

@@ -79,7 +79,7 @@ Computes the deterministic address of a lot contract given its denomination and
7979
function owedUsdcTotal() external view returns (uint128)
8080
```
8181

82-
Returns total USDC owed to all sellers across all denominations (microUSDC).
82+
Returns total eccUSDC owed to all sellers across all denominations (microUSDC).
8383

8484
#### `getSellerShellPool()`
8585

@@ -95,7 +95,7 @@ Returns total ECC SHELL in the seller pool (nanoSHELL).
9595
function getUsdcBalance() external view returns (uint128)
9696
```
9797

98-
Returns the USDC balance tracked by the contract (microUSDC). This is the accounting balance, not necessarily the on-chain ECC balance.
98+
Returns the eccUSDC balance tracked by the contract (microUSDC). This is the accounting balance, not necessarily the on-chain ECC balance.
9999

100100
#### `getNacklInfo()`
101101

@@ -125,7 +125,7 @@ Returns `("1.0.2", "ShellAccumulatorRootUSDC")`.
125125
## ShellSellOrderLot
126126

127127
Source: `contracts/accumulator/ShellSellOrderLot.sol` · Version: 1.0.2\
128-
&#xNAN;_&#x49;t will be available after the next node release_
128+
\&#xNAN;_It will be available after the next node release_
129129

130130
### Entry points
131131

@@ -135,7 +135,7 @@ Source: `contracts/accumulator/ShellSellOrderLot.sol` · Version: 1.0.2\
135135
function claim() public
136136
```
137137

138-
Initiates USDC payout claim. Sets `_claimed = true` and calls `Root.claimUSDC(denom, orderId, owner)`. If the root rejects (order not yet sold), the bounced message resets `_claimed = false` via `onBounce`.
138+
Initiates eccUSDC payout claim. Sets `_claimed = true` and calls `Root.claimUSDC(denom, orderId, owner)`. If the root rejects (order not yet sold), the bounced message resets `_claimed = false` via `onBounce`.
139139

140140
Can be called by anyone (no `msg.sender` check), but the payout always goes to `_owner` (the original seller).
141141

@@ -159,7 +159,7 @@ function getDetails() external view
159159
Returns all lot metadata.
160160

161161
* `root` — parent Accumulator address
162-
* `owner` — seller address (receives USDC payout)
162+
* `owner` — seller address (receives eccUSDC payout)
163163
* `denom` — lot denomination (1, 10, 100, 1000)
164164
* `orderId` — FIFO position within the denomination queue
165165
* `claimed``true` if `claim()` was called and is pending or completed
@@ -177,7 +177,7 @@ Returns `("1.0.2", "ShellSellOrderLot")`.
177177
## Exchange
178178

179179
Source: `contracts/exchange/Exchange.sol` · Version: 1.0.4\
180-
&#xNAN;_&#x49;t will be available after the next node release_
180+
\&#xNAN;_It will be available after the next node release_
181181

182182
### Entry points
183183

@@ -187,23 +187,23 @@ Source: `contracts/exchange/Exchange.sol` · Version: 1.0.4\
187187
function onTransferReceived(address from, address, uint128 value, uint128) external override
188188
```
189189

190-
ISubscriber callback from the Exchange's TIP-3 USDC wallet. Mints equivalent ECC USDC and sends it to `from` (the depositor). Only callable by `_usdcWallet`.
190+
ISubscriber callback from the Exchange's TIP-3 USDC wallet. Mints equivalent eccUSDC and sends it to `from` (the depositor). Only callable by `_usdcWallet`.
191191

192192
#### `mintAndSend(address recipient, uint128 value, uint64 nonce)`
193193

194194
```solidity
195195
function mintAndSend(address recipient, uint128 value, uint64 nonce) public onlyOwnerPubkey accept
196196
```
197197

198-
Admin-only. Mints ECC USDC and sends to `recipient`. Requires `nonce == _mintNonce + 1`.
198+
Admin-only. Mints eccUSDC and sends to `recipient`. Requires `nonce == _mintNonce + 1`.
199199

200200
#### `mintAndSendAccumulator(address buyer, uint128 value, uint64 nonce)`
201201

202202
```solidity
203203
function mintAndSendAccumulator(address buyer, uint128 value, uint64 nonce) public onlyOwnerPubkey accept
204204
```
205205

206-
Admin-only. Mints ECC USDC and calls `Accumulator.buyShellFor(buyer)` with the minted USDC attached. Requires whole USDC units and `nonce == _mintAccumulatorNonce + 1`. Uses separate nonce space from `mintAndSend`.
206+
Admin-only. Mints eccUSDC and calls `Accumulator.buyShellFor(buyer)` with the minted eccUSDC attached. Requires whole eccUSDC units and `nonce == _mintAccumulatorNonce + 1`. Uses separate nonce space from `mintAndSend`.
207207

208208
### Admin
209209

@@ -247,7 +247,7 @@ Returns the current owner public key.
247247
function getTotalMinted() external view returns (uint128)
248248
```
249249

250-
Returns total ECC USDC minted by this contract across all methods (microUSDC).
250+
Returns total eccUSDC minted by this contract across all methods (microUSDC).
251251

252252
#### `getNonces()`
253253

@@ -270,7 +270,7 @@ Returns `("1.0.4", "Exchange")`.
270270
## AccumulatorLib
271271

272272
Source: `contracts/accumulator/libraries/AccumulatorLib.sol` · Version: 1.0.2\
273-
&#xNAN;_&#x49;t will be available after the next node release_
273+
\&#xNAN;_It will be available after the next node release_
274274

275275
#### `calculateSellOrderAddress(TvmCell code, address root, uint16 denom, uint64 orderId)`
276276

@@ -311,7 +311,7 @@ All events are emitted to **external addresses** (directed events) for off-chain
311311
| ------------------ | -------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
312312
| `SellOrderCreated` | **610** + seller's address | `(address seller, uint16 denom, uint64 orderId, uint128 shellAmount)` | New lot created. Emitted twice: to addr 610 and to the seller's external address |
313313
| `ShellPurchased` | **611** | `(address buyer, uint128 usdcAmount, uint128 shellFromSellers, uint128 shellMinted)` | Buy completed |
314-
| `UsdcClaimed` | **612** | `(uint64 orderId, uint16 denom, address seller, uint128 payout)` | Seller claimed USDC |
314+
| `UsdcClaimed` | **612** | `(uint64 orderId, uint16 denom, address seller, uint128 payout)` | Seller claimed eccUSDC |
315315
| `NacklRedeemed` | **613** | `(address recipient, uint128 burnAmount, uint128 payout)` | NACKL burned for USDC |
316316
| `MatchedOrders` | **617** | `(uint64 lastSold1, uint64 lastSold10, uint64 lastSold100, uint64 lastSold1000)` | Updated soldPrefix values after a buy |
317317

@@ -324,41 +324,41 @@ All events are emitted to **external addresses** (directed events) for off-chain
324324

325325
### Exchange events
326326

327-
| Event | Ext Addr | Fields | Emitted when |
328-
| -------------- | -------- | ------------------------------------ | ----------------------------------------------------------------------- |
329-
| `UsdcMigrated` | **615** | `(address from, uint128 value)` | TIP-3 USDC bridged to ECC |
330-
| `UsdcMinted` | **616** | `(address recipient, uint128 value)` | Admin-minted ECC USDC (from `mintAndSend` and `mintAndSendAccumulator`) |
327+
| Event | Ext Addr | Fields | Emitted when |
328+
| -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------- |
329+
| `UsdcMigrated` | **615** | `(address from, uint128 value)` | TIP-3 USDC bridged to ECC |
330+
| `UsdcMinted` | **616** | `(address recipient, uint128 value)` | Admin-minted eccUSDC (from `mintAndSend` and `mintAndSendAccumulator`) |
331331

332332
***
333333

334334
## Error Codes
335335

336336
### Accumulator errors (Root + SellOrderLot)
337337

338-
| Code | Name | Meaning |
339-
| ---- | ----------------------------- | -------------------------------------------------------- |
340-
| 200 | `ERR_INVALID_DENOM` | Denomination is not 1, 10, 100, or 1000 |
341-
| 201 | `ERR_WRONG_SHELL_AMOUNT` | SHELL amount doesn't divide evenly by SHELL\_PER\_USDC |
342-
| 202 | `ERR_WRONG_USDC_AMOUNT` | USDC amount mismatch in onReceiveUSDC or balance check |
343-
| 203 | `ERR_NOT_WHOLE_USDC` | USDC amount is not a whole number (not divisible by 10⁶) |
344-
| 204 | `ERR_ZERO_AMOUNT` | Zero amount supplied |
345-
| 205 | `ERR_ORDER_NOT_SOLD` | Lot's orderId > soldPrefix (not yet matched) |
346-
| 206 | `ERR_NO_OWED` | No owed claims remaining for this denomination |
347-
| 207 | `ERR_INVALID_SENDER` | Caller is not the expected contract |
348-
| 208 | `ERR_ALREADY_CLAIMED` | claim() already called on this lot |
349-
| 209 | `ERR_NOT_OWNER` | msg.pubkey() doesn't match owner |
350-
| 210 | `ERR_INSUFFICIENT_REDEEMABLE` | Not enough free reserve for NACKL redemption |
351-
| 211 | `ERR_WRONG_CODE` | (reserved) |
352-
| 212 | `ERR_WRONG_ADDRESS` | Caller address doesn't match deterministic lot address |
353-
| 213 | `ERR_MULTIPLE_CURRENCIES` | Message carries more than one ECC currency type |
354-
| 214 | `ERR_OVERFLOW` | Amount exceeds uint64 max |
338+
| Code | Name | Meaning |
339+
| ---- | ----------------------------- | ----------------------------------------------------------- |
340+
| 200 | `ERR_INVALID_DENOM` | Denomination is not 1, 10, 100, or 1000 |
341+
| 201 | `ERR_WRONG_SHELL_AMOUNT` | SHELL amount doesn't divide evenly by SHELL\_PER\_USDC |
342+
| 202 | `ERR_WRONG_USDC_AMOUNT` | eccUSDC amount mismatch in onReceiveUSDC or balance check |
343+
| 203 | `ERR_NOT_WHOLE_USDC` | eccUSDC amount is not a whole number (not divisible by 10⁶) |
344+
| 204 | `ERR_ZERO_AMOUNT` | Zero amount supplied |
345+
| 205 | `ERR_ORDER_NOT_SOLD` | Lot's orderId > soldPrefix (not yet matched) |
346+
| 206 | `ERR_NO_OWED` | No owed claims remaining for this denomination |
347+
| 207 | `ERR_INVALID_SENDER` | Caller is not the expected contract |
348+
| 208 | `ERR_ALREADY_CLAIMED` | claim() already called on this lot |
349+
| 209 | `ERR_NOT_OWNER` | msg.pubkey() doesn't match owner |
350+
| 210 | `ERR_INSUFFICIENT_REDEEMABLE` | Not enough free reserve for NACKL redemption |
351+
| 211 | `ERR_WRONG_CODE` | (reserved) |
352+
| 212 | `ERR_WRONG_ADDRESS` | Caller address doesn't match deterministic lot address |
353+
| 213 | `ERR_MULTIPLE_CURRENCIES` | Message carries more than one ECC currency type |
354+
| 214 | `ERR_OVERFLOW` | Amount exceeds uint64 max |
355355

356356
### Exchange errors
357357

358358
| Code | Name | Meaning |
359359
| ---- | -------------------- | -------------------------------- |
360360
| 204 | `ERR_ZERO_AMOUNT` | Zero value |
361-
| 207 | `ERR_INVALID_SENDER` | Caller is not the USDC wallet |
361+
| 207 | `ERR_INVALID_SENDER` | Caller is not the eccUSDC wallet |
362362
| 209 | `ERR_NOT_OWNER` | msg.pubkey() doesn't match owner |
363363
| 213 | `ERR_NOT_WHOLE_USDC` | Value not divisible by 10⁶ |
364364
| 214 | `ERR_OVERFLOW` | Value exceeds uint64 max |

docs/accumulator-contract-system/architecture.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ flowchart LR
1717
SellOrder[ShellSellOrderLot]
1818
end
1919
20-
User -->|Direct ECC USDC buy| Accumulator
20+
User -->|Direct eccUSDC buy| Accumulator
2121
Owner -->|mintAndSendAccumulator + nonce| Exchange
22-
Exchange -->|buyShellFor + ECC USDC| Accumulator
22+
Exchange -->|buyShellFor + eccUSDC| Accumulator
2323
Accumulator -->|ECC SHELL| User
2424
2525
User -->|ECC SHELL deposit| Accumulator
2626
Accumulator -->|Deploy lot| SellOrder
2727
2828
User -->|claim| SellOrder
2929
SellOrder -->|claimUSDC| Accumulator
30-
Accumulator -->|ECC USDC payout| User
30+
Accumulator -->|eccUSDC payout| User
3131
3232
User -->|ECC NACKL| Accumulator
33-
Accumulator -->|USDC from free reserve| User
33+
Accumulator -->|eccUSDC from free reserve| User
3434
3535
Backend -->|triggerTransaction| Owner
3636
SettlementMonitor -.->|reads queues via getters| Accumulator
@@ -47,7 +47,7 @@ flowchart LR
4747

4848
## Contract roles
4949

50-
**ShellAccumulatorRootUSDC** is the central contract. It holds all ECC balances (USDC and SHELL from sellers), manages four FIFO queues (one per denomination), matches buyers against sellers, mints SHELL when sellers are insufficient, pays out USDC on claims, and handles NACKL redemption.
50+
**ShellAccumulatorRootUSDC** is the central contract. It holds all ECC balances (eccUSDC and SHELL from sellers), manages four FIFO queues (one per denomination), matches buyers against sellers, mints SHELL when sellers are insufficient, pays out USDC on claims, and handles NACKL redemption.
5151

5252
**ShellSellOrderLot** is a lightweight per-order contract deployed by the Root when a seller deposits SHELL. It stores the seller's address, denomination, and order ID. Its only active function is `claim()`, which calls back into Root's `claimUSDC`. After payout confirmation, it self-destructs.
5353

@@ -59,12 +59,12 @@ flowchart LR
5959

6060
Each denomination (1, 10, 100, 1000) has four counters:
6161

62-
| Counter | Meaning |
63-
| ------------ | -------------------------------------------- |
64-
| `nextId` | Next order ID to assign (starts at 1) |
65-
| `available` | Number of lots waiting to be matched |
66-
| `soldPrefix` | Contiguous prefix of sold lots |
67-
| `owedCount` | Sold lots whose USDC hasn't been claimed yet |
62+
| Counter | Meaning |
63+
| ------------ | ----------------------------------------------- |
64+
| `nextId` | Next order ID to assign (starts at 1) |
65+
| `available` | Number of lots waiting to be matched |
66+
| `soldPrefix` | Contiguous prefix of sold lots |
67+
| `owedCount` | Sold lots whose eccUSDC hasn't been claimed yet |
6868

6969
Order IDs are **1-based** (`nextId` starts at 1). The first lot gets `orderId = 1`, the second gets `orderId = 2`, etc. `soldPrefix = 3` means lots 1, 2, 3 are sold.
7070

0 commit comments

Comments
 (0)