Skip to content

Commit

Permalink
docs: review extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Dec 7, 2023
1 parent 39c353f commit 7b98477
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions docs/src/content/extensions/accounting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ The Accounting Extension is a contract that allows users to deposit and bond fun

### Key Methods

- `deposit(IERC20 _token, uint256 _amount)`: This function allows a user to deposit a specific amount of a token into the accounting extension. If ETH is being deposited, it is wrapped to WETH.
- `withdraw(IERC20 _token, uint256 _amount)`: By calling this function, a user can withdraw a specific amount of a token from the accounting extension.
- `bond(address _bonder, bytes32 _requestId, IERC20 _token, uint256 _amount)`: This function allows a user to lock a specific amount of a token for a specific request. The tokens stay in the accounting extension and will not be withdrawable until they are released by a module.
- `release(address _bonder, bytes32 _requestId, IERC20 _token, uint256 _amount)`: This function allows a module to release a specific amount of a token that was previously bonded to a request. The tokens will be moved back to the user's balance.
- `pay(bytes32 _requestId, address _payer, address _receiver, IERC20 _token, uint256 _amount)`: Transfers a specific amount of a bonded token from the payer to the receiver. This function can only be called by a module.
- `deposit`: Allows a user to deposit a specific amount of a token into the accounting extension. If ETH is being deposited, it is wrapped to WETH.
- `withdraw`: By calling this function, a user can withdraw a specific amount of a token from the accounting extension.
- `bond`: Allows a user to lock a specific amount of a token for a specific request. The tokens stay in the accounting extension and will not be withdrawable until they are released by a module.
- `release`: Allows a module to release a specific amount of a token that was previously bonded to a request. The tokens will be moved back to the user's balance.
- `pay`: Transfers a specific amount of a bonded token from the payer to the receiver. This function can only be called by a module.

## 3. Key Mechanisms & Concepts

- Deposits: Users can deposit tokens into the Accounting Extension. These deposits are tracked in a mapping that associates each user's address with their balance of each token. Deposits can be made in any ERC20 token, including wrapped Ether (WETH).
- **Deposits**: Users can deposit tokens into the Accounting Extension. These deposits are tracked in a mapping that associates each user's address with their balance of each token. Deposits can be made in any ERC20 token, including wrapped Ether (WETH).

- Withdrawals: Users can withdraw their deposited tokens at any time, provided they have sufficient balance. The withdrawal operation reduces the user's balance in the Accounting Extension and transfers the tokens back to the user's address. Locked tokens can't be withdrawn until they're released by a module.
- **Withdrawals**: Users can withdraw their deposited tokens at any time, provided they have sufficient balance. The withdrawal operation reduces the user's balance in the Accounting Extension and transfers the tokens back to the user's address. Locked tokens can't be withdrawn until they're released by a module.

- Bonding: Users can lock their tokens up for to be allowed to participate in a request. Tokens stay in the accounting extension but they cannot be withdrawn until the request is finalized or the tokens are released.
- **Bonding**: Users can lock their tokens up for to be allowed to participate in a request. Tokens stay in the accounting extension but they cannot be withdrawn until the request is finalized or the tokens are released.

- Payments: The Accounting Extension allows for payments to be made from one user to another. This usually means rewards for correct proposers and disputers and slashing malicious actors. It's done by unlocking and transferring the bonded tokens from the payer to the receiver's balance. Payments can only be initiated by modules.
- **Payments**: The Accounting Extension allows for payments to be made from one user to another. This usually means rewards for correct proposers and disputers and slashing malicious actors. It's done by unlocking and transferring the bonded tokens from the payer to the receiver's balance. Payments can only be initiated by modules.

- Releasing Bonds: Bonds can be released by allowed modules, which moves the bonded tokens back to the user's balance, making them available for withdrawal or bonding to a different request.
- **Releasing Bonds**: Bonds can be released by allowed modules, which moves the bonded tokens back to the user's balance, making them available for withdrawal or bonding to a different request.

## 4. Gotchas

Expand Down
8 changes: 4 additions & 4 deletions docs/src/content/extensions/bond_escalation_accounting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ The `BondEscalationAccounting` contract is an extension that allows users to dep

### Key Methods

- `deposit`: This function allows a user to deposit a specific amount of a token into the accounting extension. If ETH is being deposited, it is wrapped to WETH.
- `deposit`: Allows a user to deposit a specific amount of a token into the accounting extension. If ETH is being deposited, it is wrapped to WETH.
- `withdraw`: By calling this function, a user can withdraw a specific amount of a token from the accounting extension.
- `pledge`: This function allows a user to pledge a certain amount of tokens for a specific dispute. The pledged tokens are deducted from the user's balance and added to the total pledges for the dispute.
- `settleBondEscalation`: This function unlocks the rewards for the winners.
- `pledge`: Allows a user to pledge a certain amount of tokens for a specific dispute. The pledged tokens are deducted from the user's balance and added to the total pledges for the dispute.
- `onSettleBondEscalation`: Unlocks the rewards for the winners.
- `claimEscalationReward`: Calculates and transfers the caller's part of the reward to them.
- `releasePledge`: This function allows a module to release a user's tokens.
- `releasePledge`: Allows a module to release a user's tokens.

## 3. Key Mechanisms & Concepts

Expand Down

0 comments on commit 7b98477

Please sign in to comment.