-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
439 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Solidity API | ||
|
||
## BalancerV2FeeToken | ||
|
||
You can use this contract launch your own token or to study the Balancer ecosystem | ||
|
||
_Based on top OpenZeppelin contracts but changed balances from private to internal for flexibility_ | ||
|
||
### isTaxless | ||
|
||
```solidity | ||
mapping(address => bool) isTaxless | ||
``` | ||
|
||
List of address that won't pay transaction fees | ||
|
||
### feeReceiver | ||
|
||
```solidity | ||
address feeReceiver | ||
``` | ||
|
||
Address that will recieve fees taken from each transaction | ||
|
||
### isFeeActive | ||
|
||
```solidity | ||
bool isFeeActive | ||
``` | ||
|
||
If set to true, no fees will be taken on any transaction | ||
|
||
### fees | ||
|
||
```solidity | ||
uint256[] fees | ||
``` | ||
|
||
Array that defines the transactions fees. Index 0 is buy fee, 1 is sell fee and 2 is peer to peer fee | ||
|
||
### feeDecimals | ||
|
||
```solidity | ||
uint256 feeDecimals | ||
``` | ||
|
||
Number if fee decimals. Default is 2 so for example 250 means 2.5% in percentage numbers | ||
|
||
### balancerVault | ||
|
||
```solidity | ||
address balancerVault | ||
``` | ||
|
||
Balancer vault constant address | ||
|
||
### constructor | ||
|
||
```solidity | ||
constructor(string name, string symbol, uint256 totalSupply_, uint256 buyFeePercentage, uint256 sellFeePercentage, uint256 p2pFeePercentage, address feeReceiver_) internal | ||
``` | ||
|
||
Contract constructor | ||
|
||
_All percentage numbers are two digit decimals. For example 250 means 2.5%_ | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| name | string | Token Name | | ||
| symbol | string | Token Symbol | | ||
| totalSupply_ | uint256 | Total supply, all supply will be sent to contract deployer | | ||
| buyFeePercentage | uint256 | Percent of tokens that will be sent to the feeReciever when token is bought on Balancer | | ||
| sellFeePercentage | uint256 | Percent of tokens that will be sent to the feeReciever when token is sold on Balancer | | ||
| p2pFeePercentage | uint256 | Percent of tokens that will be sent to the feeReciever when token is transfered outside of Balancer | | ||
| feeReceiver_ | address | Address that will recieve the fees taken every transaction | | ||
|
||
### _transfer | ||
|
||
```solidity | ||
function _transfer(address from, address to, uint256 amount) internal virtual | ||
``` | ||
|
||
This functions is inherited from OpenZeppelin and implements the transaction fee distribution | ||
|
||
### setTaxless | ||
|
||
```solidity | ||
function setTaxless(address account, bool value) external | ||
``` | ||
|
||
Set excemptions for transaction fee payments | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| account | address | Address that tax configuration will be affected | | ||
| value | bool | If set to true the account will not pay transaction fees | | ||
|
||
### setFeeActive | ||
|
||
```solidity | ||
function setFeeActive(bool value) public | ||
``` | ||
|
||
Set excemptions for all transaction fee payments | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| value | bool | If set to true all transaction fees will not be charged | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Solidity API | ||
|
||
## UniswapV2AutoSwapToken | ||
|
||
### minTokensBeforeSwap | ||
|
||
```solidity | ||
uint256 minTokensBeforeSwap | ||
``` | ||
|
||
### autoSwapReciever | ||
|
||
```solidity | ||
address autoSwapReciever | ||
``` | ||
|
||
### lastFeeActive | ||
|
||
```solidity | ||
bool lastFeeActive | ||
``` | ||
|
||
### Swap | ||
|
||
```solidity | ||
event Swap(uint256 amountSent) | ||
``` | ||
|
||
### constructor | ||
|
||
```solidity | ||
constructor(string name, string symbol, uint256 totalSupply_, uint256 buyFeePercentage, uint256 sellFeePercentage, uint256 p2pFeePercentage, address autoSwapReciever_, address routerAddress, address baseTokenAddress, uint256 minTokensBeforeSwapPercent) internal | ||
``` | ||
|
||
### lockTheSwap | ||
|
||
```solidity | ||
modifier lockTheSwap() | ||
``` | ||
|
||
### _transfer | ||
|
||
```solidity | ||
function _transfer(address from, address to, uint256 amount) internal virtual | ||
``` | ||
|
||
### setMinTokensBeforeSwapPercent | ||
|
||
```solidity | ||
function setMinTokensBeforeSwapPercent(uint256 percentage) public | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Solidity API | ||
|
||
## UniswapV2FeeToken | ||
|
||
### isTaxless | ||
|
||
```solidity | ||
mapping(address => bool) isTaxless | ||
``` | ||
|
||
### feeReceiver | ||
|
||
```solidity | ||
address feeReceiver | ||
``` | ||
|
||
### isFeeActive | ||
|
||
```solidity | ||
bool isFeeActive | ||
``` | ||
|
||
### fees | ||
|
||
```solidity | ||
uint256[] fees | ||
``` | ||
|
||
### feeDecimals | ||
|
||
```solidity | ||
uint256 feeDecimals | ||
``` | ||
|
||
### pair | ||
|
||
```solidity | ||
address pair | ||
``` | ||
|
||
### router | ||
|
||
```solidity | ||
contract ISwapRouter router | ||
``` | ||
|
||
### baseToken | ||
|
||
```solidity | ||
contract IERC20 baseToken | ||
``` | ||
|
||
### constructor | ||
|
||
```solidity | ||
constructor(string name, string symbol, uint256 totalSupply_, uint256 buyFeePercentage, uint256 sellFeePercentage, uint256 p2pFeePercentage, address feeReceiver_, address routerAddress, address baseTokenAddress) internal | ||
``` | ||
|
||
### _transfer | ||
|
||
```solidity | ||
function _transfer(address from, address to, uint256 amount) internal virtual | ||
``` | ||
|
||
### _setTaxless | ||
|
||
```solidity | ||
function _setTaxless(address account, bool isTaxless_) internal | ||
``` | ||
|
||
### _setFeeReceiver | ||
|
||
```solidity | ||
function _setFeeReceiver(address feeReceiver_) internal | ||
``` | ||
|
||
### _setFeeActive | ||
|
||
```solidity | ||
function _setFeeActive(bool isFeeActive_) internal | ||
``` | ||
|
||
### _setPair | ||
|
||
```solidity | ||
function _setPair(address router_, address baseToken_) internal | ||
``` | ||
|
||
### _setFees | ||
|
||
```solidity | ||
function _setFees(uint256 buyFeePercentage, uint256 sellFeePercentage, uint256 p2pFeePercentage) internal | ||
``` | ||
|
Oops, something went wrong.