Comment on page
💳
Transaction Limits
sERC20 takes full control when handling transaction limits. The built in methods control both your maximum single transaction amounts and maximum wallet balances.
The maximum single transaction amount must be less than or equal to the maximum wallet amount.
The maximum wallet amount must be equal to or higher than the maximum single transaction amount.
The maximum single transaction amount can never be lowered, it is important that you set a sensible default during initialisation.
Like the maximum single transaction amount, the maximum wallet amount also can never be lowered. Again it is important that you set a sensible default during initialisation.
sERC20 will automatically initialise with 0 max single transaction limit and 0 max wallet limit. These must be manually set before you can open trading.
function sercSetMaxTx(uint256 _maxTx) external onlyOwner
function sercSetMaxWallet(uint256 _maxWallet) external onlyOwner
Call these contract methods to set your max transactions limits, remember this must be done before trading can be opened.
Unlike taxes, the sERC20 contract takes full control of changes to your transaction limits. Under the hood the library exposes the following functions for your convenience.
function sercSetMaxTx(uint256 _maxTx) external onlyOwner
This method access the maximum single transaction amount as an exact amount - i.e x 10**decimals
function sercSetMaxWallet(uint256 _maxWallet) external onlyOwner
This method access the maximum wallet amount as an exact amount - i.e x 10**decimals
The sERC20 contract exposes functions for reading the current transaction limits. You should NEVER handle these yourself, always refer to our built in methods to maintain your sERC20 implementation integrity.
// External usage
function sercMaxTx() public view returns (uint256)
// Internal usage
function _sercMaxTx() internal view returns (uint256)
// External usage
function sercMaxWallet() public view returns (uint256)
// Internal usage
function _sercMaxWallet() internal view returns (uint256)
Remember! ALWAYS use our build in methods any time you access state that can be controlled by sERC20, doing otherwise compromises your implementation integrity.
Last modified 1yr ago