This file contains hidden or 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
| { | |
| "config": { | |
| "chainId": 89, | |
| "homesteadBlock": 1, | |
| "eip150Block": 2, | |
| "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", | |
| "eip155Block": 3, | |
| "eip158Block": 3, | |
| "byzantiumBlock": 4, | |
| "posv": { |
This file contains hidden or 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
| pragma solidity ^0.4.21; | |
| /** | |
| * @title ERC20Basic | |
| * @dev Simpler version of ERC20 interface | |
| * @dev see https://github.com/ethereum/EIPs/issues/179 | |
| */ | |
| contract ERC20Basic { | |
| function totalSupply() public view returns (uint256); | |
| function balanceOf(address who) public view returns (uint256); |
This file contains hidden or 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
| pragma solidity ^0.4.21; | |
| /** | |
| * @title ERC20Basic | |
| * @dev Simpler version of ERC20 interface | |
| * @dev see https://github.com/ethereum/EIPs/issues/179 | |
| */ | |
| contract ERC20Basic { | |
| function totalSupply() public view returns (uint256); | |
| function balanceOf(address who) public view returns (uint256); |
This file contains hidden or 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
| pragma solidity ^0.4.21; | |
| contract Airdrop is SimpleToken{ | |
| event Authorized(address members, uint timestamp); | |
| event Mint(address unit, uint256 amount); | |
| mapping(address=>bool) public allMembers; // содержит авторизованный адрес | |
| address[] public members; // массив авторизованных адресов |
This file contains hidden or 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
| pragma solidity ^0.4.21; | |
| import "https://github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol"; | |
| contract WhiteList is Ownable { | |
| mapping (address => bool) public investorWhiteList; | |
| mapping (address => address) public referralList; | |
| function WhiteList() { |
This file contains hidden or 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
| pragma solidity ^0.4.18; | |
| library SafeMath | |
| { | |
| function mul(uint256 a, uint256 b) internal pure | |
| returns (uint256) | |
| { | |
| uint256 c = a * b; | |
| assert(a == 0 || c / a == b); | |
| return c; |
This file contains hidden or 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
| contract Users { | |
| // Здесь хранятся имена. Отображение объявлено как открытое, чтобы | |
| // для него автоматически генерировалась функция-аксессор 'users', | |
| // которая принимает в качестве аргумента строку фиксированной длины. | |
| mapping (bytes32 => address) public users; | |
| // Регистрация предоставленного имени с адресом пользователя, | |
| // вызвавшего функцию. | |
| // Мы не хотим, чтобы пользователи регистрировались с пустым именем. | |
| function register(bytes32 name) { |
This file contains hidden or 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
| function distributionTokens() public onlyOwner { | |
| require(distribute = true); | |
| //_to = beneficiary; | |
| //_value = teamReserve+consultReserve+contingencyFund+marketingReserve+testReserve+bountyReserve; | |
| //_value = _value*DEC; | |
| //avaliableSupply -= _value; | |
| _transfer(this, beneficiary, 24500000*DEC); // frozen all | |
| _transfer(this, team, 7500000*DEC); // immediately Team 1/2 |
This file contains hidden or 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
| В нашем проекте решили эту проблему следующим образом: | |
| Нам необходимо иметь массив всех адресов с нашими токенами. | |
| Если мы хотим решить эту задачу без привлечения оракулов( или внешней обработки, а лишь инструментами смарт контракта) | |
| Нам необходимо в функцию mint - если ваш токен подразумевает выпуск и функцию transfer добавить дополнительный массив | |
| Quote | |
| address[] public invstors_adrees; | |
| И при выпуске токенов или при трансфере проверяем нет ли адреса в масиве и если нету добавляем. Можете делать проверку на исключение итд как пожелаете, но проще без проверки т.к. у вас тогда будет полная база, всех кто использовал ваши токены. | |
| Quote | |
| invstors_adrees.push(_address) -1; | |
| И функцию начисления может перебрать адреса прям в смарт контракте, поскольку мы при сканировании не изменяем переменные и сам блокчейн это не сильно газозатратно. |
This file contains hidden or 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
| function compoundInterest(uint256 depo, uint256 stage2, uint256 start, uint256 current) internal pure returns (uint256) { | |
| assert(current>=start); | |
| assert(start>=stage2); | |
| uint256 ret=depo; uint g; uint d; | |
| stage2=stage2/1 days; | |
| start=start/1 days; | |
| current=current/1 days; | |
| uint dpercent=100; |
NewerOlder