Skip to content

Commit

Permalink
Merge branch 'feat-cache-next-tick' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Jul 12, 2023
2 parents 48790ba + 235d062 commit 416ab0f
Show file tree
Hide file tree
Showing 98 changed files with 1,509 additions and 1,168 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/echidna_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ jobs:
- name: Run ${{ matrix.testName }}
uses: crytic/echidna-action@v2
with:
solc-version: 0.8.17
solc-version: 0.8.20
files: ./src/core/contracts/test/echidna/${{ matrix.testName }}.sol
contract: ${{ matrix.testName }}
crytic-args: --hardhat-ignore-compile
solc-args: --evm-version paris
config: ./src/core/contracts/test/echidna/echidna.config.yml

225 changes: 215 additions & 10 deletions docs/Contracts/Core/AlgebraCommunityVault.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@ Algebra community fee vault

Community fee from pools is sent here, if it is enabled

*Developer note: Role system is used to withdraw tokens
Version: Algebra Integral*

## Modifiers
### onlyFactoryOwner


`modifier onlyFactoryOwner()` internal







### onlyWithdrawer


Expand All @@ -20,22 +33,91 @@ Community fee from pools is sent here, if it is enabled



### onlyAlgebraFeeManager


`modifier onlyAlgebraFeeManager()` internal








## Events
### TokensWithdrawal


`event TokensWithdrawal(address token, address to, uint256 amount)`

Event emitted when a fees has been claimed



| Name | Type | Description |
| ---- | ---- | ----------- |
| token | address | The address of token fee |
| to | address | The address where claimed rewards were sent to |
| amount | uint256 | The amount of fees tokens claimed by communityFeeReceiver |


### AlgebraTokensWithdrawal


`event AlgebraTokensWithdrawal(address token, address to, uint256 amount)`

Event emitted when a fees has been claimed



| Name | Type | Description |
| ---- | ---- | ----------- |
| token | address | |
| to | address | |
| amount | uint256 | |
| token | address | The address of token fee |
| to | address | The address where claimed rewards were sent to |
| amount | uint256 | The amount of fees tokens claimed by Algebra |


### AlgebraFeeReceiver


`event AlgebraFeeReceiver(address newAlgebraFeeReceiver)`

Emitted when a AlgebraFeeReceiver address changed



| Name | Type | Description |
| ---- | ---- | ----------- |
| newAlgebraFeeReceiver | address | New Algebra fee receiver address |


### AlgebraFee


`event AlgebraFee(uint16 newAlgebraFee)`

Emitted when the Algebra fee is changed



| Name | Type | Description |
| ---- | ---- | ----------- |
| newAlgebraFee | uint16 | The new Algebra fee value |


### CommunityFeeReceiver


`event CommunityFeeReceiver(address newCommunityFeeReceiver)`

Emitted when a CommunityFeeReceiver address changed



| Name | Type | Description |
| ---- | ---- | ----------- |
| newCommunityFeeReceiver | address | New fee receiver address |



Expand All @@ -45,47 +127,170 @@ Community fee from pools is sent here, if it is enabled


*Developer note: The role can be granted in AlgebraFactory*
### address communityFeeReceiver

Address to which protocol commissions are sent from vault

### uint16 algebraFee

The percentage of the protocol fee that Algebra will receive

*Developer note: Value in thousandths,i.e. 1e-3*
### bool hasNewAlgebraFeeProposal

Represents whether there is a new Algebra fee proposal or not

### uint16 proposedNewAlgebraFee

Suggested Algebra fee value

### address algebraFeeReceiver

Address of recipient Algebra part of community fee

### address algebraFeeManager

Address of Algebra fee manager


## Functions
### constructor


`constructor() public` public
`constructor(address _algebraFeeManager) public` public





| Name | Type | Description |
| ---- | ---- | ----------- |
| _algebraFeeManager | address | |


### withdraw


`function withdraw(address token, address to, uint256 amount) external` external

`function withdraw(address token, uint256 amount) external` external

Withdraw protocol fees from vault
*Developer note: Can only be called by algebraFeeManager or communityFeeReceiver*



| Name | Type | Description |
| ---- | ---- | ----------- |
| token | address | |
| to | address | |
| amount | uint256 | |
| token | address | The token address |
| amount | uint256 | The amount of token |


### withdrawTokens


`function withdrawTokens(struct AlgebraCommunityVault.WithdrawTokensParams[] params) external` external

Withdraw protocol fees from vault. Used to claim fees for multiple tokens
*Developer note: Can be called by algebraFeeManager or communityFeeReceiver*



| Name | Type | Description |
| ---- | ---- | ----------- |
| params | struct AlgebraCommunityVault.WithdrawTokensParams[] | Array of WithdrawTokensParams objects containing token addresses and amounts to withdraw |


### acceptAlgebraFeeChangeProposal


`function acceptAlgebraFeeChangeProposal(uint16 newAlgebraFee) external` external

Accepts the proposed new Algebra fee
*Developer note: Can only be called by the factory owner*



| Name | Type | Description |
| ---- | ---- | ----------- |
| newAlgebraFee | uint16 | New Algebra fee value |


### changeCommunityFeeReceiver


`function changeCommunityFeeReceiver(address newCommunityFeeReceiver) external` external

Change community fee receiver address
*Developer note: Can only be called by the factory owner*



| Name | Type | Description |
| ---- | ---- | ----------- |
| newCommunityFeeReceiver | address | New community fee receiver address |


### transferAlgebraFeeManagerRole


`function transferAlgebraFeeManagerRole(address _newAlgebraFeeManager) external` external

Transfers Algebra fee manager role



| Name | Type | Description |
| ---- | ---- | ----------- |
| _newAlgebraFeeManager | address | new Algebra fee manager address |


### acceptAlgebraFeeManagerRole


`function acceptAlgebraFeeManagerRole() external` external

Accept Algebra fee manager role





### proposeAlgebraFeeChange


`function proposeAlgebraFeeChange(uint16 newAlgebraFee) external` external

Suggests new Algebra fee value



| Name | Type | Description |
| ---- | ---- | ----------- |
| newAlgebraFee | uint16 | new Algebra fee value |


### cancelAlgebraFeeChangeProposal


`function cancelAlgebraFeeChangeProposal() external` external

Cancels Algebra fee change proposal





### changeAlgebraFeeReceiver


`function changeAlgebraFeeReceiver(address newAlgebraFeeReceiver) external` external

Change Algebra community fee part receiver



| Name | Type | Description |
| ---- | ---- | ----------- |
| params | struct AlgebraCommunityVault.WithdrawTokensParams[] | |
| newAlgebraFeeReceiver | address | The address of new Algebra fee receiver |



Expand Down
Loading

0 comments on commit 416ab0f

Please sign in to comment.