From f2b4e7f6a58b9bfeacbf0945d2e1071c64b4a4d7 Mon Sep 17 00:00:00 2001 From: Igor Barinov <424628+igorbarinov@users.noreply.github.com> Date: Thu, 11 Jan 2018 11:56:46 -0800 Subject: [PATCH] first commit --- .gitignore | 1 + LICENSE | 21 + README.md | 72 + ...F8fC0921880Cb7342368BD128eb8050442B1a1.zip | Bin 0 -> 49498 bytes .../001_SafeMathLibExt.sol | 46 + .../002_SafeMathLibExt.txt | 31 + .../003_CrowdsaleTokenExt.sol | 722 ++++++++ .../004_CrowdsaleTokenExt.txt | 35 + .../005_FlatPricingExt.sol | 1026 +++++++++++ .../006_FlatPricingExt.txt | 35 + .../007_MintedTokenCappedCrowdsaleExt.sol | 1262 +++++++++++++ .../008_MintedTokenCappedCrowdsaleExt.txt | 35 + .../009_ReservedTokensFinalizeAgent.sol | 1633 +++++++++++++++++ .../010_ReservedTokensFinalizeAgent.txt | 35 + 14 files changed, 4954 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1.zip create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/001_SafeMathLibExt.sol create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/002_SafeMathLibExt.txt create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/003_CrowdsaleTokenExt.sol create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/004_CrowdsaleTokenExt.txt create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/005_FlatPricingExt.sol create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/006_FlatPricingExt.txt create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/007_MintedTokenCappedCrowdsaleExt.sol create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/008_MintedTokenCappedCrowdsaleExt.txt create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/009_ReservedTokensFinalizeAgent.sol create mode 100755 icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/010_ReservedTokensFinalizeAgent.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ad878a9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Oracles Network + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..39252c3 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +# Oracles Network crowdsale contracts for audit + +## Overview + +Contracts for this repo are created for the [unnamed](#) crowdsale. + +Contracts are generated by [ICO Wizard](https://github.com/poanetwork/ico-wizard). + +## Parameters + +### Token + +Parameters of ICO Wizard used to generate the instance of token contract for the audit. + +| Field | Value | +|-----------------|--------------| +| Token name | Block Array | +| Token Ticker | ARY | +| Decimals | 18 | +| Reserved tokens | None | + +Remarks: +- "Reserved tokens - None" no % or fixed tokens +- For that crowdsale created tokens will not be movable after the crowdsale. They will only indicate purchased amounts of tokens. Actual tokens will be created on the right side of the bridge on Oracles Network. + +### Crowdsale + +Parameters of ICO Wizard used to generate the instance of crowdsale for the audit. + +| Field | Value | +|-------------------- |--------------------------- | +| Tiers | 1 | +| Supply | 176,722,560 | +| Rate | 4241 | +| Allow modifying | No | +| Disable whitelist | No | +| Start date | 1 December, 2017 9am PST | +| End date | 15 December, 2017 3pm PST | + +Remarks: + +- Rate - how many tokens for 1 ETH +- Supply - max cap of tokens. Token is mintable. Unsold tokens will not be produced. +- "Allow modifying - No" means that rate, supply, start date, end date are not modifiable. +- "Disable whitelist - No" means that whitelist is enable and only whitelisted accounts could participate in the crowdsale. + +## Source code and deployed contracts + +Source code for code audit is located in [/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/](https://github.com/oraclesorg/ico-wizard-audit/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1) folder of the repository + +### Files structure + +Files have prefixes corresponding to order of execution, e.g. a file with prefix `001_` will be deployed before a file with prefix `002_`. + +A `.sol` file contain contract code. +A `.txt` file contain metadata + +### Deployed contracts +Contracts are deployed on Kovan and verified +- `SafeMathLibExt`. The code of verified [SafeMathLibExt is here](https://kovan.etherscan.io/address/0x4b360178A24E30eF5e526075688462f58839f35d#code). +- `CrowdsaleTokenExt`. The token contract. The code of verified [CrowdsaleTokenExt is here](https://kovan.etherscan.io/address/0xE46DF67c7BADf7220850B65b7Cf81801c86A0753#code). +- `FlatPricingExt`. The pricing strategy contract. The code of verified [FlatPricingExt is here](https://kovan.etherscan.io/address/0xf175eB9c6Ab88CAaD8b781Fa6c3F2E228bDE7c61#code). +- `MintedTokenCappedCrowdsaleExt`. The crowdsale contract for a tier. The code of verified [MintedTokenCappedCrowdsaleExt is here](https://kovan.etherscan.io/address/0x88B0C54aa5155d203ec28492DC2d985dD6eCB6E6#code). +- `NullFinalizeAgentExt`. The finalize agent contract. The example of verified [NullFinalizeAgentExt is here](https://kovan.etherscan.io/address/0xc328C8A5e9011819f92D4505e027858a60dd65Ef#code). + +## Deployment stage + +After all of the contracts are deployed next methods are executed at deployment stage: +- `setMintAgent` - sets `finalizeAgent` contract and crowdsale contract addresses as mint agents of token contract. +- `setFinalizeAgent` - sets `finalizeAgent` contract address as a finalize agent of the crowdsale contract. +- `setReleaseAgent` - sets `finalizeAgent` contract address as a release agent of token contract. +- `transferOwnership` - transfers ownership of token contract to the address that holds collected ether, which filled at step 2 of ICO Wizard. diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1.zip b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1.zip new file mode 100644 index 0000000000000000000000000000000000000000..7815eebb32023fe0f1f67f25c1be0009f10cc177 GIT binary patch literal 49498 zcmdSAbCfObvL#x!ZQHhMmu=g&ZQHh8waeaR8@p`VuHL`X=iWZ=j_y0|d*}2U-ML1t zT>s>VT=C5r5#NkRc`0BJD1g6?LM3YHzy0|87cT$;fQ6Brn}w%=qp_ZhfrYKDiL)Mq zy8){xhp8|FClezF2ZOL7J2MLtGaHA{4@M>q6GILLRt6RpCLu-xMtT)>7=XDtHO-r9 zHO)sr6ae`@rceMN{(Pua{-35q|5;OXKa}*8ob4P<{>|oJcK@<@na&OOivi(>Sq!uk z3mxUAJ%Fvg$QWcB0H|92^BmzCVk3&8JZYdu;-hM$p9PK_!0Jt#o<9she+)BU;woBj zE!#9zd{L5_8>HRO)+DISO$V}f*|3*ey^#)!wT;3lj9s`&h z0UNLZ8zJZgRbUc8X_uhSADAOF7(_4wl|kp^FZY5&K!^8nu>Ntk`=9fFfK;?TTk7vr z_}fM4p9Luc1CySTfvJg%fwQ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128eb8050442B1a1/001_SafeMathLibExt.sol new file mode 100755 index 0000000..f7e1e51 --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/001_SafeMathLibExt.sol @@ -0,0 +1,46 @@ +// Created using ICO Wizard https://github.com/oraclesorg/ico-wizard by Oracles Network +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + +pragma solidity ^0.4.6; + +/** + * Safe unsigned safe math. + * + * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli + * + * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol + * + * Maintained here until merged to mainline zeppelin-solidity. + * + */ +library SafeMathLibExt { + + function times(uint a, uint b) returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function divides(uint a, uint b) returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function minus(uint a, uint b) returns (uint) { + assert(b <= a); + return a - b; + } + + function plus(uint a, uint b) returns (uint) { + uint c = a + b; + assert(c>=a); + return c; + } + +} diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/002_SafeMathLibExt.txt b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/002_SafeMathLibExt.txt new file mode 100755 index 0000000..821813c --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/002_SafeMathLibExt.txt @@ -0,0 +1,31 @@ +Token name: Block Array + +Token ticker: ARY + +Token decimals: 18 + +Multisig wallet address: 0x0239033Ef9384313a6eC6506Ae5B4A0af5c66A31 + +***************************** + +Crowdsale rate: 4731 + +Crowdsale start time: 2017-12-23T17:55 (GMT - 5) + +Crowdsale end time: 2018-01-14T18:00 (GMT - 5) + +Compiler Version: 0.4.11 + +Is optimization enabled?: true + +***************************** + +SafeMathLib library name: SafeMathLibExt + +SafeMathLib library address: 0xcdcd0638664657Ed3B031A75e00E02e47057e226 + +***************************** + +****SafeMathLib contract ABI:**** + +[{"constant":false,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"times","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"plus","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"divides","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"minus","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"}] \ No newline at end of file diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/003_CrowdsaleTokenExt.sol b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/003_CrowdsaleTokenExt.sol new file mode 100755 index 0000000..7ef4dd3 --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/003_CrowdsaleTokenExt.sol @@ -0,0 +1,722 @@ +// Created using ICO Wizard https://github.com/oraclesorg/ico-wizard by Oracles Network +pragma solidity ^0.4.11; + + +/** + * @title ERC20Basic + * @dev Simpler version of ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/179 + */ +contract ERC20Basic { + uint256 public totalSupply; + function balanceOf(address who) public constant returns (uint256); + function transfer(address to, uint256 value) public returns (bool); + event Transfer(address indexed from, address indexed to, uint256 value); +} + + + +/** + * @title Ownable + * @dev The Ownable contract has an owner address, and provides basic authorization control + * functions, this simplifies the implementation of "user permissions". + */ +contract Ownable { + address public owner; + + + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + + + /** + * @dev The Ownable constructor sets the original `owner` of the contract to the sender + * account. + */ + function Ownable() { + owner = msg.sender; + } + + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + require(msg.sender == owner); + _; + } + + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) onlyOwner public { + require(newOwner != address(0)); + OwnershipTransferred(owner, newOwner); + owner = newOwner; + } + +} +// Temporarily have SafeMath here until all contracts have been migrated to SafeMathLib version from OpenZeppelin + + + + +/** + * Math operations with safety checks + */ +contract SafeMath { + function safeMul(uint a, uint b) internal returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function safeDiv(uint a, uint b) internal returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function safeSub(uint a, uint b) internal returns (uint) { + assert(b <= a); + return a - b; + } + + function safeAdd(uint a, uint b) internal returns (uint) { + uint c = a + b; + assert(c>=a && c>=b); + return c; + } + + function max64(uint64 a, uint64 b) internal constant returns (uint64) { + return a >= b ? a : b; + } + + function min64(uint64 a, uint64 b) internal constant returns (uint64) { + return a < b ? a : b; + } + + function max256(uint256 a, uint256 b) internal constant returns (uint256) { + return a >= b ? a : b; + } + + function min256(uint256 a, uint256 b) internal constant returns (uint256) { + return a < b ? a : b; + } + +} +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + + + + +/** + * @title ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/20 + */ +contract ERC20 is ERC20Basic { + function allowance(address owner, address spender) public constant returns (uint256); + function transferFrom(address from, address to, uint256 value) public returns (bool); + function approve(address spender, uint256 value) public returns (bool); + event Approval(address indexed owner, address indexed spender, uint256 value); +} + + + + +/** + * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. + * + * Based on code by FirstBlood: + * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol + */ +contract StandardToken is ERC20, SafeMath { + + /* Token supply got increased and a new owner received these tokens */ + event Minted(address receiver, uint amount); + + /* Actual balances of token holders */ + mapping(address => uint) balances; + + /* approve() allowances */ + mapping (address => mapping (address => uint)) allowed; + + /* Interface declaration */ + function isToken() public constant returns (bool weAre) { + return true; + } + + function transfer(address _to, uint _value) returns (bool success) { + balances[msg.sender] = safeSub(balances[msg.sender], _value); + balances[_to] = safeAdd(balances[_to], _value); + Transfer(msg.sender, _to, _value); + return true; + } + + function transferFrom(address _from, address _to, uint _value) returns (bool success) { + uint _allowance = allowed[_from][msg.sender]; + + balances[_to] = safeAdd(balances[_to], _value); + balances[_from] = safeSub(balances[_from], _value); + allowed[_from][msg.sender] = safeSub(_allowance, _value); + Transfer(_from, _to, _value); + return true; + } + + function balanceOf(address _owner) constant returns (uint balance) { + return balances[_owner]; + } + + function approve(address _spender, uint _value) returns (bool success) { + + // To change the approve amount you first have to reduce the addresses` + // allowance to zero by calling `approve(_spender, 0)` if it is not + // already 0 to mitigate the race condition described here: + // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; + + allowed[msg.sender][_spender] = _value; + Approval(msg.sender, _spender, _value); + return true; + } + + function allowance(address _owner, address _spender) constant returns (uint remaining) { + return allowed[_owner][_spender]; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Upgrade agent interface inspired by Lunyr. + * + * Upgrade agent transfers tokens to a new contract. + * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. + */ +contract UpgradeAgent { + + uint public originalSupply; + + /** Interface marker */ + function isUpgradeAgent() public constant returns (bool) { + return true; + } + + function upgradeFrom(address _from, uint256 _value) public; + +} + + +/** + * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. + * + * First envisioned by Golem and Lunyr projects. + */ +contract UpgradeableToken is StandardToken { + + /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ + address public upgradeMaster; + + /** The next contract where the tokens will be migrated. */ + UpgradeAgent public upgradeAgent; + + /** How many tokens we have upgraded by now. */ + uint256 public totalUpgraded; + + /** + * Upgrade states. + * + * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun + * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet + * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet + * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens + * + */ + enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} + + /** + * Somebody has upgraded some of his tokens. + */ + event Upgrade(address indexed _from, address indexed _to, uint256 _value); + + /** + * New upgrade agent available. + */ + event UpgradeAgentSet(address agent); + + /** + * Do not allow construction without upgrade master set. + */ + function UpgradeableToken(address _upgradeMaster) { + upgradeMaster = _upgradeMaster; + } + + /** + * Allow the token holder to upgrade some of their tokens to a new contract. + */ + function upgrade(uint256 value) public { + + UpgradeState state = getUpgradeState(); + if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) { + // Called in a bad state + throw; + } + + // Validate input value. + if (value == 0) throw; + + balances[msg.sender] = safeSub(balances[msg.sender], value); + + // Take tokens out from circulation + totalSupply = safeSub(totalSupply, value); + totalUpgraded = safeAdd(totalUpgraded, value); + + // Upgrade agent reissues the tokens + upgradeAgent.upgradeFrom(msg.sender, value); + Upgrade(msg.sender, upgradeAgent, value); + } + + /** + * Set an upgrade agent that handles + */ + function setUpgradeAgent(address agent) external { + + if(!canUpgrade()) { + // The token is not yet in a state that we could think upgrading + throw; + } + + if (agent == 0x0) throw; + // Only a master can designate the next agent + if (msg.sender != upgradeMaster) throw; + // Upgrade has already begun for an agent + if (getUpgradeState() == UpgradeState.Upgrading) throw; + + upgradeAgent = UpgradeAgent(agent); + + // Bad interface + if(!upgradeAgent.isUpgradeAgent()) throw; + // Make sure that token supplies match in source and target + if (upgradeAgent.originalSupply() != totalSupply) throw; + + UpgradeAgentSet(upgradeAgent); + } + + /** + * Get the state of the token upgrade. + */ + function getUpgradeState() public constant returns(UpgradeState) { + if(!canUpgrade()) return UpgradeState.NotAllowed; + else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent; + else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade; + else return UpgradeState.Upgrading; + } + + /** + * Change the upgrade master. + * + * This allows us to set a new owner for the upgrade mechanism. + */ + function setUpgradeMaster(address master) public { + if (master == 0x0) throw; + if (msg.sender != upgradeMaster) throw; + upgradeMaster = master; + } + + /** + * Child contract can enable to provide the condition when the upgrade can begun. + */ + function canUpgrade() public constant returns(bool) { + return true; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + +/** + * Define interface for releasing the token transfer after a successful crowdsale. + */ +contract ReleasableToken is ERC20, Ownable { + + /* The finalizer contract that allows unlift the transfer limits on this token */ + address public releaseAgent; + + /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ + bool public released = false; + + /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ + mapping (address => bool) public transferAgents; + + /** + * Limit token transfer until the crowdsale is over. + * + */ + modifier canTransfer(address _sender) { + + if(!released) { + if(!transferAgents[_sender]) { + throw; + } + } + + _; + } + + /** + * Set the contract that can call release and make the token transferable. + * + * Design choice. Allow reset the release agent to fix fat finger mistakes. + */ + function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { + + // We don't do interface check here as we might want to a normal wallet address to act as a release agent + releaseAgent = addr; + } + + /** + * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. + */ + function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { + transferAgents[addr] = state; + } + + /** + * One way function to release the tokens to the wild. + * + * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). + */ + function releaseTokenTransfer() public onlyReleaseAgent { + released = true; + } + + /** The function can be called only before or after the tokens have been releasesd */ + modifier inReleaseState(bool releaseState) { + if(releaseState != released) { + throw; + } + _; + } + + /** The function can be called only by a whitelisted release agent. */ + modifier onlyReleaseAgent() { + if(msg.sender != releaseAgent) { + throw; + } + _; + } + + function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { + // Call StandardToken.transfer() + return super.transfer(_to, _value); + } + + function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { + // Call StandardToken.transferForm() + return super.transferFrom(_from, _to, _value); + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Safe unsigned safe math. + * + * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli + * + * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol + * + * Maintained here until merged to mainline zeppelin-solidity. + * + */ +library SafeMathLibExt { + + function times(uint a, uint b) returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function divides(uint a, uint b) returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function minus(uint a, uint b) returns (uint) { + assert(b <= a); + return a - b; + } + + function plus(uint a, uint b) returns (uint) { + uint c = a + b; + assert(c>=a); + return c; + } + +} + + + + +/** + * A token that can increase its supply by another contract. + * + * This allows uncapped crowdsale by dynamically increasing the supply when money pours in. + * Only mint agents, contracts whitelisted by owner, can mint new tokens. + * + */ +contract MintableTokenExt is StandardToken, Ownable { + + using SafeMathLibExt for uint; + + bool public mintingFinished = false; + + /** List of agents that are allowed to create new tokens */ + mapping (address => bool) public mintAgents; + + event MintingAgentChanged(address addr, bool state ); + + /** inPercentageUnit is percents of tokens multiplied to 10 up to percents decimals. + * For example, for reserved tokens in percents 2.54% + * inPercentageUnit = 254 + * inPercentageDecimals = 2 + */ + struct ReservedTokensData { + uint inTokens; + uint inPercentageUnit; + uint inPercentageDecimals; + } + + mapping (address => ReservedTokensData) public reservedTokensList; + address[] public reservedTokensDestinations; + uint public reservedTokensDestinationsLen = 0; + + function setReservedTokensList(address addr, uint inTokens, uint inPercentageUnit, uint inPercentageDecimals) onlyOwner { + reservedTokensDestinations.push(addr); + reservedTokensDestinationsLen++; + reservedTokensList[addr] = ReservedTokensData({inTokens:inTokens, inPercentageUnit:inPercentageUnit, inPercentageDecimals: inPercentageDecimals}); + } + + function getReservedTokensListValInTokens(address addr) constant returns (uint inTokens) { + return reservedTokensList[addr].inTokens; + } + + function getReservedTokensListValInPercentageUnit(address addr) constant returns (uint inPercentageUnit) { + return reservedTokensList[addr].inPercentageUnit; + } + + function getReservedTokensListValInPercentageDecimals(address addr) constant returns (uint inPercentageDecimals) { + return reservedTokensList[addr].inPercentageDecimals; + } + + function setReservedTokensListMultiple(address[] addrs, uint[] inTokens, uint[] inPercentageUnit, uint[] inPercentageDecimals) onlyOwner { + for (uint iterator = 0; iterator < addrs.length; iterator++) { + setReservedTokensList(addrs[iterator], inTokens[iterator], inPercentageUnit[iterator], inPercentageDecimals[iterator]); + } + } + + /** + * Create new tokens and allocate them to an address.. + * + * Only callably by a crowdsale contract (mint agent). + */ + function mint(address receiver, uint amount) onlyMintAgent canMint public { + totalSupply = totalSupply.plus(amount); + balances[receiver] = balances[receiver].plus(amount); + + // This will make the mint transaction apper in EtherScan.io + // We can remove this after there is a standardized minting event + Transfer(0, receiver, amount); + } + + /** + * Owner can allow a crowdsale contract to mint new tokens. + */ + function setMintAgent(address addr, bool state) onlyOwner canMint public { + mintAgents[addr] = state; + MintingAgentChanged(addr, state); + } + + modifier onlyMintAgent() { + // Only crowdsale contracts are allowed to mint new tokens + if(!mintAgents[msg.sender]) { + throw; + } + _; + } + + /** Make sure we are not done yet. */ + modifier canMint() { + if(mintingFinished) throw; + _; + } +} + + + +/** + * A crowdsaled token. + * + * An ERC-20 token designed specifically for crowdsales with investor protection and further development path. + * + * - The token transfer() is disabled until the crowdsale is over + * - The token contract gives an opt-in upgrade path to a new contract + * - The same token can be part of several crowdsales through approve() mechanism + * - The token can be capped (supply set in the constructor) or uncapped (crowdsale contract can mint new tokens) + * + */ +contract CrowdsaleTokenExt is ReleasableToken, MintableTokenExt, UpgradeableToken { + + /** Name and symbol were updated. */ + event UpdatedTokenInformation(string newName, string newSymbol); + + string public name; + + string public symbol; + + uint public decimals; + + /* Minimum ammount of tokens every buyer can buy. */ + uint public minCap; + + /** + * Construct the token. + * + * This token must be created through a team multisig wallet, so that it is owned by that wallet. + * + * @param _name Token name + * @param _symbol Token symbol - should be all caps + * @param _initialSupply How many tokens we start with + * @param _decimals Number of decimal places + * @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends. + */ + function CrowdsaleTokenExt(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable, uint _globalMinCap) + UpgradeableToken(msg.sender) { + + // Create any address, can be transferred + // to team multisig via changeOwner(), + // also remember to call setUpgradeMaster() + owner = msg.sender; + + name = _name; + symbol = _symbol; + + totalSupply = _initialSupply; + + decimals = _decimals; + + minCap = _globalMinCap; + + // Create initially all balance on the team multisig + balances[owner] = totalSupply; + + if(totalSupply > 0) { + Minted(owner, totalSupply); + } + + // No more new supply allowed after the token creation + if(!_mintable) { + mintingFinished = true; + if(totalSupply == 0) { + throw; // Cannot create a token without supply and no minting + } + } + } + + /** + * When token is released to be transferable, enforce no new tokens can be created. + */ + function releaseTokenTransfer() public onlyReleaseAgent { + mintingFinished = true; + super.releaseTokenTransfer(); + } + + /** + * Allow upgrade agent functionality kick in only if the crowdsale was success. + */ + function canUpgrade() public constant returns(bool) { + return released && super.canUpgrade(); + } + + /** + * Owner can update token information here. + * + * It is often useful to conceal the actual token association, until + * the token operations, like central issuance or reissuance have been completed. + * + * This function allows the token owner to rename the token after the operations + * have been completed and then point the audience to use the token contract. + */ + function setTokenInformation(string _name, string _symbol) onlyOwner { + name = _name; + symbol = _symbol; + + UpdatedTokenInformation(name, symbol); + } + +} diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/004_CrowdsaleTokenExt.txt b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/004_CrowdsaleTokenExt.txt new file mode 100755 index 0000000..ba5b96b --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/004_CrowdsaleTokenExt.txt @@ -0,0 +1,35 @@ +Token name: Block Array + +Token ticker: ARY + +Token decimals: 18 + +Multisig wallet address: 0x0239033Ef9384313a6eC6506Ae5B4A0af5c66A31 + +***************************** + +Crowdsale rate: 4731 + +Crowdsale start time: 2017-12-23T17:55 (GMT - 5) + +Crowdsale end time: 2018-01-14T18:00 (GMT - 5) + +Compiler Version: 0.4.11 + +Is optimization enabled?: true + +***************************** + +Token contract name: CrowdsaleTokenExt + +Token contract address: 0xa5F8fC0921880Cb7342368BD128eb8050442B1a1 + +***************************** + +****Token contract ABI:**** + +[{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"inTokens","type":"uint256"},{"name":"inPercentageUnit","type":"uint256"},{"name":"inPercentageDecimals","type":"uint256"}],"name":"setReservedTokensList","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setTransferAgent","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getReservedTokensListValInPercentageDecimals","outputs":[{"name":"inPercentageDecimals","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setReleaseAgent","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getReservedTokensListValInTokens","outputs":[{"name":"inTokens","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"minCap","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"receiver","type":"address"},{"name":"amount","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"mintAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setMintAgent","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"upgrade","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"}],"name":"setTokenInformation","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"reservedTokensList","outputs":[{"name":"inTokens","type":"uint256"},{"name":"inPercentageUnit","type":"uint256"},{"name":"inPercentageDecimals","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"upgradeAgent","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"releaseTokenTransfer","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"upgradeMaster","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"reservedTokensDestinations","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getUpgradeState","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"transferAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"released","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"canUpgrade","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getReservedTokensListValInPercentageUnit","outputs":[{"name":"inPercentageUnit","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"reservedTokensDestinationsLen","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalUpgraded","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"releaseAgent","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"agent","type":"address"}],"name":"setUpgradeAgent","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isToken","outputs":[{"name":"weAre","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addrs","type":"address[]"},{"name":"inTokens","type":"uint256[]"},{"name":"inPercentageUnit","type":"uint256[]"},{"name":"inPercentageDecimals","type":"uint256[]"}],"name":"setReservedTokensListMultiple","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"master","type":"address"}],"name":"setUpgradeMaster","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_initialSupply","type":"uint256"},{"name":"_decimals","type":"uint256"},{"name":"_mintable","type":"bool"},{"name":"_globalMinCap","type":"uint256"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newName","type":"string"},{"indexed":false,"name":"newSymbol","type":"string"}],"name":"UpdatedTokenInformation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Upgrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"agent","type":"address"}],"name":"UpgradeAgentSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"state","type":"bool"}],"name":"MintingAgentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"receiver","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}] + +****Token contract ABI encoded constructor arguments:**** + +00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b426c6f636b20417272617900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034152590000000000000000000000000000000000000000000000000000000000 \ No newline at end of file diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/005_FlatPricingExt.sol b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/005_FlatPricingExt.sol new file mode 100755 index 0000000..209c7bc --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/005_FlatPricingExt.sol @@ -0,0 +1,1026 @@ +// Created using ICO Wizard https://github.com/oraclesorg/ico-wizard by Oracles Network +pragma solidity ^0.4.11; + + +/** + * @title ERC20Basic + * @dev Simpler version of ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/179 + */ +contract ERC20Basic { + uint256 public totalSupply; + function balanceOf(address who) public constant returns (uint256); + function transfer(address to, uint256 value) public returns (bool); + event Transfer(address indexed from, address indexed to, uint256 value); +} + + + +/** + * @title Ownable + * @dev The Ownable contract has an owner address, and provides basic authorization control + * functions, this simplifies the implementation of "user permissions". + */ +contract Ownable { + address public owner; + + + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + + + /** + * @dev The Ownable constructor sets the original `owner` of the contract to the sender + * account. + */ + function Ownable() { + owner = msg.sender; + } + + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + require(msg.sender == owner); + _; + } + + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) onlyOwner public { + require(newOwner != address(0)); + OwnershipTransferred(owner, newOwner); + owner = newOwner; + } + +} +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + +/* + * Haltable + * + * Abstract contract that allows children to implement an + * emergency stop mechanism. Differs from Pausable by causing a throw when in halt mode. + * + * + * Originally envisioned in FirstBlood ICO contract. + */ +contract Haltable is Ownable { + bool public halted; + + modifier stopInEmergency { + if (halted) throw; + _; + } + + modifier stopNonOwnersInEmergency { + if (halted && msg.sender != owner) throw; + _; + } + + modifier onlyInEmergency { + if (!halted) throw; + _; + } + + // called by the owner on emergency, triggers stopped state + function halt() external onlyOwner { + halted = true; + } + + // called by the owner on end of emergency, returns to normal state + function unhalt() external onlyOwner onlyInEmergency { + halted = false; + } + +} + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Finalize agent defines what happens at the end of succeseful crowdsale. + * + * - Allocate tokens for founders, bounties and community + * - Make tokens transferable + * - etc. + */ +contract FinalizeAgent { + + function isFinalizeAgent() public constant returns(bool) { + return true; + } + + /** Return true if we can run finalizeCrowdsale() properly. + * + * This is a safety check function that doesn't allow crowdsale to begin + * unless the finalizer has been set up properly. + */ + function isSane() public constant returns (bool); + + /** Called once by crowdsale finalize() if the sale was success. */ + function finalizeCrowdsale(); + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + + + +/** + * @title ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/20 + */ +contract ERC20 is ERC20Basic { + function allowance(address owner, address spender) public constant returns (uint256); + function transferFrom(address from, address to, uint256 value) public returns (bool); + function approve(address spender, uint256 value) public returns (bool); + event Approval(address indexed owner, address indexed spender, uint256 value); +} + + +/** + * A token that defines fractional units as decimals. + */ +contract FractionalERC20Ext is ERC20 { + + uint public decimals; + uint public minCap; + +} + + + +/** + * Abstract base contract for token sales. + * + * Handle + * - start and end dates + * - accepting investments + * - minimum funding goal and refund + * - various statistics during the crowdfund + * - different pricing strategies + * - different investment policies (require server side customer id, allow only whitelisted addresses) + * + */ +contract CrowdsaleExt is Haltable { + + /* Max investment count when we are still allowed to change the multisig address */ + uint public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5; + + using SafeMathLibExt for uint; + + /* The token we are selling */ + FractionalERC20Ext public token; + + /* How we are going to price our offering */ + PricingStrategy public pricingStrategy; + + /* Post-success callback */ + FinalizeAgent public finalizeAgent; + + /* tokens will be transfered from this address */ + address public multisigWallet; + + /* if the funding goal is not reached, investors may withdraw their funds */ + uint public minimumFundingGoal; + + /* the UNIX timestamp start date of the crowdsale */ + uint public startsAt; + + /* the UNIX timestamp end date of the crowdsale */ + uint public endsAt; + + /* the number of tokens already sold through this contract*/ + uint public tokensSold = 0; + + /* How many wei of funding we have raised */ + uint public weiRaised = 0; + + /* Calculate incoming funds from presale contracts and addresses */ + uint public presaleWeiRaised = 0; + + /* How many distinct addresses have invested */ + uint public investorCount = 0; + + /* How much wei we have returned back to the contract after a failed crowdfund. */ + uint public loadedRefund = 0; + + /* How much wei we have given back to investors.*/ + uint public weiRefunded = 0; + + /* Has this crowdsale been finalized */ + bool public finalized; + + /* Do we need to have unique contributor id for each customer */ + bool public requireCustomerId; + + bool public isWhiteListed; + + address[] public joinedCrowdsales; + uint public joinedCrowdsalesLen = 0; + + address public lastCrowdsale; + + /** + * Do we verify that contributor has been cleared on the server side (accredited investors only). + * This method was first used in FirstBlood crowdsale to ensure all contributors have accepted terms on sale (on the web). + */ + bool public requiredSignedAddress; + + /* Server side address that signed allowed contributors (Ethereum addresses) that can participate the crowdsale */ + address public signerAddress; + + /** How much ETH each address has invested to this crowdsale */ + mapping (address => uint256) public investedAmountOf; + + /** How much tokens this crowdsale has credited for each investor address */ + mapping (address => uint256) public tokenAmountOf; + + struct WhiteListData { + bool status; + uint minCap; + uint maxCap; + } + + //is crowdsale updatable + bool public isUpdatable; + + /** Addresses that are allowed to invest even before ICO offical opens. For testing, for ICO partners, etc. */ + mapping (address => WhiteListData) public earlyParticipantWhitelist; + + /** This is for manul testing for the interaction from owner wallet. You can set it to any value and inspect this in blockchain explorer to see that crowdsale interaction works. */ + uint public ownerTestValue; + + /** State machine + * + * - Preparing: All contract initialization calls and variables have not been set yet + * - Prefunding: We have not passed start time yet + * - Funding: Active crowdsale + * - Success: Minimum funding goal reached + * - Failure: Minimum funding goal not reached before ending time + * - Finalized: The finalized has been called and succesfully executed + * - Refunding: Refunds are loaded on the contract for reclaim. + */ + enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding} + + // A new investment was made + event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId); + + // Refund was processed for a contributor + event Refund(address investor, uint weiAmount); + + // The rules were changed what kind of investments we accept + event InvestmentPolicyChanged(bool newRequireCustomerId, bool newRequiredSignedAddress, address newSignerAddress); + + // Address early participation whitelist status changed + event Whitelisted(address addr, bool status); + + // Crowdsale start time has been changed + event StartsAtChanged(uint newStartsAt); + + // Crowdsale end time has been changed + event EndsAtChanged(uint newEndsAt); + + function CrowdsaleExt(address _token, PricingStrategy _pricingStrategy, address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal, bool _isUpdatable, bool _isWhiteListed) { + + owner = msg.sender; + + token = FractionalERC20Ext(_token); + + setPricingStrategy(_pricingStrategy); + + multisigWallet = _multisigWallet; + if(multisigWallet == 0) { + throw; + } + + if(_start == 0) { + throw; + } + + startsAt = _start; + + if(_end == 0) { + throw; + } + + endsAt = _end; + + // Don't mess the dates + if(startsAt >= endsAt) { + throw; + } + + // Minimum funding goal can be zero + minimumFundingGoal = _minimumFundingGoal; + + isUpdatable = _isUpdatable; + + isWhiteListed = _isWhiteListed; + } + + /** + * Don't expect to just send in money and get tokens. + */ + function() payable { + throw; + } + + /** + * Make an investment. + * + * Crowdsale must be running for one to invest. + * We must have not pressed the emergency brake. + * + * @param receiver The Ethereum address who receives the tokens + * @param customerId (optional) UUID v4 to track the successful payments on the server side + * + */ + function investInternal(address receiver, uint128 customerId) stopInEmergency private { + + // Determine if it's a good time to accept investment from this participant + if(getState() == State.PreFunding) { + // Are we whitelisted for early deposit + throw; + } else if(getState() == State.Funding) { + // Retail participants can only come in when the crowdsale is running + // pass + if(isWhiteListed) { + if(!earlyParticipantWhitelist[receiver].status) { + throw; + } + } + } else { + // Unwanted state + throw; + } + + uint weiAmount = msg.value; + + // Account presale sales separately, so that they do not count against pricing tranches + uint tokenAmount = pricingStrategy.calculatePrice(weiAmount, weiRaised - presaleWeiRaised, tokensSold, msg.sender, token.decimals()); + + if(tokenAmount == 0) { + // Dust transaction + throw; + } + + if(isWhiteListed) { + if(tokenAmount < earlyParticipantWhitelist[receiver].minCap && tokenAmountOf[receiver] == 0) { + // tokenAmount < minCap for investor + throw; + } + if(tokenAmount > earlyParticipantWhitelist[receiver].maxCap) { + // tokenAmount > maxCap for investor + throw; + } + + // Check that we did not bust the investor's cap + if (isBreakingInvestorCap(receiver, tokenAmount)) { + throw; + } + } else { + if(tokenAmount < token.minCap() && tokenAmountOf[receiver] == 0) { + throw; + } + } + + if(investedAmountOf[receiver] == 0) { + // A new investor + investorCount++; + } + + // Update investor + investedAmountOf[receiver] = investedAmountOf[receiver].plus(weiAmount); + tokenAmountOf[receiver] = tokenAmountOf[receiver].plus(tokenAmount); + + // Update totals + weiRaised = weiRaised.plus(weiAmount); + tokensSold = tokensSold.plus(tokenAmount); + + if(pricingStrategy.isPresalePurchase(receiver)) { + presaleWeiRaised = presaleWeiRaised.plus(weiAmount); + } + + // Check that we did not bust the cap + if(isBreakingCap(weiAmount, tokenAmount, weiRaised, tokensSold)) { + throw; + } + + assignTokens(receiver, tokenAmount); + + // Pocket the money + if(!multisigWallet.send(weiAmount)) throw; + + if (isWhiteListed) { + uint num = 0; + for (var i = 0; i < joinedCrowdsalesLen; i++) { + if (this == joinedCrowdsales[i]) + num = i; + } + + if (num + 1 < joinedCrowdsalesLen) { + for (var j = num + 1; j < joinedCrowdsalesLen; j++) { + CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]); + crowdsale.updateEarlyParicipantWhitelist(msg.sender, this, tokenAmount); + } + } + } + + // Tell us invest was success + Invested(receiver, weiAmount, tokenAmount, customerId); + } + + /** + * Preallocate tokens for the early investors. + * + * Preallocated tokens have been sold before the actual crowdsale opens. + * This function mints the tokens and moves the crowdsale needle. + * + * Investor count is not handled; it is assumed this goes for multiple investors + * and the token distribution happens outside the smart contract flow. + * + * No money is exchanged, as the crowdsale team already have received the payment. + * + * @param fullTokens tokens as full tokens - decimal places added internally + * @param weiPrice Price of a single full token in wei + * + */ + function preallocate(address receiver, uint fullTokens, uint weiPrice) public onlyOwner { + + uint tokenAmount = fullTokens * 10**token.decimals(); + uint weiAmount = weiPrice * fullTokens; // This can be also 0, we give out tokens for free + + weiRaised = weiRaised.plus(weiAmount); + tokensSold = tokensSold.plus(tokenAmount); + + investedAmountOf[receiver] = investedAmountOf[receiver].plus(weiAmount); + tokenAmountOf[receiver] = tokenAmountOf[receiver].plus(tokenAmount); + + assignTokens(receiver, tokenAmount); + + // Tell us invest was success + Invested(receiver, weiAmount, tokenAmount, 0); + } + + /** + * Allow anonymous contributions to this crowdsale. + */ + function investWithSignedAddress(address addr, uint128 customerId, uint8 v, bytes32 r, bytes32 s) public payable { + bytes32 hash = sha256(addr); + if (ecrecover(hash, v, r, s) != signerAddress) throw; + if(customerId == 0) throw; // UUIDv4 sanity check + investInternal(addr, customerId); + } + + /** + * Track who is the customer making the payment so we can send thank you email. + */ + function investWithCustomerId(address addr, uint128 customerId) public payable { + if(requiredSignedAddress) throw; // Crowdsale allows only server-side signed participants + if(customerId == 0) throw; // UUIDv4 sanity check + investInternal(addr, customerId); + } + + /** + * Allow anonymous contributions to this crowdsale. + */ + function invest(address addr) public payable { + if(requireCustomerId) throw; // Crowdsale needs to track participants for thank you email + if(requiredSignedAddress) throw; // Crowdsale allows only server-side signed participants + investInternal(addr, 0); + } + + /** + * Invest to tokens, recognize the payer and clear his address. + * + */ + function buyWithSignedAddress(uint128 customerId, uint8 v, bytes32 r, bytes32 s) public payable { + investWithSignedAddress(msg.sender, customerId, v, r, s); + } + + /** + * Invest to tokens, recognize the payer. + * + */ + function buyWithCustomerId(uint128 customerId) public payable { + investWithCustomerId(msg.sender, customerId); + } + + /** + * The basic entry point to participate the crowdsale process. + * + * Pay for funding, get invested tokens back in the sender address. + */ + function buy() public payable { + invest(msg.sender); + } + + /** + * Finalize a succcesful crowdsale. + * + * The owner can triggre a call the contract that provides post-crowdsale actions, like releasing the tokens. + */ + function finalize() public inState(State.Success) onlyOwner stopInEmergency { + + // Already finalized + if(finalized) { + throw; + } + + // Finalizing is optional. We only call it if we are given a finalizing agent. + if(address(finalizeAgent) != 0) { + finalizeAgent.finalizeCrowdsale(); + } + + finalized = true; + } + + /** + * Allow to (re)set finalize agent. + * + * Design choice: no state restrictions on setting this, so that we can fix fat finger mistakes. + */ + function setFinalizeAgent(FinalizeAgent addr) onlyOwner { + finalizeAgent = addr; + + // Don't allow setting bad agent + if(!finalizeAgent.isFinalizeAgent()) { + throw; + } + } + + /** + * Set policy do we need to have server-side customer ids for the investments. + * + */ + function setRequireCustomerId(bool value) onlyOwner { + requireCustomerId = value; + InvestmentPolicyChanged(requireCustomerId, requiredSignedAddress, signerAddress); + } + + /** + * Set policy if all investors must be cleared on the server side first. + * + * This is e.g. for the accredited investor clearing. + * + */ + function setRequireSignedAddress(bool value, address _signerAddress) onlyOwner { + requiredSignedAddress = value; + signerAddress = _signerAddress; + InvestmentPolicyChanged(requireCustomerId, requiredSignedAddress, signerAddress); + } + + /** + * Allow addresses to do early participation. + * + * TODO: Fix spelling error in the name + */ + function setEarlyParicipantWhitelist(address addr, bool status, uint minCap, uint maxCap) onlyOwner { + if (!isWhiteListed) throw; + earlyParticipantWhitelist[addr] = WhiteListData({status:status, minCap:minCap, maxCap:maxCap}); + Whitelisted(addr, status); + } + + function setEarlyParicipantsWhitelist(address[] addrs, bool[] statuses, uint[] minCaps, uint[] maxCaps) onlyOwner { + if (!isWhiteListed) throw; + for (uint iterator = 0; iterator < addrs.length; iterator++) { + setEarlyParicipantWhitelist(addrs[iterator], statuses[iterator], minCaps[iterator], maxCaps[iterator]); + } + } + + function updateEarlyParicipantWhitelist(address addr, address contractAddr, uint tokensBought) { + if (tokensBought < earlyParticipantWhitelist[addr].minCap) throw; + if (!isWhiteListed) throw; + if (addr != msg.sender && contractAddr != msg.sender) throw; + uint newMaxCap = earlyParticipantWhitelist[addr].maxCap; + newMaxCap = newMaxCap.minus(tokensBought); + earlyParticipantWhitelist[addr] = WhiteListData({status:earlyParticipantWhitelist[addr].status, minCap:0, maxCap:newMaxCap}); + } + + function updateJoinedCrowdsales(address addr) onlyOwner { + joinedCrowdsales[joinedCrowdsalesLen++] = addr; + } + + function setLastCrowdsale(address addr) onlyOwner { + lastCrowdsale = addr; + } + + function clearJoinedCrowdsales() onlyOwner { + joinedCrowdsalesLen = 0; + } + + function updateJoinedCrowdsalesMultiple(address[] addrs) onlyOwner { + clearJoinedCrowdsales(); + for (uint iter = 0; iter < addrs.length; iter++) { + if(joinedCrowdsalesLen == joinedCrowdsales.length) { + joinedCrowdsales.length += 1; + } + joinedCrowdsales[joinedCrowdsalesLen++] = addrs[iter]; + if (iter == addrs.length - 1) + setLastCrowdsale(addrs[iter]); + } + } + + function setStartsAt(uint time) onlyOwner { + if (finalized) throw; + + if (!isUpdatable) throw; + + if(now > time) { + throw; // Don't change past + } + + if(time > endsAt) { + throw; + } + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + startsAt = time; + StartsAtChanged(startsAt); + } + + /** + * Allow crowdsale owner to close early or extend the crowdsale. + * + * This is useful e.g. for a manual soft cap implementation: + * - after X amount is reached determine manual closing + * + * This may put the crowdsale to an invalid state, + * but we trust owners know what they are doing. + * + */ + function setEndsAt(uint time) onlyOwner { + if (finalized) throw; + + if (!isUpdatable) throw; + + if(now > time) { + throw; // Don't change past + } + + if(startsAt > time) { + throw; + } + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + uint num = 0; + for (var i = 0; i < joinedCrowdsalesLen; i++) { + if (this == joinedCrowdsales[i]) + num = i; + } + + if (num + 1 < joinedCrowdsalesLen) { + for (var j = num + 1; j < joinedCrowdsalesLen; j++) { + CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]); + if (time > crowdsale.startsAt()) throw; + } + } + + endsAt = time; + EndsAtChanged(endsAt); + } + + /** + * Allow to (re)set pricing strategy. + * + * Design choice: no state restrictions on the set, so that we can fix fat finger mistakes. + */ + function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner { + pricingStrategy = _pricingStrategy; + + // Don't allow setting bad agent + if(!pricingStrategy.isPricingStrategy()) { + throw; + } + } + + /** + * Allow to change the team multisig address in the case of emergency. + * + * This allows to save a deployed crowdsale wallet in the case the crowdsale has not yet begun + * (we have done only few test transactions). After the crowdsale is going + * then multisig address stays locked for the safety reasons. + */ + function setMultisig(address addr) public onlyOwner { + + // Change + if(investorCount > MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE) { + throw; + } + + multisigWallet = addr; + } + + /** + * Allow load refunds back on the contract for the refunding. + * + * The team can transfer the funds back on the smart contract in the case the minimum goal was not reached.. + */ + function loadRefund() public payable inState(State.Failure) { + if(msg.value == 0) throw; + loadedRefund = loadedRefund.plus(msg.value); + } + + /** + * Investors can claim refund. + * + * Note that any refunds from proxy buyers should be handled separately, + * and not through this contract. + */ + function refund() public inState(State.Refunding) { + uint256 weiValue = investedAmountOf[msg.sender]; + if (weiValue == 0) throw; + investedAmountOf[msg.sender] = 0; + weiRefunded = weiRefunded.plus(weiValue); + Refund(msg.sender, weiValue); + if (!msg.sender.send(weiValue)) throw; + } + + /** + * @return true if the crowdsale has raised enough money to be a successful. + */ + function isMinimumGoalReached() public constant returns (bool reached) { + return weiRaised >= minimumFundingGoal; + } + + /** + * Check if the contract relationship looks good. + */ + function isFinalizerSane() public constant returns (bool sane) { + return finalizeAgent.isSane(); + } + + /** + * Check if the contract relationship looks good. + */ + function isPricingSane() public constant returns (bool sane) { + return pricingStrategy.isSane(address(this)); + } + + /** + * Crowdfund state machine management. + * + * We make it a function and do not assign the result to a variable, so there is no chance of the variable being stale. + */ + function getState() public constant returns (State) { + if(finalized) return State.Finalized; + else if (address(finalizeAgent) == 0) return State.Preparing; + else if (!finalizeAgent.isSane()) return State.Preparing; + else if (!pricingStrategy.isSane(address(this))) return State.Preparing; + else if (block.timestamp < startsAt) return State.PreFunding; + else if (block.timestamp <= endsAt && !isCrowdsaleFull()) return State.Funding; + else if (isMinimumGoalReached()) return State.Success; + else if (!isMinimumGoalReached() && weiRaised > 0 && loadedRefund >= weiRaised) return State.Refunding; + else return State.Failure; + } + + /** This is for manual testing of multisig wallet interaction */ + function setOwnerTestValue(uint val) onlyOwner { + ownerTestValue = val; + } + + /** Interface marker. */ + function isCrowdsale() public constant returns (bool) { + return true; + } + + // + // Modifiers + // + + /** Modified allowing execution only if the crowdsale is currently running. */ + modifier inState(State state) { + if(getState() != state) throw; + _; + } + + + // + // Abstract functions + // + + /** + * Check if the current invested breaks our cap rules. + * + * + * The child contract must define their own cap setting rules. + * We allow a lot of flexibility through different capping strategies (ETH, token count) + * Called from invest(). + * + * @param weiAmount The amount of wei the investor tries to invest in the current transaction + * @param tokenAmount The amount of tokens we try to give to the investor in the current transaction + * @param weiRaisedTotal What would be our total raised balance after this transaction + * @param tokensSoldTotal What would be our total sold tokens count after this transaction + * + * @return true if taking this investment would break our cap rules + */ + function isBreakingCap(uint weiAmount, uint tokenAmount, uint weiRaisedTotal, uint tokensSoldTotal) constant returns (bool limitBroken); + + function isBreakingInvestorCap(address receiver, uint tokenAmount) constant returns (bool limitBroken); + + /** + * Check if the current crowdsale is full and we can no longer sell any tokens. + */ + function isCrowdsaleFull() public constant returns (bool); + + /** + * Create new tokens or transfer issued tokens to the investor depending on the cap model. + */ + function assignTokens(address receiver, uint tokenAmount) private; +} + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Interface for defining crowdsale pricing. + */ +contract PricingStrategy { + + /** Interface declaration. */ + function isPricingStrategy() public constant returns (bool) { + return true; + } + + /** Self check if all references are correctly set. + * + * Checks that pricing strategy matches crowdsale parameters. + */ + function isSane(address crowdsale) public constant returns (bool) { + return true; + } + + /** + * @dev Pricing tells if this is a presale purchase or not. + @param purchaser Address of the purchaser + @return False by default, true if a presale purchaser + */ + function isPresalePurchase(address purchaser) public constant returns (bool) { + return false; + } + + /** + * When somebody tries to buy tokens for X eth, calculate how many tokens they get. + * + * + * @param value - What is the value of the transaction send in as wei + * @param tokensSold - how much tokens have been sold this far + * @param weiRaised - how much money has been raised this far in the main token sale - this number excludes presale + * @param msgSender - who is the investor of this transaction + * @param decimals - how many decimal units the token has + * @return Amount of tokens the investor receives + */ + function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint tokenAmount); +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Safe unsigned safe math. + * + * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli + * + * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol + * + * Maintained here until merged to mainline zeppelin-solidity. + * + */ +library SafeMathLibExt { + + function times(uint a, uint b) returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function divides(uint a, uint b) returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function minus(uint a, uint b) returns (uint) { + assert(b <= a); + return a - b; + } + + function plus(uint a, uint b) returns (uint) { + uint c = a + b; + assert(c>=a); + return c; + } + +} + + +/** + * Fixed crowdsale pricing - everybody gets the same price. + */ +contract FlatPricingExt is PricingStrategy, Ownable { + + using SafeMathLibExt for uint; + + /* How many weis one token costs */ + uint public oneTokenInWei; + + bool public isUpdatable; + + address public lastCrowdsale; + + // Crowdsale rate has been changed + event RateChanged(uint newOneTokenInWei); + + function FlatPricingExt(uint _oneTokenInWei, bool _isUpdatable) onlyOwner { + require(_oneTokenInWei > 0); + oneTokenInWei = _oneTokenInWei; + + isUpdatable = _isUpdatable; + } + + function setLastCrowdsale(address addr) onlyOwner { + lastCrowdsale = addr; + } + + function updateRate(uint newOneTokenInWei) onlyOwner { + if (!isUpdatable) throw; + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + oneTokenInWei = newOneTokenInWei; + RateChanged(newOneTokenInWei); + } + + /** + * Calculate the current price for buy in amount. + * + */ + function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint) { + uint multiplier = 10 ** decimals; + return value.times(multiplier) / oneTokenInWei; + } + +} diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/006_FlatPricingExt.txt b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/006_FlatPricingExt.txt new file mode 100755 index 0000000..ff7e607 --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/006_FlatPricingExt.txt @@ -0,0 +1,35 @@ +Token name: Block Array + +Token ticker: ARY + +Token decimals: 18 + +Multisig wallet address: 0x0239033Ef9384313a6eC6506Ae5B4A0af5c66A31 + +***************************** + +Crowdsale rate: 4731 + +Crowdsale start time: 2017-12-23T17:55 (GMT - 5) + +Crowdsale end time: 2018-01-14T18:00 (GMT - 5) + +Compiler Version: 0.4.11 + +Is optimization enabled?: true + +***************************** + +Pricing strategy contract name: FlatPricingExt + +Pricing strategy contract address for Token Generation Event: 0x6692D5dD701b9373933730d4e4f3b498DB7F7C32 + +***************************** + +****Pricing strategy contract ABI:**** + +[{"constant":true,"inputs":[],"name":"isPricingStrategy","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isUpdatable","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"value","type":"uint256"},{"name":"weiRaised","type":"uint256"},{"name":"tokensSold","type":"uint256"},{"name":"msgSender","type":"address"},{"name":"decimals","type":"uint256"}],"name":"calculatePrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"lastCrowdsale","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setLastCrowdsale","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOneTokenInWei","type":"uint256"}],"name":"updateRate","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"oneTokenInWei","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"crowdsale","type":"address"}],"name":"isSane","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"purchaser","type":"address"}],"name":"isPresalePurchase","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_oneTokenInWei","type":"uint256"},{"name":"_isUpdatable","type":"bool"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOneTokenInWei","type":"uint256"}],"name":"RateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}] + +****Pricing strategy contract ABI encoded constructor arguments for Token Generation Event:**** + +0000000000000000000000000000000000000000000000000000c03dd53bc2870000000000000000000000000000000000000000000000000000000000000001 \ No newline at end of file diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/007_MintedTokenCappedCrowdsaleExt.sol b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/007_MintedTokenCappedCrowdsaleExt.sol new file mode 100755 index 0000000..c40c5ca --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/007_MintedTokenCappedCrowdsaleExt.sol @@ -0,0 +1,1262 @@ +// Created using ICO Wizard https://github.com/oraclesorg/ico-wizard by Oracles Network +// Temporarily have SafeMath here until all contracts have been migrated to SafeMathLib version from OpenZeppelin + +pragma solidity ^0.4.8; + + +/** + * Math operations with safety checks + */ +contract SafeMath { + function safeMul(uint a, uint b) internal returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function safeDiv(uint a, uint b) internal returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function safeSub(uint a, uint b) internal returns (uint) { + assert(b <= a); + return a - b; + } + + function safeAdd(uint a, uint b) internal returns (uint) { + uint c = a + b; + assert(c>=a && c>=b); + return c; + } + + function max64(uint64 a, uint64 b) internal constant returns (uint64) { + return a >= b ? a : b; + } + + function min64(uint64 a, uint64 b) internal constant returns (uint64) { + return a < b ? a : b; + } + + function max256(uint256 a, uint256 b) internal constant returns (uint256) { + return a >= b ? a : b; + } + + function min256(uint256 a, uint256 b) internal constant returns (uint256) { + return a < b ? a : b; + } + +} + + + +/** + * @title ERC20Basic + * @dev Simpler version of ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/179 + */ +contract ERC20Basic { + uint256 public totalSupply; + function balanceOf(address who) public constant returns (uint256); + function transfer(address to, uint256 value) public returns (bool); + event Transfer(address indexed from, address indexed to, uint256 value); +} + + + +/** + * @title Ownable + * @dev The Ownable contract has an owner address, and provides basic authorization control + * functions, this simplifies the implementation of "user permissions". + */ +contract Ownable { + address public owner; + + + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + + + /** + * @dev The Ownable constructor sets the original `owner` of the contract to the sender + * account. + */ + function Ownable() { + owner = msg.sender; + } + + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + require(msg.sender == owner); + _; + } + + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) onlyOwner public { + require(newOwner != address(0)); + OwnershipTransferred(owner, newOwner); + owner = newOwner; + } + +} +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Safe unsigned safe math. + * + * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli + * + * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol + * + * Maintained here until merged to mainline zeppelin-solidity. + * + */ +library SafeMathLibExt { + + function times(uint a, uint b) returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function divides(uint a, uint b) returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function minus(uint a, uint b) returns (uint) { + assert(b <= a); + return a - b; + } + + function plus(uint a, uint b) returns (uint) { + uint c = a + b; + assert(c>=a); + return c; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + +/* + * Haltable + * + * Abstract contract that allows children to implement an + * emergency stop mechanism. Differs from Pausable by causing a throw when in halt mode. + * + * + * Originally envisioned in FirstBlood ICO contract. + */ +contract Haltable is Ownable { + bool public halted; + + modifier stopInEmergency { + if (halted) throw; + _; + } + + modifier stopNonOwnersInEmergency { + if (halted && msg.sender != owner) throw; + _; + } + + modifier onlyInEmergency { + if (!halted) throw; + _; + } + + // called by the owner on emergency, triggers stopped state + function halt() external onlyOwner { + halted = true; + } + + // called by the owner on end of emergency, returns to normal state + function unhalt() external onlyOwner onlyInEmergency { + halted = false; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Interface for defining crowdsale pricing. + */ +contract PricingStrategy { + + /** Interface declaration. */ + function isPricingStrategy() public constant returns (bool) { + return true; + } + + /** Self check if all references are correctly set. + * + * Checks that pricing strategy matches crowdsale parameters. + */ + function isSane(address crowdsale) public constant returns (bool) { + return true; + } + + /** + * @dev Pricing tells if this is a presale purchase or not. + @param purchaser Address of the purchaser + @return False by default, true if a presale purchaser + */ + function isPresalePurchase(address purchaser) public constant returns (bool) { + return false; + } + + /** + * When somebody tries to buy tokens for X eth, calculate how many tokens they get. + * + * + * @param value - What is the value of the transaction send in as wei + * @param tokensSold - how much tokens have been sold this far + * @param weiRaised - how much money has been raised this far in the main token sale - this number excludes presale + * @param msgSender - who is the investor of this transaction + * @param decimals - how many decimal units the token has + * @return Amount of tokens the investor receives + */ + function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint tokenAmount); +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Finalize agent defines what happens at the end of succeseful crowdsale. + * + * - Allocate tokens for founders, bounties and community + * - Make tokens transferable + * - etc. + */ +contract FinalizeAgent { + + function isFinalizeAgent() public constant returns(bool) { + return true; + } + + /** Return true if we can run finalizeCrowdsale() properly. + * + * This is a safety check function that doesn't allow crowdsale to begin + * unless the finalizer has been set up properly. + */ + function isSane() public constant returns (bool); + + /** Called once by crowdsale finalize() if the sale was success. */ + function finalizeCrowdsale(); + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + + + +/** + * @title ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/20 + */ +contract ERC20 is ERC20Basic { + function allowance(address owner, address spender) public constant returns (uint256); + function transferFrom(address from, address to, uint256 value) public returns (bool); + function approve(address spender, uint256 value) public returns (bool); + event Approval(address indexed owner, address indexed spender, uint256 value); +} + + +/** + * A token that defines fractional units as decimals. + */ +contract FractionalERC20Ext is ERC20 { + + uint public decimals; + uint public minCap; + +} + + + +/** + * Abstract base contract for token sales. + * + * Handle + * - start and end dates + * - accepting investments + * - minimum funding goal and refund + * - various statistics during the crowdfund + * - different pricing strategies + * - different investment policies (require server side customer id, allow only whitelisted addresses) + * + */ +contract CrowdsaleExt is Haltable { + + /* Max investment count when we are still allowed to change the multisig address */ + uint public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5; + + using SafeMathLibExt for uint; + + /* The token we are selling */ + FractionalERC20Ext public token; + + /* How we are going to price our offering */ + PricingStrategy public pricingStrategy; + + /* Post-success callback */ + FinalizeAgent public finalizeAgent; + + /* tokens will be transfered from this address */ + address public multisigWallet; + + /* if the funding goal is not reached, investors may withdraw their funds */ + uint public minimumFundingGoal; + + /* the UNIX timestamp start date of the crowdsale */ + uint public startsAt; + + /* the UNIX timestamp end date of the crowdsale */ + uint public endsAt; + + /* the number of tokens already sold through this contract*/ + uint public tokensSold = 0; + + /* How many wei of funding we have raised */ + uint public weiRaised = 0; + + /* Calculate incoming funds from presale contracts and addresses */ + uint public presaleWeiRaised = 0; + + /* How many distinct addresses have invested */ + uint public investorCount = 0; + + /* How much wei we have returned back to the contract after a failed crowdfund. */ + uint public loadedRefund = 0; + + /* How much wei we have given back to investors.*/ + uint public weiRefunded = 0; + + /* Has this crowdsale been finalized */ + bool public finalized; + + /* Do we need to have unique contributor id for each customer */ + bool public requireCustomerId; + + bool public isWhiteListed; + + address[] public joinedCrowdsales; + uint public joinedCrowdsalesLen = 0; + + address public lastCrowdsale; + + /** + * Do we verify that contributor has been cleared on the server side (accredited investors only). + * This method was first used in FirstBlood crowdsale to ensure all contributors have accepted terms on sale (on the web). + */ + bool public requiredSignedAddress; + + /* Server side address that signed allowed contributors (Ethereum addresses) that can participate the crowdsale */ + address public signerAddress; + + /** How much ETH each address has invested to this crowdsale */ + mapping (address => uint256) public investedAmountOf; + + /** How much tokens this crowdsale has credited for each investor address */ + mapping (address => uint256) public tokenAmountOf; + + struct WhiteListData { + bool status; + uint minCap; + uint maxCap; + } + + //is crowdsale updatable + bool public isUpdatable; + + /** Addresses that are allowed to invest even before ICO offical opens. For testing, for ICO partners, etc. */ + mapping (address => WhiteListData) public earlyParticipantWhitelist; + + /** This is for manul testing for the interaction from owner wallet. You can set it to any value and inspect this in blockchain explorer to see that crowdsale interaction works. */ + uint public ownerTestValue; + + /** State machine + * + * - Preparing: All contract initialization calls and variables have not been set yet + * - Prefunding: We have not passed start time yet + * - Funding: Active crowdsale + * - Success: Minimum funding goal reached + * - Failure: Minimum funding goal not reached before ending time + * - Finalized: The finalized has been called and succesfully executed + * - Refunding: Refunds are loaded on the contract for reclaim. + */ + enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding} + + // A new investment was made + event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId); + + // Refund was processed for a contributor + event Refund(address investor, uint weiAmount); + + // The rules were changed what kind of investments we accept + event InvestmentPolicyChanged(bool newRequireCustomerId, bool newRequiredSignedAddress, address newSignerAddress); + + // Address early participation whitelist status changed + event Whitelisted(address addr, bool status); + + // Crowdsale start time has been changed + event StartsAtChanged(uint newStartsAt); + + // Crowdsale end time has been changed + event EndsAtChanged(uint newEndsAt); + + function CrowdsaleExt(address _token, PricingStrategy _pricingStrategy, address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal, bool _isUpdatable, bool _isWhiteListed) { + + owner = msg.sender; + + token = FractionalERC20Ext(_token); + + setPricingStrategy(_pricingStrategy); + + multisigWallet = _multisigWallet; + if(multisigWallet == 0) { + throw; + } + + if(_start == 0) { + throw; + } + + startsAt = _start; + + if(_end == 0) { + throw; + } + + endsAt = _end; + + // Don't mess the dates + if(startsAt >= endsAt) { + throw; + } + + // Minimum funding goal can be zero + minimumFundingGoal = _minimumFundingGoal; + + isUpdatable = _isUpdatable; + + isWhiteListed = _isWhiteListed; + } + + /** + * Don't expect to just send in money and get tokens. + */ + function() payable { + throw; + } + + /** + * Make an investment. + * + * Crowdsale must be running for one to invest. + * We must have not pressed the emergency brake. + * + * @param receiver The Ethereum address who receives the tokens + * @param customerId (optional) UUID v4 to track the successful payments on the server side + * + */ + function investInternal(address receiver, uint128 customerId) stopInEmergency private { + + // Determine if it's a good time to accept investment from this participant + if(getState() == State.PreFunding) { + // Are we whitelisted for early deposit + throw; + } else if(getState() == State.Funding) { + // Retail participants can only come in when the crowdsale is running + // pass + if(isWhiteListed) { + if(!earlyParticipantWhitelist[receiver].status) { + throw; + } + } + } else { + // Unwanted state + throw; + } + + uint weiAmount = msg.value; + + // Account presale sales separately, so that they do not count against pricing tranches + uint tokenAmount = pricingStrategy.calculatePrice(weiAmount, weiRaised - presaleWeiRaised, tokensSold, msg.sender, token.decimals()); + + if(tokenAmount == 0) { + // Dust transaction + throw; + } + + if(isWhiteListed) { + if(tokenAmount < earlyParticipantWhitelist[receiver].minCap && tokenAmountOf[receiver] == 0) { + // tokenAmount < minCap for investor + throw; + } + if(tokenAmount > earlyParticipantWhitelist[receiver].maxCap) { + // tokenAmount > maxCap for investor + throw; + } + + // Check that we did not bust the investor's cap + if (isBreakingInvestorCap(receiver, tokenAmount)) { + throw; + } + } else { + if(tokenAmount < token.minCap() && tokenAmountOf[receiver] == 0) { + throw; + } + } + + if(investedAmountOf[receiver] == 0) { + // A new investor + investorCount++; + } + + // Update investor + investedAmountOf[receiver] = investedAmountOf[receiver].plus(weiAmount); + tokenAmountOf[receiver] = tokenAmountOf[receiver].plus(tokenAmount); + + // Update totals + weiRaised = weiRaised.plus(weiAmount); + tokensSold = tokensSold.plus(tokenAmount); + + if(pricingStrategy.isPresalePurchase(receiver)) { + presaleWeiRaised = presaleWeiRaised.plus(weiAmount); + } + + // Check that we did not bust the cap + if(isBreakingCap(weiAmount, tokenAmount, weiRaised, tokensSold)) { + throw; + } + + assignTokens(receiver, tokenAmount); + + // Pocket the money + if(!multisigWallet.send(weiAmount)) throw; + + if (isWhiteListed) { + uint num = 0; + for (var i = 0; i < joinedCrowdsalesLen; i++) { + if (this == joinedCrowdsales[i]) + num = i; + } + + if (num + 1 < joinedCrowdsalesLen) { + for (var j = num + 1; j < joinedCrowdsalesLen; j++) { + CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]); + crowdsale.updateEarlyParicipantWhitelist(msg.sender, this, tokenAmount); + } + } + } + + // Tell us invest was success + Invested(receiver, weiAmount, tokenAmount, customerId); + } + + /** + * Preallocate tokens for the early investors. + * + * Preallocated tokens have been sold before the actual crowdsale opens. + * This function mints the tokens and moves the crowdsale needle. + * + * Investor count is not handled; it is assumed this goes for multiple investors + * and the token distribution happens outside the smart contract flow. + * + * No money is exchanged, as the crowdsale team already have received the payment. + * + * @param fullTokens tokens as full tokens - decimal places added internally + * @param weiPrice Price of a single full token in wei + * + */ + function preallocate(address receiver, uint fullTokens, uint weiPrice) public onlyOwner { + + uint tokenAmount = fullTokens * 10**token.decimals(); + uint weiAmount = weiPrice * fullTokens; // This can be also 0, we give out tokens for free + + weiRaised = weiRaised.plus(weiAmount); + tokensSold = tokensSold.plus(tokenAmount); + + investedAmountOf[receiver] = investedAmountOf[receiver].plus(weiAmount); + tokenAmountOf[receiver] = tokenAmountOf[receiver].plus(tokenAmount); + + assignTokens(receiver, tokenAmount); + + // Tell us invest was success + Invested(receiver, weiAmount, tokenAmount, 0); + } + + /** + * Allow anonymous contributions to this crowdsale. + */ + function investWithSignedAddress(address addr, uint128 customerId, uint8 v, bytes32 r, bytes32 s) public payable { + bytes32 hash = sha256(addr); + if (ecrecover(hash, v, r, s) != signerAddress) throw; + if(customerId == 0) throw; // UUIDv4 sanity check + investInternal(addr, customerId); + } + + /** + * Track who is the customer making the payment so we can send thank you email. + */ + function investWithCustomerId(address addr, uint128 customerId) public payable { + if(requiredSignedAddress) throw; // Crowdsale allows only server-side signed participants + if(customerId == 0) throw; // UUIDv4 sanity check + investInternal(addr, customerId); + } + + /** + * Allow anonymous contributions to this crowdsale. + */ + function invest(address addr) public payable { + if(requireCustomerId) throw; // Crowdsale needs to track participants for thank you email + if(requiredSignedAddress) throw; // Crowdsale allows only server-side signed participants + investInternal(addr, 0); + } + + /** + * Invest to tokens, recognize the payer and clear his address. + * + */ + function buyWithSignedAddress(uint128 customerId, uint8 v, bytes32 r, bytes32 s) public payable { + investWithSignedAddress(msg.sender, customerId, v, r, s); + } + + /** + * Invest to tokens, recognize the payer. + * + */ + function buyWithCustomerId(uint128 customerId) public payable { + investWithCustomerId(msg.sender, customerId); + } + + /** + * The basic entry point to participate the crowdsale process. + * + * Pay for funding, get invested tokens back in the sender address. + */ + function buy() public payable { + invest(msg.sender); + } + + /** + * Finalize a succcesful crowdsale. + * + * The owner can triggre a call the contract that provides post-crowdsale actions, like releasing the tokens. + */ + function finalize() public inState(State.Success) onlyOwner stopInEmergency { + + // Already finalized + if(finalized) { + throw; + } + + // Finalizing is optional. We only call it if we are given a finalizing agent. + if(address(finalizeAgent) != 0) { + finalizeAgent.finalizeCrowdsale(); + } + + finalized = true; + } + + /** + * Allow to (re)set finalize agent. + * + * Design choice: no state restrictions on setting this, so that we can fix fat finger mistakes. + */ + function setFinalizeAgent(FinalizeAgent addr) onlyOwner { + finalizeAgent = addr; + + // Don't allow setting bad agent + if(!finalizeAgent.isFinalizeAgent()) { + throw; + } + } + + /** + * Set policy do we need to have server-side customer ids for the investments. + * + */ + function setRequireCustomerId(bool value) onlyOwner { + requireCustomerId = value; + InvestmentPolicyChanged(requireCustomerId, requiredSignedAddress, signerAddress); + } + + /** + * Set policy if all investors must be cleared on the server side first. + * + * This is e.g. for the accredited investor clearing. + * + */ + function setRequireSignedAddress(bool value, address _signerAddress) onlyOwner { + requiredSignedAddress = value; + signerAddress = _signerAddress; + InvestmentPolicyChanged(requireCustomerId, requiredSignedAddress, signerAddress); + } + + /** + * Allow addresses to do early participation. + * + * TODO: Fix spelling error in the name + */ + function setEarlyParicipantWhitelist(address addr, bool status, uint minCap, uint maxCap) onlyOwner { + if (!isWhiteListed) throw; + earlyParticipantWhitelist[addr] = WhiteListData({status:status, minCap:minCap, maxCap:maxCap}); + Whitelisted(addr, status); + } + + function setEarlyParicipantsWhitelist(address[] addrs, bool[] statuses, uint[] minCaps, uint[] maxCaps) onlyOwner { + if (!isWhiteListed) throw; + for (uint iterator = 0; iterator < addrs.length; iterator++) { + setEarlyParicipantWhitelist(addrs[iterator], statuses[iterator], minCaps[iterator], maxCaps[iterator]); + } + } + + function updateEarlyParicipantWhitelist(address addr, address contractAddr, uint tokensBought) { + if (tokensBought < earlyParticipantWhitelist[addr].minCap) throw; + if (!isWhiteListed) throw; + if (addr != msg.sender && contractAddr != msg.sender) throw; + uint newMaxCap = earlyParticipantWhitelist[addr].maxCap; + newMaxCap = newMaxCap.minus(tokensBought); + earlyParticipantWhitelist[addr] = WhiteListData({status:earlyParticipantWhitelist[addr].status, minCap:0, maxCap:newMaxCap}); + } + + function updateJoinedCrowdsales(address addr) onlyOwner { + joinedCrowdsales[joinedCrowdsalesLen++] = addr; + } + + function setLastCrowdsale(address addr) onlyOwner { + lastCrowdsale = addr; + } + + function clearJoinedCrowdsales() onlyOwner { + joinedCrowdsalesLen = 0; + } + + function updateJoinedCrowdsalesMultiple(address[] addrs) onlyOwner { + clearJoinedCrowdsales(); + for (uint iter = 0; iter < addrs.length; iter++) { + if(joinedCrowdsalesLen == joinedCrowdsales.length) { + joinedCrowdsales.length += 1; + } + joinedCrowdsales[joinedCrowdsalesLen++] = addrs[iter]; + if (iter == addrs.length - 1) + setLastCrowdsale(addrs[iter]); + } + } + + function setStartsAt(uint time) onlyOwner { + if (finalized) throw; + + if (!isUpdatable) throw; + + if(now > time) { + throw; // Don't change past + } + + if(time > endsAt) { + throw; + } + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + startsAt = time; + StartsAtChanged(startsAt); + } + + /** + * Allow crowdsale owner to close early or extend the crowdsale. + * + * This is useful e.g. for a manual soft cap implementation: + * - after X amount is reached determine manual closing + * + * This may put the crowdsale to an invalid state, + * but we trust owners know what they are doing. + * + */ + function setEndsAt(uint time) onlyOwner { + if (finalized) throw; + + if (!isUpdatable) throw; + + if(now > time) { + throw; // Don't change past + } + + if(startsAt > time) { + throw; + } + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + uint num = 0; + for (var i = 0; i < joinedCrowdsalesLen; i++) { + if (this == joinedCrowdsales[i]) + num = i; + } + + if (num + 1 < joinedCrowdsalesLen) { + for (var j = num + 1; j < joinedCrowdsalesLen; j++) { + CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]); + if (time > crowdsale.startsAt()) throw; + } + } + + endsAt = time; + EndsAtChanged(endsAt); + } + + /** + * Allow to (re)set pricing strategy. + * + * Design choice: no state restrictions on the set, so that we can fix fat finger mistakes. + */ + function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner { + pricingStrategy = _pricingStrategy; + + // Don't allow setting bad agent + if(!pricingStrategy.isPricingStrategy()) { + throw; + } + } + + /** + * Allow to change the team multisig address in the case of emergency. + * + * This allows to save a deployed crowdsale wallet in the case the crowdsale has not yet begun + * (we have done only few test transactions). After the crowdsale is going + * then multisig address stays locked for the safety reasons. + */ + function setMultisig(address addr) public onlyOwner { + + // Change + if(investorCount > MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE) { + throw; + } + + multisigWallet = addr; + } + + /** + * Allow load refunds back on the contract for the refunding. + * + * The team can transfer the funds back on the smart contract in the case the minimum goal was not reached.. + */ + function loadRefund() public payable inState(State.Failure) { + if(msg.value == 0) throw; + loadedRefund = loadedRefund.plus(msg.value); + } + + /** + * Investors can claim refund. + * + * Note that any refunds from proxy buyers should be handled separately, + * and not through this contract. + */ + function refund() public inState(State.Refunding) { + uint256 weiValue = investedAmountOf[msg.sender]; + if (weiValue == 0) throw; + investedAmountOf[msg.sender] = 0; + weiRefunded = weiRefunded.plus(weiValue); + Refund(msg.sender, weiValue); + if (!msg.sender.send(weiValue)) throw; + } + + /** + * @return true if the crowdsale has raised enough money to be a successful. + */ + function isMinimumGoalReached() public constant returns (bool reached) { + return weiRaised >= minimumFundingGoal; + } + + /** + * Check if the contract relationship looks good. + */ + function isFinalizerSane() public constant returns (bool sane) { + return finalizeAgent.isSane(); + } + + /** + * Check if the contract relationship looks good. + */ + function isPricingSane() public constant returns (bool sane) { + return pricingStrategy.isSane(address(this)); + } + + /** + * Crowdfund state machine management. + * + * We make it a function and do not assign the result to a variable, so there is no chance of the variable being stale. + */ + function getState() public constant returns (State) { + if(finalized) return State.Finalized; + else if (address(finalizeAgent) == 0) return State.Preparing; + else if (!finalizeAgent.isSane()) return State.Preparing; + else if (!pricingStrategy.isSane(address(this))) return State.Preparing; + else if (block.timestamp < startsAt) return State.PreFunding; + else if (block.timestamp <= endsAt && !isCrowdsaleFull()) return State.Funding; + else if (isMinimumGoalReached()) return State.Success; + else if (!isMinimumGoalReached() && weiRaised > 0 && loadedRefund >= weiRaised) return State.Refunding; + else return State.Failure; + } + + /** This is for manual testing of multisig wallet interaction */ + function setOwnerTestValue(uint val) onlyOwner { + ownerTestValue = val; + } + + /** Interface marker. */ + function isCrowdsale() public constant returns (bool) { + return true; + } + + // + // Modifiers + // + + /** Modified allowing execution only if the crowdsale is currently running. */ + modifier inState(State state) { + if(getState() != state) throw; + _; + } + + + // + // Abstract functions + // + + /** + * Check if the current invested breaks our cap rules. + * + * + * The child contract must define their own cap setting rules. + * We allow a lot of flexibility through different capping strategies (ETH, token count) + * Called from invest(). + * + * @param weiAmount The amount of wei the investor tries to invest in the current transaction + * @param tokenAmount The amount of tokens we try to give to the investor in the current transaction + * @param weiRaisedTotal What would be our total raised balance after this transaction + * @param tokensSoldTotal What would be our total sold tokens count after this transaction + * + * @return true if taking this investment would break our cap rules + */ + function isBreakingCap(uint weiAmount, uint tokenAmount, uint weiRaisedTotal, uint tokensSoldTotal) constant returns (bool limitBroken); + + function isBreakingInvestorCap(address receiver, uint tokenAmount) constant returns (bool limitBroken); + + /** + * Check if the current crowdsale is full and we can no longer sell any tokens. + */ + function isCrowdsaleFull() public constant returns (bool); + + /** + * Create new tokens or transfer issued tokens to the investor depending on the cap model. + */ + function assignTokens(address receiver, uint tokenAmount) private; +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + + +/** + * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. + * + * Based on code by FirstBlood: + * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol + */ +contract StandardToken is ERC20, SafeMath { + + /* Token supply got increased and a new owner received these tokens */ + event Minted(address receiver, uint amount); + + /* Actual balances of token holders */ + mapping(address => uint) balances; + + /* approve() allowances */ + mapping (address => mapping (address => uint)) allowed; + + /* Interface declaration */ + function isToken() public constant returns (bool weAre) { + return true; + } + + function transfer(address _to, uint _value) returns (bool success) { + balances[msg.sender] = safeSub(balances[msg.sender], _value); + balances[_to] = safeAdd(balances[_to], _value); + Transfer(msg.sender, _to, _value); + return true; + } + + function transferFrom(address _from, address _to, uint _value) returns (bool success) { + uint _allowance = allowed[_from][msg.sender]; + + balances[_to] = safeAdd(balances[_to], _value); + balances[_from] = safeSub(balances[_from], _value); + allowed[_from][msg.sender] = safeSub(_allowance, _value); + Transfer(_from, _to, _value); + return true; + } + + function balanceOf(address _owner) constant returns (uint balance) { + return balances[_owner]; + } + + function approve(address _spender, uint _value) returns (bool success) { + + // To change the approve amount you first have to reduce the addresses` + // allowance to zero by calling `approve(_spender, 0)` if it is not + // already 0 to mitigate the race condition described here: + // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; + + allowed[msg.sender][_spender] = _value; + Approval(msg.sender, _spender, _value); + return true; + } + + function allowance(address _owner, address _spender) constant returns (uint remaining) { + return allowed[_owner][_spender]; + } + +} + + + + + +/** + * A token that can increase its supply by another contract. + * + * This allows uncapped crowdsale by dynamically increasing the supply when money pours in. + * Only mint agents, contracts whitelisted by owner, can mint new tokens. + * + */ +contract MintableTokenExt is StandardToken, Ownable { + + using SafeMathLibExt for uint; + + bool public mintingFinished = false; + + /** List of agents that are allowed to create new tokens */ + mapping (address => bool) public mintAgents; + + event MintingAgentChanged(address addr, bool state ); + + /** inPercentageUnit is percents of tokens multiplied to 10 up to percents decimals. + * For example, for reserved tokens in percents 2.54% + * inPercentageUnit = 254 + * inPercentageDecimals = 2 + */ + struct ReservedTokensData { + uint inTokens; + uint inPercentageUnit; + uint inPercentageDecimals; + } + + mapping (address => ReservedTokensData) public reservedTokensList; + address[] public reservedTokensDestinations; + uint public reservedTokensDestinationsLen = 0; + + function setReservedTokensList(address addr, uint inTokens, uint inPercentageUnit, uint inPercentageDecimals) onlyOwner { + reservedTokensDestinations.push(addr); + reservedTokensDestinationsLen++; + reservedTokensList[addr] = ReservedTokensData({inTokens:inTokens, inPercentageUnit:inPercentageUnit, inPercentageDecimals: inPercentageDecimals}); + } + + function getReservedTokensListValInTokens(address addr) constant returns (uint inTokens) { + return reservedTokensList[addr].inTokens; + } + + function getReservedTokensListValInPercentageUnit(address addr) constant returns (uint inPercentageUnit) { + return reservedTokensList[addr].inPercentageUnit; + } + + function getReservedTokensListValInPercentageDecimals(address addr) constant returns (uint inPercentageDecimals) { + return reservedTokensList[addr].inPercentageDecimals; + } + + function setReservedTokensListMultiple(address[] addrs, uint[] inTokens, uint[] inPercentageUnit, uint[] inPercentageDecimals) onlyOwner { + for (uint iterator = 0; iterator < addrs.length; iterator++) { + setReservedTokensList(addrs[iterator], inTokens[iterator], inPercentageUnit[iterator], inPercentageDecimals[iterator]); + } + } + + /** + * Create new tokens and allocate them to an address.. + * + * Only callably by a crowdsale contract (mint agent). + */ + function mint(address receiver, uint amount) onlyMintAgent canMint public { + totalSupply = totalSupply.plus(amount); + balances[receiver] = balances[receiver].plus(amount); + + // This will make the mint transaction apper in EtherScan.io + // We can remove this after there is a standardized minting event + Transfer(0, receiver, amount); + } + + /** + * Owner can allow a crowdsale contract to mint new tokens. + */ + function setMintAgent(address addr, bool state) onlyOwner canMint public { + mintAgents[addr] = state; + MintingAgentChanged(addr, state); + } + + modifier onlyMintAgent() { + // Only crowdsale contracts are allowed to mint new tokens + if(!mintAgents[msg.sender]) { + throw; + } + _; + } + + /** Make sure we are not done yet. */ + modifier canMint() { + if(mintingFinished) throw; + _; + } +} + + +/** + * ICO crowdsale contract that is capped by amout of tokens. + * + * - Tokens are dynamically created during the crowdsale + * + * + */ +contract MintedTokenCappedCrowdsaleExt is CrowdsaleExt { + + /* Maximum amount of tokens this crowdsale can sell. */ + uint public maximumSellableTokens; + + function MintedTokenCappedCrowdsaleExt(address _token, PricingStrategy _pricingStrategy, address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal, uint _maximumSellableTokens, bool _isUpdatable, bool _isWhiteListed) CrowdsaleExt(_token, _pricingStrategy, _multisigWallet, _start, _end, _minimumFundingGoal, _isUpdatable, _isWhiteListed) { + maximumSellableTokens = _maximumSellableTokens; + } + + // Crowdsale maximumSellableTokens has been changed + event MaximumSellableTokensChanged(uint newMaximumSellableTokens); + + /** + * Called from invest() to confirm if the curret investment does not break our cap rule. + */ + function isBreakingCap(uint weiAmount, uint tokenAmount, uint weiRaisedTotal, uint tokensSoldTotal) constant returns (bool limitBroken) { + return tokensSoldTotal > maximumSellableTokens; + } + + function isBreakingInvestorCap(address addr, uint tokenAmount) constant returns (bool limitBroken) { + if (!isWhiteListed) throw; + uint maxCap = earlyParticipantWhitelist[addr].maxCap; + return (tokenAmountOf[addr].plus(tokenAmount)) > maxCap; + } + + function isCrowdsaleFull() public constant returns (bool) { + return tokensSold >= maximumSellableTokens; + } + + /** + * Dynamically create tokens and assign them to the investor. + */ + function assignTokens(address receiver, uint tokenAmount) private { + MintableTokenExt mintableToken = MintableTokenExt(token); + mintableToken.mint(receiver, tokenAmount); + } + + function setMaximumSellableTokens(uint tokens) onlyOwner { + if (finalized) throw; + + if (!isUpdatable) throw; + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + maximumSellableTokens = tokens; + MaximumSellableTokensChanged(maximumSellableTokens); + } +} diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/008_MintedTokenCappedCrowdsaleExt.txt b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/008_MintedTokenCappedCrowdsaleExt.txt new file mode 100755 index 0000000..b23f47a --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/008_MintedTokenCappedCrowdsaleExt.txt @@ -0,0 +1,35 @@ +Token name: Block Array + +Token ticker: ARY + +Token decimals: 18 + +Multisig wallet address: 0x0239033Ef9384313a6eC6506Ae5B4A0af5c66A31 + +***************************** + +Crowdsale rate: 4731 + +Crowdsale start time: 2017-12-23T17:55 (GMT - 5) + +Crowdsale end time: 2018-01-14T18:00 (GMT - 5) + +Compiler Version: 0.4.11 + +Is optimization enabled?: true + +***************************** + +Crowdsale contract name: MintedTokenCappedCrowdsaleExt + +Crowdsale contract address for Token Generation Event: 0x3D5fb1E9d2F15D9ae5d7f4af4825FDEf03dE9685 + +***************************** + +****Crowdsale contract ABI:**** + +[{"constant":true,"inputs":[],"name":"ownerTestValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"requireCustomerId","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"invest","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"},{"name":"tokenAmount","type":"uint256"}],"name":"isBreakingInvestorCap","outputs":[{"name":"limitBroken","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addrs","type":"address[]"}],"name":"updateJoinedCrowdsalesMultiple","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isPricingSane","outputs":[{"name":"sane","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"endsAt","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"status","type":"bool"},{"name":"minCap","type":"uint256"},{"name":"maxCap","type":"uint256"}],"name":"setEarlyParicipantWhitelist","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isUpdatable","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"minimumFundingGoal","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getState","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setFinalizeAgent","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"customerId","type":"uint128"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"investWithSignedAddress","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"investedAmountOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"finalizeAgent","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"tokens","type":"uint256"}],"name":"setMaximumSellableTokens","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"receiver","type":"address"},{"name":"fullTokens","type":"uint256"},{"name":"weiPrice","type":"uint256"}],"name":"preallocate","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maximumSellableTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"weiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isCrowdsale","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"finalize","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"lastCrowdsale","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_pricingStrategy","type":"address"}],"name":"setPricingStrategy","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tokensSold","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setLastCrowdsale","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"signerAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"weiRefunded","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"halt","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"time","type":"uint256"}],"name":"setEndsAt","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"pricingStrategy","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"loadedRefund","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addrs","type":"address[]"},{"name":"statuses","type":"bool[]"},{"name":"minCaps","type":"uint256[]"},{"name":"maxCaps","type":"uint256[]"}],"name":"setEarlyParicipantsWhitelist","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isMinimumGoalReached","outputs":[{"name":"reached","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"value","type":"bool"}],"name":"setRequireCustomerId","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"clearJoinedCrowdsales","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"loadRefund","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"val","type":"uint256"}],"name":"setOwnerTestValue","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"multisigWallet","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"tokenAmountOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"customerId","type":"uint128"}],"name":"buyWithCustomerId","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[{"name":"weiAmount","type":"uint256"},{"name":"tokenAmount","type":"uint256"},{"name":"weiRaisedTotal","type":"uint256"},{"name":"tokensSoldTotal","type":"uint256"}],"name":"isBreakingCap","outputs":[{"name":"limitBroken","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"buy","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"isFinalizerSane","outputs":[{"name":"sane","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"startsAt","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"finalized","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"halted","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"joinedCrowdsales","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"time","type":"uint256"}],"name":"setStartsAt","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"earlyParticipantWhitelist","outputs":[{"name":"status","type":"bool"},{"name":"minCap","type":"uint256"},{"name":"maxCap","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"unhalt","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"requiredSignedAddress","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"contractAddr","type":"address"},{"name":"tokensBought","type":"uint256"}],"name":"updateEarlyParicipantWhitelist","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isCrowdsaleFull","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"investorCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"updateJoinedCrowdsales","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"joinedCrowdsalesLen","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"value","type":"bool"},{"name":"_signerAddress","type":"address"}],"name":"setRequireSignedAddress","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isWhiteListed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"customerId","type":"uint128"}],"name":"investWithCustomerId","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setMultisig","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"customerId","type":"uint128"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"buyWithSignedAddress","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"presaleWeiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_pricingStrategy","type":"address"},{"name":"_multisigWallet","type":"address"},{"name":"_start","type":"uint256"},{"name":"_end","type":"uint256"},{"name":"_minimumFundingGoal","type":"uint256"},{"name":"_maximumSellableTokens","type":"uint256"},{"name":"_isUpdatable","type":"bool"},{"name":"_isWhiteListed","type":"bool"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newMaximumSellableTokens","type":"uint256"}],"name":"MaximumSellableTokensChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"investor","type":"address"},{"indexed":false,"name":"weiAmount","type":"uint256"},{"indexed":false,"name":"tokenAmount","type":"uint256"},{"indexed":false,"name":"customerId","type":"uint128"}],"name":"Invested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"investor","type":"address"},{"indexed":false,"name":"weiAmount","type":"uint256"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newRequireCustomerId","type":"bool"},{"indexed":false,"name":"newRequiredSignedAddress","type":"bool"},{"indexed":false,"name":"newSignerAddress","type":"address"}],"name":"InvestmentPolicyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"status","type":"bool"}],"name":"Whitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newStartsAt","type":"uint256"}],"name":"StartsAtChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newEndsAt","type":"uint256"}],"name":"EndsAtChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}] + +****Crowdsale contract ABI encoded constructor arguments for Token Generation Event:**** + +000000000000000000000000a5f8fc0921880cb7342368bd128eb8050442b1a10000000000000000000000006692d5dd701b9373933730d4e4f3b498db7f7c320000000000000000000000000239033ef9384313a6ec6506ae5b4a0af5c66a31000000000000000000000000000000000000000000000000000000005a3edec4000000000000000000000000000000000000000000000000000000005a5be0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d0106465da8d2a9e05e0000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000 \ No newline at end of file diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/009_ReservedTokensFinalizeAgent.sol b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/009_ReservedTokensFinalizeAgent.sol new file mode 100755 index 0000000..4323051 --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/009_ReservedTokensFinalizeAgent.sol @@ -0,0 +1,1633 @@ +// Created using ICO Wizard https://github.com/oraclesorg/ico-wizard by Oracles Network +pragma solidity ^0.4.11; + + +/** + * @title ERC20Basic + * @dev Simpler version of ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/179 + */ +contract ERC20Basic { + uint256 public totalSupply; + function balanceOf(address who) public constant returns (uint256); + function transfer(address to, uint256 value) public returns (bool); + event Transfer(address indexed from, address indexed to, uint256 value); +} +// Temporarily have SafeMath here until all contracts have been migrated to SafeMathLib version from OpenZeppelin + + + + +/** + * Math operations with safety checks + */ +contract SafeMath { + function safeMul(uint a, uint b) internal returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function safeDiv(uint a, uint b) internal returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function safeSub(uint a, uint b) internal returns (uint) { + assert(b <= a); + return a - b; + } + + function safeAdd(uint a, uint b) internal returns (uint) { + uint c = a + b; + assert(c>=a && c>=b); + return c; + } + + function max64(uint64 a, uint64 b) internal constant returns (uint64) { + return a >= b ? a : b; + } + + function min64(uint64 a, uint64 b) internal constant returns (uint64) { + return a < b ? a : b; + } + + function max256(uint256 a, uint256 b) internal constant returns (uint256) { + return a >= b ? a : b; + } + + function min256(uint256 a, uint256 b) internal constant returns (uint256) { + return a < b ? a : b; + } + +} + + + +/** + * @title Ownable + * @dev The Ownable contract has an owner address, and provides basic authorization control + * functions, this simplifies the implementation of "user permissions". + */ +contract Ownable { + address public owner; + + + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + + + /** + * @dev The Ownable constructor sets the original `owner` of the contract to the sender + * account. + */ + function Ownable() { + owner = msg.sender; + } + + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + require(msg.sender == owner); + _; + } + + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) onlyOwner public { + require(newOwner != address(0)); + OwnershipTransferred(owner, newOwner); + owner = newOwner; + } + +} +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Safe unsigned safe math. + * + * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli + * + * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol + * + * Maintained here until merged to mainline zeppelin-solidity. + * + */ +library SafeMathLibExt { + + function times(uint a, uint b) returns (uint) { + uint c = a * b; + assert(a == 0 || c / a == b); + return c; + } + + function divides(uint a, uint b) returns (uint) { + assert(b > 0); + uint c = a / b; + assert(a == b * c + a % b); + return c; + } + + function minus(uint a, uint b) returns (uint) { + assert(b <= a); + return a - b; + } + + function plus(uint a, uint b) returns (uint) { + uint c = a + b; + assert(c>=a); + return c; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + +/* + * Haltable + * + * Abstract contract that allows children to implement an + * emergency stop mechanism. Differs from Pausable by causing a throw when in halt mode. + * + * + * Originally envisioned in FirstBlood ICO contract. + */ +contract Haltable is Ownable { + bool public halted; + + modifier stopInEmergency { + if (halted) throw; + _; + } + + modifier stopNonOwnersInEmergency { + if (halted && msg.sender != owner) throw; + _; + } + + modifier onlyInEmergency { + if (!halted) throw; + _; + } + + // called by the owner on emergency, triggers stopped state + function halt() external onlyOwner { + halted = true; + } + + // called by the owner on end of emergency, returns to normal state + function unhalt() external onlyOwner onlyInEmergency { + halted = false; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Interface for defining crowdsale pricing. + */ +contract PricingStrategy { + + /** Interface declaration. */ + function isPricingStrategy() public constant returns (bool) { + return true; + } + + /** Self check if all references are correctly set. + * + * Checks that pricing strategy matches crowdsale parameters. + */ + function isSane(address crowdsale) public constant returns (bool) { + return true; + } + + /** + * @dev Pricing tells if this is a presale purchase or not. + @param purchaser Address of the purchaser + @return False by default, true if a presale purchaser + */ + function isPresalePurchase(address purchaser) public constant returns (bool) { + return false; + } + + /** + * When somebody tries to buy tokens for X eth, calculate how many tokens they get. + * + * + * @param value - What is the value of the transaction send in as wei + * @param tokensSold - how much tokens have been sold this far + * @param weiRaised - how much money has been raised this far in the main token sale - this number excludes presale + * @param msgSender - who is the investor of this transaction + * @param decimals - how many decimal units the token has + * @return Amount of tokens the investor receives + */ + function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint tokenAmount); +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Finalize agent defines what happens at the end of succeseful crowdsale. + * + * - Allocate tokens for founders, bounties and community + * - Make tokens transferable + * - etc. + */ +contract FinalizeAgent { + + function isFinalizeAgent() public constant returns(bool) { + return true; + } + + /** Return true if we can run finalizeCrowdsale() properly. + * + * This is a safety check function that doesn't allow crowdsale to begin + * unless the finalizer has been set up properly. + */ + function isSane() public constant returns (bool); + + /** Called once by crowdsale finalize() if the sale was success. */ + function finalizeCrowdsale(); + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + + + +/** + * @title ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/20 + */ +contract ERC20 is ERC20Basic { + function allowance(address owner, address spender) public constant returns (uint256); + function transferFrom(address from, address to, uint256 value) public returns (bool); + function approve(address spender, uint256 value) public returns (bool); + event Approval(address indexed owner, address indexed spender, uint256 value); +} + + +/** + * A token that defines fractional units as decimals. + */ +contract FractionalERC20Ext is ERC20 { + + uint public decimals; + uint public minCap; + +} + + + +/** + * Abstract base contract for token sales. + * + * Handle + * - start and end dates + * - accepting investments + * - minimum funding goal and refund + * - various statistics during the crowdfund + * - different pricing strategies + * - different investment policies (require server side customer id, allow only whitelisted addresses) + * + */ +contract CrowdsaleExt is Haltable { + + /* Max investment count when we are still allowed to change the multisig address */ + uint public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5; + + using SafeMathLibExt for uint; + + /* The token we are selling */ + FractionalERC20Ext public token; + + /* How we are going to price our offering */ + PricingStrategy public pricingStrategy; + + /* Post-success callback */ + FinalizeAgent public finalizeAgent; + + /* tokens will be transfered from this address */ + address public multisigWallet; + + /* if the funding goal is not reached, investors may withdraw their funds */ + uint public minimumFundingGoal; + + /* the UNIX timestamp start date of the crowdsale */ + uint public startsAt; + + /* the UNIX timestamp end date of the crowdsale */ + uint public endsAt; + + /* the number of tokens already sold through this contract*/ + uint public tokensSold = 0; + + /* How many wei of funding we have raised */ + uint public weiRaised = 0; + + /* Calculate incoming funds from presale contracts and addresses */ + uint public presaleWeiRaised = 0; + + /* How many distinct addresses have invested */ + uint public investorCount = 0; + + /* How much wei we have returned back to the contract after a failed crowdfund. */ + uint public loadedRefund = 0; + + /* How much wei we have given back to investors.*/ + uint public weiRefunded = 0; + + /* Has this crowdsale been finalized */ + bool public finalized; + + /* Do we need to have unique contributor id for each customer */ + bool public requireCustomerId; + + bool public isWhiteListed; + + address[] public joinedCrowdsales; + uint public joinedCrowdsalesLen = 0; + + address public lastCrowdsale; + + /** + * Do we verify that contributor has been cleared on the server side (accredited investors only). + * This method was first used in FirstBlood crowdsale to ensure all contributors have accepted terms on sale (on the web). + */ + bool public requiredSignedAddress; + + /* Server side address that signed allowed contributors (Ethereum addresses) that can participate the crowdsale */ + address public signerAddress; + + /** How much ETH each address has invested to this crowdsale */ + mapping (address => uint256) public investedAmountOf; + + /** How much tokens this crowdsale has credited for each investor address */ + mapping (address => uint256) public tokenAmountOf; + + struct WhiteListData { + bool status; + uint minCap; + uint maxCap; + } + + //is crowdsale updatable + bool public isUpdatable; + + /** Addresses that are allowed to invest even before ICO offical opens. For testing, for ICO partners, etc. */ + mapping (address => WhiteListData) public earlyParticipantWhitelist; + + /** This is for manul testing for the interaction from owner wallet. You can set it to any value and inspect this in blockchain explorer to see that crowdsale interaction works. */ + uint public ownerTestValue; + + /** State machine + * + * - Preparing: All contract initialization calls and variables have not been set yet + * - Prefunding: We have not passed start time yet + * - Funding: Active crowdsale + * - Success: Minimum funding goal reached + * - Failure: Minimum funding goal not reached before ending time + * - Finalized: The finalized has been called and succesfully executed + * - Refunding: Refunds are loaded on the contract for reclaim. + */ + enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized, Refunding} + + // A new investment was made + event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId); + + // Refund was processed for a contributor + event Refund(address investor, uint weiAmount); + + // The rules were changed what kind of investments we accept + event InvestmentPolicyChanged(bool newRequireCustomerId, bool newRequiredSignedAddress, address newSignerAddress); + + // Address early participation whitelist status changed + event Whitelisted(address addr, bool status); + + // Crowdsale start time has been changed + event StartsAtChanged(uint newStartsAt); + + // Crowdsale end time has been changed + event EndsAtChanged(uint newEndsAt); + + function CrowdsaleExt(address _token, PricingStrategy _pricingStrategy, address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal, bool _isUpdatable, bool _isWhiteListed) { + + owner = msg.sender; + + token = FractionalERC20Ext(_token); + + setPricingStrategy(_pricingStrategy); + + multisigWallet = _multisigWallet; + if(multisigWallet == 0) { + throw; + } + + if(_start == 0) { + throw; + } + + startsAt = _start; + + if(_end == 0) { + throw; + } + + endsAt = _end; + + // Don't mess the dates + if(startsAt >= endsAt) { + throw; + } + + // Minimum funding goal can be zero + minimumFundingGoal = _minimumFundingGoal; + + isUpdatable = _isUpdatable; + + isWhiteListed = _isWhiteListed; + } + + /** + * Don't expect to just send in money and get tokens. + */ + function() payable { + throw; + } + + /** + * Make an investment. + * + * Crowdsale must be running for one to invest. + * We must have not pressed the emergency brake. + * + * @param receiver The Ethereum address who receives the tokens + * @param customerId (optional) UUID v4 to track the successful payments on the server side + * + */ + function investInternal(address receiver, uint128 customerId) stopInEmergency private { + + // Determine if it's a good time to accept investment from this participant + if(getState() == State.PreFunding) { + // Are we whitelisted for early deposit + throw; + } else if(getState() == State.Funding) { + // Retail participants can only come in when the crowdsale is running + // pass + if(isWhiteListed) { + if(!earlyParticipantWhitelist[receiver].status) { + throw; + } + } + } else { + // Unwanted state + throw; + } + + uint weiAmount = msg.value; + + // Account presale sales separately, so that they do not count against pricing tranches + uint tokenAmount = pricingStrategy.calculatePrice(weiAmount, weiRaised - presaleWeiRaised, tokensSold, msg.sender, token.decimals()); + + if(tokenAmount == 0) { + // Dust transaction + throw; + } + + if(isWhiteListed) { + if(tokenAmount < earlyParticipantWhitelist[receiver].minCap && tokenAmountOf[receiver] == 0) { + // tokenAmount < minCap for investor + throw; + } + if(tokenAmount > earlyParticipantWhitelist[receiver].maxCap) { + // tokenAmount > maxCap for investor + throw; + } + + // Check that we did not bust the investor's cap + if (isBreakingInvestorCap(receiver, tokenAmount)) { + throw; + } + } else { + if(tokenAmount < token.minCap() && tokenAmountOf[receiver] == 0) { + throw; + } + } + + if(investedAmountOf[receiver] == 0) { + // A new investor + investorCount++; + } + + // Update investor + investedAmountOf[receiver] = investedAmountOf[receiver].plus(weiAmount); + tokenAmountOf[receiver] = tokenAmountOf[receiver].plus(tokenAmount); + + // Update totals + weiRaised = weiRaised.plus(weiAmount); + tokensSold = tokensSold.plus(tokenAmount); + + if(pricingStrategy.isPresalePurchase(receiver)) { + presaleWeiRaised = presaleWeiRaised.plus(weiAmount); + } + + // Check that we did not bust the cap + if(isBreakingCap(weiAmount, tokenAmount, weiRaised, tokensSold)) { + throw; + } + + assignTokens(receiver, tokenAmount); + + // Pocket the money + if(!multisigWallet.send(weiAmount)) throw; + + if (isWhiteListed) { + uint num = 0; + for (var i = 0; i < joinedCrowdsalesLen; i++) { + if (this == joinedCrowdsales[i]) + num = i; + } + + if (num + 1 < joinedCrowdsalesLen) { + for (var j = num + 1; j < joinedCrowdsalesLen; j++) { + CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]); + crowdsale.updateEarlyParicipantWhitelist(msg.sender, this, tokenAmount); + } + } + } + + // Tell us invest was success + Invested(receiver, weiAmount, tokenAmount, customerId); + } + + /** + * Preallocate tokens for the early investors. + * + * Preallocated tokens have been sold before the actual crowdsale opens. + * This function mints the tokens and moves the crowdsale needle. + * + * Investor count is not handled; it is assumed this goes for multiple investors + * and the token distribution happens outside the smart contract flow. + * + * No money is exchanged, as the crowdsale team already have received the payment. + * + * @param fullTokens tokens as full tokens - decimal places added internally + * @param weiPrice Price of a single full token in wei + * + */ + function preallocate(address receiver, uint fullTokens, uint weiPrice) public onlyOwner { + + uint tokenAmount = fullTokens * 10**token.decimals(); + uint weiAmount = weiPrice * fullTokens; // This can be also 0, we give out tokens for free + + weiRaised = weiRaised.plus(weiAmount); + tokensSold = tokensSold.plus(tokenAmount); + + investedAmountOf[receiver] = investedAmountOf[receiver].plus(weiAmount); + tokenAmountOf[receiver] = tokenAmountOf[receiver].plus(tokenAmount); + + assignTokens(receiver, tokenAmount); + + // Tell us invest was success + Invested(receiver, weiAmount, tokenAmount, 0); + } + + /** + * Allow anonymous contributions to this crowdsale. + */ + function investWithSignedAddress(address addr, uint128 customerId, uint8 v, bytes32 r, bytes32 s) public payable { + bytes32 hash = sha256(addr); + if (ecrecover(hash, v, r, s) != signerAddress) throw; + if(customerId == 0) throw; // UUIDv4 sanity check + investInternal(addr, customerId); + } + + /** + * Track who is the customer making the payment so we can send thank you email. + */ + function investWithCustomerId(address addr, uint128 customerId) public payable { + if(requiredSignedAddress) throw; // Crowdsale allows only server-side signed participants + if(customerId == 0) throw; // UUIDv4 sanity check + investInternal(addr, customerId); + } + + /** + * Allow anonymous contributions to this crowdsale. + */ + function invest(address addr) public payable { + if(requireCustomerId) throw; // Crowdsale needs to track participants for thank you email + if(requiredSignedAddress) throw; // Crowdsale allows only server-side signed participants + investInternal(addr, 0); + } + + /** + * Invest to tokens, recognize the payer and clear his address. + * + */ + function buyWithSignedAddress(uint128 customerId, uint8 v, bytes32 r, bytes32 s) public payable { + investWithSignedAddress(msg.sender, customerId, v, r, s); + } + + /** + * Invest to tokens, recognize the payer. + * + */ + function buyWithCustomerId(uint128 customerId) public payable { + investWithCustomerId(msg.sender, customerId); + } + + /** + * The basic entry point to participate the crowdsale process. + * + * Pay for funding, get invested tokens back in the sender address. + */ + function buy() public payable { + invest(msg.sender); + } + + /** + * Finalize a succcesful crowdsale. + * + * The owner can triggre a call the contract that provides post-crowdsale actions, like releasing the tokens. + */ + function finalize() public inState(State.Success) onlyOwner stopInEmergency { + + // Already finalized + if(finalized) { + throw; + } + + // Finalizing is optional. We only call it if we are given a finalizing agent. + if(address(finalizeAgent) != 0) { + finalizeAgent.finalizeCrowdsale(); + } + + finalized = true; + } + + /** + * Allow to (re)set finalize agent. + * + * Design choice: no state restrictions on setting this, so that we can fix fat finger mistakes. + */ + function setFinalizeAgent(FinalizeAgent addr) onlyOwner { + finalizeAgent = addr; + + // Don't allow setting bad agent + if(!finalizeAgent.isFinalizeAgent()) { + throw; + } + } + + /** + * Set policy do we need to have server-side customer ids for the investments. + * + */ + function setRequireCustomerId(bool value) onlyOwner { + requireCustomerId = value; + InvestmentPolicyChanged(requireCustomerId, requiredSignedAddress, signerAddress); + } + + /** + * Set policy if all investors must be cleared on the server side first. + * + * This is e.g. for the accredited investor clearing. + * + */ + function setRequireSignedAddress(bool value, address _signerAddress) onlyOwner { + requiredSignedAddress = value; + signerAddress = _signerAddress; + InvestmentPolicyChanged(requireCustomerId, requiredSignedAddress, signerAddress); + } + + /** + * Allow addresses to do early participation. + * + * TODO: Fix spelling error in the name + */ + function setEarlyParicipantWhitelist(address addr, bool status, uint minCap, uint maxCap) onlyOwner { + if (!isWhiteListed) throw; + earlyParticipantWhitelist[addr] = WhiteListData({status:status, minCap:minCap, maxCap:maxCap}); + Whitelisted(addr, status); + } + + function setEarlyParicipantsWhitelist(address[] addrs, bool[] statuses, uint[] minCaps, uint[] maxCaps) onlyOwner { + if (!isWhiteListed) throw; + for (uint iterator = 0; iterator < addrs.length; iterator++) { + setEarlyParicipantWhitelist(addrs[iterator], statuses[iterator], minCaps[iterator], maxCaps[iterator]); + } + } + + function updateEarlyParicipantWhitelist(address addr, address contractAddr, uint tokensBought) { + if (tokensBought < earlyParticipantWhitelist[addr].minCap) throw; + if (!isWhiteListed) throw; + if (addr != msg.sender && contractAddr != msg.sender) throw; + uint newMaxCap = earlyParticipantWhitelist[addr].maxCap; + newMaxCap = newMaxCap.minus(tokensBought); + earlyParticipantWhitelist[addr] = WhiteListData({status:earlyParticipantWhitelist[addr].status, minCap:0, maxCap:newMaxCap}); + } + + function updateJoinedCrowdsales(address addr) onlyOwner { + joinedCrowdsales[joinedCrowdsalesLen++] = addr; + } + + function setLastCrowdsale(address addr) onlyOwner { + lastCrowdsale = addr; + } + + function clearJoinedCrowdsales() onlyOwner { + joinedCrowdsalesLen = 0; + } + + function updateJoinedCrowdsalesMultiple(address[] addrs) onlyOwner { + clearJoinedCrowdsales(); + for (uint iter = 0; iter < addrs.length; iter++) { + if(joinedCrowdsalesLen == joinedCrowdsales.length) { + joinedCrowdsales.length += 1; + } + joinedCrowdsales[joinedCrowdsalesLen++] = addrs[iter]; + if (iter == addrs.length - 1) + setLastCrowdsale(addrs[iter]); + } + } + + function setStartsAt(uint time) onlyOwner { + if (finalized) throw; + + if (!isUpdatable) throw; + + if(now > time) { + throw; // Don't change past + } + + if(time > endsAt) { + throw; + } + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + startsAt = time; + StartsAtChanged(startsAt); + } + + /** + * Allow crowdsale owner to close early or extend the crowdsale. + * + * This is useful e.g. for a manual soft cap implementation: + * - after X amount is reached determine manual closing + * + * This may put the crowdsale to an invalid state, + * but we trust owners know what they are doing. + * + */ + function setEndsAt(uint time) onlyOwner { + if (finalized) throw; + + if (!isUpdatable) throw; + + if(now > time) { + throw; // Don't change past + } + + if(startsAt > time) { + throw; + } + + CrowdsaleExt lastCrowdsaleCntrct = CrowdsaleExt(lastCrowdsale); + if (lastCrowdsaleCntrct.finalized()) throw; + + uint num = 0; + for (var i = 0; i < joinedCrowdsalesLen; i++) { + if (this == joinedCrowdsales[i]) + num = i; + } + + if (num + 1 < joinedCrowdsalesLen) { + for (var j = num + 1; j < joinedCrowdsalesLen; j++) { + CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]); + if (time > crowdsale.startsAt()) throw; + } + } + + endsAt = time; + EndsAtChanged(endsAt); + } + + /** + * Allow to (re)set pricing strategy. + * + * Design choice: no state restrictions on the set, so that we can fix fat finger mistakes. + */ + function setPricingStrategy(PricingStrategy _pricingStrategy) onlyOwner { + pricingStrategy = _pricingStrategy; + + // Don't allow setting bad agent + if(!pricingStrategy.isPricingStrategy()) { + throw; + } + } + + /** + * Allow to change the team multisig address in the case of emergency. + * + * This allows to save a deployed crowdsale wallet in the case the crowdsale has not yet begun + * (we have done only few test transactions). After the crowdsale is going + * then multisig address stays locked for the safety reasons. + */ + function setMultisig(address addr) public onlyOwner { + + // Change + if(investorCount > MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE) { + throw; + } + + multisigWallet = addr; + } + + /** + * Allow load refunds back on the contract for the refunding. + * + * The team can transfer the funds back on the smart contract in the case the minimum goal was not reached.. + */ + function loadRefund() public payable inState(State.Failure) { + if(msg.value == 0) throw; + loadedRefund = loadedRefund.plus(msg.value); + } + + /** + * Investors can claim refund. + * + * Note that any refunds from proxy buyers should be handled separately, + * and not through this contract. + */ + function refund() public inState(State.Refunding) { + uint256 weiValue = investedAmountOf[msg.sender]; + if (weiValue == 0) throw; + investedAmountOf[msg.sender] = 0; + weiRefunded = weiRefunded.plus(weiValue); + Refund(msg.sender, weiValue); + if (!msg.sender.send(weiValue)) throw; + } + + /** + * @return true if the crowdsale has raised enough money to be a successful. + */ + function isMinimumGoalReached() public constant returns (bool reached) { + return weiRaised >= minimumFundingGoal; + } + + /** + * Check if the contract relationship looks good. + */ + function isFinalizerSane() public constant returns (bool sane) { + return finalizeAgent.isSane(); + } + + /** + * Check if the contract relationship looks good. + */ + function isPricingSane() public constant returns (bool sane) { + return pricingStrategy.isSane(address(this)); + } + + /** + * Crowdfund state machine management. + * + * We make it a function and do not assign the result to a variable, so there is no chance of the variable being stale. + */ + function getState() public constant returns (State) { + if(finalized) return State.Finalized; + else if (address(finalizeAgent) == 0) return State.Preparing; + else if (!finalizeAgent.isSane()) return State.Preparing; + else if (!pricingStrategy.isSane(address(this))) return State.Preparing; + else if (block.timestamp < startsAt) return State.PreFunding; + else if (block.timestamp <= endsAt && !isCrowdsaleFull()) return State.Funding; + else if (isMinimumGoalReached()) return State.Success; + else if (!isMinimumGoalReached() && weiRaised > 0 && loadedRefund >= weiRaised) return State.Refunding; + else return State.Failure; + } + + /** This is for manual testing of multisig wallet interaction */ + function setOwnerTestValue(uint val) onlyOwner { + ownerTestValue = val; + } + + /** Interface marker. */ + function isCrowdsale() public constant returns (bool) { + return true; + } + + // + // Modifiers + // + + /** Modified allowing execution only if the crowdsale is currently running. */ + modifier inState(State state) { + if(getState() != state) throw; + _; + } + + + // + // Abstract functions + // + + /** + * Check if the current invested breaks our cap rules. + * + * + * The child contract must define their own cap setting rules. + * We allow a lot of flexibility through different capping strategies (ETH, token count) + * Called from invest(). + * + * @param weiAmount The amount of wei the investor tries to invest in the current transaction + * @param tokenAmount The amount of tokens we try to give to the investor in the current transaction + * @param weiRaisedTotal What would be our total raised balance after this transaction + * @param tokensSoldTotal What would be our total sold tokens count after this transaction + * + * @return true if taking this investment would break our cap rules + */ + function isBreakingCap(uint weiAmount, uint tokenAmount, uint weiRaisedTotal, uint tokensSoldTotal) constant returns (bool limitBroken); + + function isBreakingInvestorCap(address receiver, uint tokenAmount) constant returns (bool limitBroken); + + /** + * Check if the current crowdsale is full and we can no longer sell any tokens. + */ + function isCrowdsaleFull() public constant returns (bool); + + /** + * Create new tokens or transfer issued tokens to the investor depending on the cap model. + */ + function assignTokens(address receiver, uint tokenAmount) private; +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + + +/** + * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. + * + * Based on code by FirstBlood: + * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol + */ +contract StandardToken is ERC20, SafeMath { + + /* Token supply got increased and a new owner received these tokens */ + event Minted(address receiver, uint amount); + + /* Actual balances of token holders */ + mapping(address => uint) balances; + + /* approve() allowances */ + mapping (address => mapping (address => uint)) allowed; + + /* Interface declaration */ + function isToken() public constant returns (bool weAre) { + return true; + } + + function transfer(address _to, uint _value) returns (bool success) { + balances[msg.sender] = safeSub(balances[msg.sender], _value); + balances[_to] = safeAdd(balances[_to], _value); + Transfer(msg.sender, _to, _value); + return true; + } + + function transferFrom(address _from, address _to, uint _value) returns (bool success) { + uint _allowance = allowed[_from][msg.sender]; + + balances[_to] = safeAdd(balances[_to], _value); + balances[_from] = safeSub(balances[_from], _value); + allowed[_from][msg.sender] = safeSub(_allowance, _value); + Transfer(_from, _to, _value); + return true; + } + + function balanceOf(address _owner) constant returns (uint balance) { + return balances[_owner]; + } + + function approve(address _spender, uint _value) returns (bool success) { + + // To change the approve amount you first have to reduce the addresses` + // allowance to zero by calling `approve(_spender, 0)` if it is not + // already 0 to mitigate the race condition described here: + // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; + + allowed[msg.sender][_spender] = _value; + Approval(msg.sender, _spender, _value); + return true; + } + + function allowance(address _owner, address _spender) constant returns (uint remaining) { + return allowed[_owner][_spender]; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + +/** + * Upgrade agent interface inspired by Lunyr. + * + * Upgrade agent transfers tokens to a new contract. + * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. + */ +contract UpgradeAgent { + + uint public originalSupply; + + /** Interface marker */ + function isUpgradeAgent() public constant returns (bool) { + return true; + } + + function upgradeFrom(address _from, uint256 _value) public; + +} + + +/** + * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. + * + * First envisioned by Golem and Lunyr projects. + */ +contract UpgradeableToken is StandardToken { + + /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ + address public upgradeMaster; + + /** The next contract where the tokens will be migrated. */ + UpgradeAgent public upgradeAgent; + + /** How many tokens we have upgraded by now. */ + uint256 public totalUpgraded; + + /** + * Upgrade states. + * + * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun + * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet + * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet + * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens + * + */ + enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} + + /** + * Somebody has upgraded some of his tokens. + */ + event Upgrade(address indexed _from, address indexed _to, uint256 _value); + + /** + * New upgrade agent available. + */ + event UpgradeAgentSet(address agent); + + /** + * Do not allow construction without upgrade master set. + */ + function UpgradeableToken(address _upgradeMaster) { + upgradeMaster = _upgradeMaster; + } + + /** + * Allow the token holder to upgrade some of their tokens to a new contract. + */ + function upgrade(uint256 value) public { + + UpgradeState state = getUpgradeState(); + if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) { + // Called in a bad state + throw; + } + + // Validate input value. + if (value == 0) throw; + + balances[msg.sender] = safeSub(balances[msg.sender], value); + + // Take tokens out from circulation + totalSupply = safeSub(totalSupply, value); + totalUpgraded = safeAdd(totalUpgraded, value); + + // Upgrade agent reissues the tokens + upgradeAgent.upgradeFrom(msg.sender, value); + Upgrade(msg.sender, upgradeAgent, value); + } + + /** + * Set an upgrade agent that handles + */ + function setUpgradeAgent(address agent) external { + + if(!canUpgrade()) { + // The token is not yet in a state that we could think upgrading + throw; + } + + if (agent == 0x0) throw; + // Only a master can designate the next agent + if (msg.sender != upgradeMaster) throw; + // Upgrade has already begun for an agent + if (getUpgradeState() == UpgradeState.Upgrading) throw; + + upgradeAgent = UpgradeAgent(agent); + + // Bad interface + if(!upgradeAgent.isUpgradeAgent()) throw; + // Make sure that token supplies match in source and target + if (upgradeAgent.originalSupply() != totalSupply) throw; + + UpgradeAgentSet(upgradeAgent); + } + + /** + * Get the state of the token upgrade. + */ + function getUpgradeState() public constant returns(UpgradeState) { + if(!canUpgrade()) return UpgradeState.NotAllowed; + else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent; + else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade; + else return UpgradeState.Upgrading; + } + + /** + * Change the upgrade master. + * + * This allows us to set a new owner for the upgrade mechanism. + */ + function setUpgradeMaster(address master) public { + if (master == 0x0) throw; + if (msg.sender != upgradeMaster) throw; + upgradeMaster = master; + } + + /** + * Child contract can enable to provide the condition when the upgrade can begun. + */ + function canUpgrade() public constant returns(bool) { + return true; + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + +/** + * Define interface for releasing the token transfer after a successful crowdsale. + */ +contract ReleasableToken is ERC20, Ownable { + + /* The finalizer contract that allows unlift the transfer limits on this token */ + address public releaseAgent; + + /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ + bool public released = false; + + /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ + mapping (address => bool) public transferAgents; + + /** + * Limit token transfer until the crowdsale is over. + * + */ + modifier canTransfer(address _sender) { + + if(!released) { + if(!transferAgents[_sender]) { + throw; + } + } + + _; + } + + /** + * Set the contract that can call release and make the token transferable. + * + * Design choice. Allow reset the release agent to fix fat finger mistakes. + */ + function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { + + // We don't do interface check here as we might want to a normal wallet address to act as a release agent + releaseAgent = addr; + } + + /** + * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. + */ + function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { + transferAgents[addr] = state; + } + + /** + * One way function to release the tokens to the wild. + * + * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). + */ + function releaseTokenTransfer() public onlyReleaseAgent { + released = true; + } + + /** The function can be called only before or after the tokens have been releasesd */ + modifier inReleaseState(bool releaseState) { + if(releaseState != released) { + throw; + } + _; + } + + /** The function can be called only by a whitelisted release agent. */ + modifier onlyReleaseAgent() { + if(msg.sender != releaseAgent) { + throw; + } + _; + } + + function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { + // Call StandardToken.transfer() + return super.transfer(_to, _value); + } + + function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { + // Call StandardToken.transferForm() + return super.transferFrom(_from, _to, _value); + } + +} + +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + + + + + + + + +/** + * A token that can increase its supply by another contract. + * + * This allows uncapped crowdsale by dynamically increasing the supply when money pours in. + * Only mint agents, contracts whitelisted by owner, can mint new tokens. + * + */ +contract MintableTokenExt is StandardToken, Ownable { + + using SafeMathLibExt for uint; + + bool public mintingFinished = false; + + /** List of agents that are allowed to create new tokens */ + mapping (address => bool) public mintAgents; + + event MintingAgentChanged(address addr, bool state ); + + /** inPercentageUnit is percents of tokens multiplied to 10 up to percents decimals. + * For example, for reserved tokens in percents 2.54% + * inPercentageUnit = 254 + * inPercentageDecimals = 2 + */ + struct ReservedTokensData { + uint inTokens; + uint inPercentageUnit; + uint inPercentageDecimals; + } + + mapping (address => ReservedTokensData) public reservedTokensList; + address[] public reservedTokensDestinations; + uint public reservedTokensDestinationsLen = 0; + + function setReservedTokensList(address addr, uint inTokens, uint inPercentageUnit, uint inPercentageDecimals) onlyOwner { + reservedTokensDestinations.push(addr); + reservedTokensDestinationsLen++; + reservedTokensList[addr] = ReservedTokensData({inTokens:inTokens, inPercentageUnit:inPercentageUnit, inPercentageDecimals: inPercentageDecimals}); + } + + function getReservedTokensListValInTokens(address addr) constant returns (uint inTokens) { + return reservedTokensList[addr].inTokens; + } + + function getReservedTokensListValInPercentageUnit(address addr) constant returns (uint inPercentageUnit) { + return reservedTokensList[addr].inPercentageUnit; + } + + function getReservedTokensListValInPercentageDecimals(address addr) constant returns (uint inPercentageDecimals) { + return reservedTokensList[addr].inPercentageDecimals; + } + + function setReservedTokensListMultiple(address[] addrs, uint[] inTokens, uint[] inPercentageUnit, uint[] inPercentageDecimals) onlyOwner { + for (uint iterator = 0; iterator < addrs.length; iterator++) { + setReservedTokensList(addrs[iterator], inTokens[iterator], inPercentageUnit[iterator], inPercentageDecimals[iterator]); + } + } + + /** + * Create new tokens and allocate them to an address.. + * + * Only callably by a crowdsale contract (mint agent). + */ + function mint(address receiver, uint amount) onlyMintAgent canMint public { + totalSupply = totalSupply.plus(amount); + balances[receiver] = balances[receiver].plus(amount); + + // This will make the mint transaction apper in EtherScan.io + // We can remove this after there is a standardized minting event + Transfer(0, receiver, amount); + } + + /** + * Owner can allow a crowdsale contract to mint new tokens. + */ + function setMintAgent(address addr, bool state) onlyOwner canMint public { + mintAgents[addr] = state; + MintingAgentChanged(addr, state); + } + + modifier onlyMintAgent() { + // Only crowdsale contracts are allowed to mint new tokens + if(!mintAgents[msg.sender]) { + throw; + } + _; + } + + /** Make sure we are not done yet. */ + modifier canMint() { + if(mintingFinished) throw; + _; + } +} + + + +/** + * A crowdsaled token. + * + * An ERC-20 token designed specifically for crowdsales with investor protection and further development path. + * + * - The token transfer() is disabled until the crowdsale is over + * - The token contract gives an opt-in upgrade path to a new contract + * - The same token can be part of several crowdsales through approve() mechanism + * - The token can be capped (supply set in the constructor) or uncapped (crowdsale contract can mint new tokens) + * + */ +contract CrowdsaleTokenExt is ReleasableToken, MintableTokenExt, UpgradeableToken { + + /** Name and symbol were updated. */ + event UpdatedTokenInformation(string newName, string newSymbol); + + string public name; + + string public symbol; + + uint public decimals; + + /* Minimum ammount of tokens every buyer can buy. */ + uint public minCap; + + /** + * Construct the token. + * + * This token must be created through a team multisig wallet, so that it is owned by that wallet. + * + * @param _name Token name + * @param _symbol Token symbol - should be all caps + * @param _initialSupply How many tokens we start with + * @param _decimals Number of decimal places + * @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends. + */ + function CrowdsaleTokenExt(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable, uint _globalMinCap) + UpgradeableToken(msg.sender) { + + // Create any address, can be transferred + // to team multisig via changeOwner(), + // also remember to call setUpgradeMaster() + owner = msg.sender; + + name = _name; + symbol = _symbol; + + totalSupply = _initialSupply; + + decimals = _decimals; + + minCap = _globalMinCap; + + // Create initially all balance on the team multisig + balances[owner] = totalSupply; + + if(totalSupply > 0) { + Minted(owner, totalSupply); + } + + // No more new supply allowed after the token creation + if(!_mintable) { + mintingFinished = true; + if(totalSupply == 0) { + throw; // Cannot create a token without supply and no minting + } + } + } + + /** + * When token is released to be transferable, enforce no new tokens can be created. + */ + function releaseTokenTransfer() public onlyReleaseAgent { + mintingFinished = true; + super.releaseTokenTransfer(); + } + + /** + * Allow upgrade agent functionality kick in only if the crowdsale was success. + */ + function canUpgrade() public constant returns(bool) { + return released && super.canUpgrade(); + } + + /** + * Owner can update token information here. + * + * It is often useful to conceal the actual token association, until + * the token operations, like central issuance or reissuance have been completed. + * + * This function allows the token owner to rename the token after the operations + * have been completed and then point the audience to use the token contract. + */ + function setTokenInformation(string _name, string _symbol) onlyOwner { + name = _name; + symbol = _symbol; + + UpdatedTokenInformation(name, symbol); + } + +} + + +/** + * The default behavior for the crowdsale end. + * + * Unlock tokens. + */ +contract ReservedTokensFinalizeAgent is FinalizeAgent { + using SafeMathLibExt for uint; + CrowdsaleTokenExt public token; + CrowdsaleExt public crowdsale; + + function ReservedTokensFinalizeAgent(CrowdsaleTokenExt _token, CrowdsaleExt _crowdsale) { + token = _token; + crowdsale = _crowdsale; + } + + /** Check that we can release the token */ + function isSane() public constant returns (bool) { + return (token.releaseAgent() == address(this)); + } + + /** Called once by crowdsale finalize() if the sale was success. */ + function finalizeCrowdsale() public { + if(msg.sender != address(crowdsale)) { + throw; + } + + // How many % of tokens the founders and others get + uint tokensSold = crowdsale.tokensSold(); + + // move reserved tokens in percentage + for (var j = 0; j < token.reservedTokensDestinationsLen(); j++) { + uint allocatedBonusInPercentage; + uint percentsOfTokensUnit = token.getReservedTokensListValInPercentageUnit(token.reservedTokensDestinations(j)); + uint percentsOfTokensDecimals = token.getReservedTokensListValInPercentageDecimals(token.reservedTokensDestinations(j)); + if (percentsOfTokensUnit > 0) { + allocatedBonusInPercentage = tokensSold * percentsOfTokensUnit / 10**percentsOfTokensDecimals / 100; + tokensSold = tokensSold.plus(allocatedBonusInPercentage); + token.mint(token.reservedTokensDestinations(j), allocatedBonusInPercentage); + } + } + + // move reserved tokens in tokens + for (var i = 0; i < token.reservedTokensDestinationsLen(); i++) { + uint allocatedBonusInTokens = token.getReservedTokensListValInTokens(token.reservedTokensDestinations(i)); + if (allocatedBonusInTokens > 0) { + tokensSold = tokensSold.plus(allocatedBonusInTokens); + token.mint(token.reservedTokensDestinations(i), allocatedBonusInTokens); + } + } + + token.releaseTokenTransfer(); + } + +} diff --git a/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/010_ReservedTokensFinalizeAgent.txt b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/010_ReservedTokensFinalizeAgent.txt new file mode 100755 index 0000000..2db043f --- /dev/null +++ b/icowizard_Mainnet_0xa5F8fC0921880Cb7342368BD128eb8050442B1a1/010_ReservedTokensFinalizeAgent.txt @@ -0,0 +1,35 @@ +Token name: Block Array + +Token ticker: ARY + +Token decimals: 18 + +Multisig wallet address: 0x0239033Ef9384313a6eC6506Ae5B4A0af5c66A31 + +***************************** + +Crowdsale rate: 4731 + +Crowdsale start time: 2017-12-23T17:55 (GMT - 5) + +Crowdsale end time: 2018-01-14T18:00 (GMT - 5) + +Compiler Version: 0.4.11 + +Is optimization enabled?: true + +***************************** + +Finalize agent contract name: ReservedTokensFinalizeAgent + +Finalize agent contract address for Token Generation Event: 0x766e51c940B9656E34b91041ca8aFa00B7E9ED71 + +***************************** + +****Finalize agent contract ABI:**** + +[{"constant":false,"inputs":[],"name":"finalizeCrowdsale","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isFinalizeAgent","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isSane","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"crowdsale","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_crowdsale","type":"address"}],"payable":false,"type":"constructor"}] + +****Finalize agent contract ABI encoded constructor arguments for Token Generation Event:**** + +000000000000000000000000a5f8fc0921880cb7342368bd128eb8050442b1a10000000000000000000000003d5fb1e9d2f15d9ae5d7f4af4825fdef03de9685 \ No newline at end of file