I can not introduce you the code that you are, each, you ask you to install the maximum lemite sale for the ERC20 token on your dug Metamascus without the latest Ponimania for the loudspede.
The case does not less, I can give you a common one, how to get to this problem. Immet in the view that I have introduced a given about the downs 0.4.22 and more late version, so as it is, it is a clip of your code from a more early version.
Settings sell tokens in lush
You can use the pursuits for tinkering in the hardness to set the token to the token
1. Using the library
You can use the library erc20Tokensale ', the Openzepelin. This library will introduce a simple spread of prefers to sales tokens.
Here's the primer that you can set it up and use it in your counter:
SILA
Erc20tokensale.sol {library
Setlimit function (Nint256 _Selmount, Nint256 _Buyamount) Public Unpaid {
Demand (_Buyamount> 0 && _Selmount> 0);
_limit = _buyamount;
_maxbuy = _buyamount; // Maximal amount of the proclaim can be rewarded for one transaction
// SOBITE TRIGGER PRIMER PROVIDED
VRAC (_selmount, _maxbuy);
Nour
Nour
Hytokensale - Erc20Tokensale {
NAINT256 PUBLIC _limit;
Naint256 public _maxbuy;
SETLIMITE (NINT256 _Selmount, Nint256 _Buyamount) Public {
Super.setlimit (_buyamount, _selmount);
Demand (_Buyamount> 0 && _Selmount> 0);
Nour
// SOBITE TRIGGER PRIMER PROVIDED
Limittet256 _selmount function, nint256 _maxbuy) Post -pass {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
VRAC (_selmount, _maxbuy);
Nour
Nour
2. Using Simple Logiki
More Odin Sava Relolization Limites Sales Tokens – Using a simple logic in your counter. This can be included in the setting of the substitute `_buyamount
and _selmount
before every transaction.
That’s the Primer:
`SILA
Hytokensale - Erc20 {
Nint256 Public _Buyamount;
NAINT256 PUBLIC _SELMOUNT;
Setlimit function (Nint256 _Selmount, Nint256 _Buyamount) Public Unpaid {
Demand (_Buyamount> 0 && _Selmount> 0);
// Install the shopping and sum sales for all the pads
for (nint256 I = 0; I
if (_buyamount> 0) {{
Transferstochene (address (this) and, _buyamount);
} Still {
// If a shopping is not cut, nothing
Nour
Nour
_Buyamount = _selmount;
Nour
Nour
IMPORTANT COMMUNICATION
–
Security : Any resolution that you realize, should be killed that they are immodest. The sales of the toquinity are no need to be ogricted without the lying testing and cuts.
–
Cataball : obligatory observance of all compatible rules, especially in yurisdction, where the sale of the token lies in particular law or law.
–
Polish experience : Realization of the Ogranic for the sale of tokens can be posted on the Polish experience. Immet in the view of the installation of Ogrannikova.
This is all the way to the right point, and you should be triggered by the concepts and the priers, to take them in your project. All the way to blossom the potential pums and take advantage that your resolution is hormonized with your underwear.