LOCIcoin Token and Sale contracts
Clone or download



In the interests of public disclosure and security, we're pleased to present the LOCIcoin token and crowdsale contracts.



John Wise     - CEO 
Brian Hwang   - Director of Operations
Eric Ross     - Director of Technology
Klajdi Ciraku - Community Management 
Adam Paigge   - Public Relations
Dan Emmons    - Blockchain Development

Telegram link: https://t.me/Loci_InnVenn

Twitter link: http://www.twitter.com/loci_io

Please visit our websites: https://locipro.com and https://locipro.com/innvenn/

Token sale details: https://locipro.com/token-sale/

Token Schedule: http://www.tokenschedule.com/loci-coin/

Whitepaper: https://locipro.com/whitepaper

Bounty program: https://bitcointalk.org/index.php?topic=2161880.msg21647125#msg21647125

Loci Official Telegram Group for Loci Website https://locipro.com/


Please see the contracts/ directory.

Bounty Program

We want your input! If you have any comments or concerns regarding this code, please contact the administration of the LOCIcoin bounty program for participation details and instructions.


There are two primary contracts: LOCIcoin.sol (ERC-20 compliant token) and LOCIsale.sol (the crowdsale contract). Additionally, there is a simple shared interface defined in IRefundHandler.sol that allows LOCIcoin and LOCIsale to communicate refund requests and exchange wei contributions for received tokens. This refund mechanism will be triggered in the event that our sale goals are not met.

After the initial LOCIcoin sale, it might be necessary to issue adjustments to crowd sale participants, or to issue bonus tokens based on referrals, for example. We have constructed the LOCIairdropper.sol smart contract to make it easy to distribute bulk token transfers in far fewer calls than one-at-a-time usage of the LOCIcoin.sol contract.

LOCIcoin https://etherscan.io/address/0x9c23d67aea7b95d80942e3836bcdf7e708a747c2

Deriving from OpenZeppelin's ERC-20 compliant base contracts, LOCIcoin has the same core functionality the Ethereum ecosystem has come to expect, with minor modifications:

  1. Upon initial deployment, the token has no symbol or name set; it is set via ownerSetVisible()
  2. Token transfers are disabled until after the crowdsales are successfully completed, at which point the token will be 'activated' via ownerActivateToken()
  3. To ensure that contributors receive their tokens during the sale, the ability to ownerSetOverride() addresses has been added (allows override addresses to use transfer())
  4. In the event that refunds are enabled in the sale contract, token holders can exchange their tokens for ether by calling the claimRefund() method

LOCIsale https://etherscan.io/address/0x5401bb4729bd7f025b97399c3c92854ec299f81a

While not directly deriving from existing crowdsale contracts, LOCIsale is based on the simplest combination of OpenZeppelin code, other successful crowdsale contracts, best practices, as well as security considerations. LOCIsale functionality includes:

  1. Flexible deployment options allows multiple sale scenarios (presale + primary ICO)
  2. Time-based tranche discounting
  3. Minimum ether goal restriction (optional)
  4. Minimum and maximum individual contribution restrictions
  5. Emergency break/pause functionality
  6. Ability to enable refunds (in the case where minimum ether goal was not met)
  7. Ability to transfer wei to beneficiary (after sale end and if optional min goal has been met)
  8. Ability to recover (transfer) unsold tokens
  9. Contributions via contract default/fallback function for user simplicity
  10. Ability to change the peg price of ether to USD during the course of the sale to account for volatile markets.
  11. Ability to change the reserved number of tokens for the sale in the event of off-chain purchases.

LOCIairdropper https://etherscan.io/address/0xe5cff4de133f7c23898ce49dad5a3715f507d85d

This contract allows for the efficient administration of token distribution post-sale. Sufficient gas should be supplied.

  1. Ability to pass in 2 lists: a) Ethereum addresses and b) Token distribution amounts in wei.
  2. When all transfers are complete, an Event is fired with the number of addresses that received AirDroppedTokens.


Contracts are written in Solidity and tested using Truffle and testrpc. ERC20-related and other base contracts sourced from OpenZeppelin.org.


# Install Truffle, testrpc, and dependency packages:
$ npm install


# Initialize a testrpc instance in one terminal tab
$ node_modules/.bin/testrpc

# This will run the contract tests using truffle
$ node_modules/.bin/truffle test

Note that there is an outstanding testrpc issue which, until fixed and released, will cause some tests to fail; it is related to the testrpc evm_increaseTime operation and its interaction with testrpc snapshot/revert behaviour. A custom testrpc build can be made that addresses this problem in the meantime.

patch node_modules/ethereumjs-testrpc/build/cli.node.js testrpc-time.patch

Deploy to destination: development, ropsten, or live

$ truffle migrate --network <destination>

secrets.js file - you will have to supply your own. sample format below.

var mnemonic = "some random selection of twelve words that you can use for metamask";
var infuraKey = "aaaaaaaaaaaaaaaaaaa"; // get this from infura
var accountPK = "your account primary key";
var mainnetPK = accountPK;
var ropstenPK = accountPK;

module.exports = {mnemonic: mnemonic, infuraKey: infuraKey, mainnetPK: mainnetPK, ropstenPK:ropstenPK};

Alternative Build

For easy deployment via Mist, simply concatenate all contracts using solidity_flattener.

solidity_flattener --solc-paths "zeppelin-solidity=<absolute path to your files>/node_modules/zeppelin-solidity" contracts/LOCIcoin.sol > UnifiedLOCIcoin.sol
solidity_flattener --solc-paths "zeppelin-solidity=<absolute path to your files>/node_modules/zeppelin-solidity" contracts/LOCIsale.sol > UnifiedLOCIsale.sol

Use the concatenated contracts in these 'unified' .sol files to deploy in Mist. Note that these 'unified' files are also useful when verifying your contract on Etherscan.io.