Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

SIRIN LABS' Crowdsale Contracts

Please see below Sirin Labs smart contracts' for the Sirin Crowdsale.

SirinLabs Token

SRN is an ERC-20 compliant cryptocurrency built on top of the Ethereum blockchain.


SIRIN LABS - the developer of SOLARIN, the ultra-secure smartphone - is holding a crowdsale event. Funds raised will support the development of FINNEY, the first open source smartphone and all-in-one PC built for the blockchain era. Customers will be able to purchase all SIRIN LABS products (SOLARIN and FINNEY) with SIRIN LABS token, the SRN.


Please see the contracts/ directory.

The Crowdsale Specification

  • SRN token is ERC-20 compliant.
  • SRN Token is Bancor compliant.
  • Token allocation:
    • 40% of the total number of SRN tokens will be allocated to contributors during the token sale.
    • 10% of the total number of SRN tokens will be allocated to the team.
    • 10% of the total number of SRN tokens will be allocated to OEMs, Operating System implementation, SDK developers and rebate of sold devices.
    • 5% of the total number of SRN tokens will be allocated to professional fees and bounties.
    • 35% of the total number of SRN tokens will be allocated to SIRIN LABS, to be used for future strategic plans and to develop the SIRIN LABS' ecosystem.


Duration from token Crowdsale event start SRN / ETH
First 24 hours 1000
2nd day 950
3rd day 900
4th day 855
5th day 810
6th day 770
7th day 730
8th day 690
9th day 650
10th day 615
11th day 580
12th day 550
13th day 525
14th day 500

Refund Route - SRN tokens with guarantee

Investors can choose to buy SRN tokens with guarantee.

refund route rates are 50% of the regular rate (starting from 500 SRNs for 1 ETH at the first day and ending at 250 SRNs for 1 ETH at the last day of the crowd sale).

SRN tokens and the ETH funds are deposited to a RefundVault contract owned by the SirinCrowdsale contract.

Investors bought SRNs on the refund route can get refund of their ETH or claim their SRN tokens only after the crowd sale ends.

Refund ETH period is limited to 60 days after the crowd sale ends. SRN token claim is not limited in time.

Any of the actions (refund ETH and SRN token claim) can be executed by the investor directly on the RefundVault contract.

Any of the actions (refund ETH and SRN token claim) can be done on parts of the amount.

  • In case of refund ETH, the proportional amount of SRN tokens will be burned.
  • In case of SRN token claim, the proportional amount of ETH will be transferred to Sirin ETH Wallet.
  • In Case of partial action the remaining ETH and SRN tokens will be available to more refund or claim actions according to the refund period and updated amounts.


  • Contracts are written in Solidity and tested using Truffle and testrpc.

  • Our smart contract is based on Open Zeppelin smart contracts v1.3.0 (latest OZ commit merged is 8e01dd14f9211239213ae7bd4c6af92dd18d4ab7 from 24.10.2017).

  • SRN token is a SmartToken, implementing Bancor's SmartToken contract.


The contract was audited by several Ethereum blockchain experts.

No potential vulnerabilities have been identified in the crowdsale and token contract.


Class Diagram

Class Diagram

SirinCrowdsale Functions


function getRate() public view returns (uint256)

Returns the rate in SRN per 1 ETH according to the time of the tx and the SRN pricing program.


function getTotalFundsRaised() public view returns (uint256)

Returns the total funds collected in wei(ETH and none ETH).


function addUpdateGrantee(address _grantee, uint256 _value) external onlyOwner onlyWhileSale

Adds/Updates address and token allocation for token grants.

Granted tokens are allocated to non-ether, presale, buyers.


function isActive() public view returns (bool)

Return true if the crowdsale is active, hence users can buy tokens


function deleteGrantee(address _grantee) external onlyOwner onlyWhileSale

Deletes entries from the grants list.


function setFiatRaisedConvertedToWei(uint256 _fiatRaisedConvertedToWei) external onlyOwner onlyWhileSale

Sets funds collected outside the crowdsale in wei. funds are converted to wei using the market conversion rate of USD\ETH on the day on the purchase.


function claimTokenOwnership() external onlyOwner

Accepts new ownership on behalf of the SirinCrowdsale contract. This can be used, by the token sale contract itself to claim back ownership of the SirinSmartToken contract.


function claimRefundVaultOwnership() external onlyOwner

Accepts new ownership on behalf of the SirinCrowdsale contract. This can be used, by the token sale contract itself to claim back ownership of the refundVault contract.


function buyTokensWithGuarantee() public payable

Buy tokes with guarantee, these tokens and the ETH are saved in refundVault, so investor can refund them up to 60 days after the crowdsale ends.

SirinCrowdsale Events


event GrantAdded(address indexed _grantee, uint256 _amount);


event GrantUpdated(address indexed _grantee, uint256 _oldAmount, uint256 _newAmount);


event GrantDeleted(address indexed _grantee, uint256 _hadAmount);


event FiatRaisedUpdated(address indexed _address, uint256 _fiatRaised)


event TokenPurchaseWithGuarantee(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);

RefundVault Functions


function deposit(address investor, uint256 tokensAmount) onlyOwner public payable

Adds Investor tokens and ETH to the vault.


function close() onlyOwner public

Closes the refunds, all ETH is transfered to Sirin ETH wallet. After this function is called investors cannot refund their ETH anymore but can claim their tokens.


function enableRefunds() onlyOwner public

Start the refunding. Should be called after the crowdsale.


function refundETH(uint256 ETHToRefundAmountWei) isInRefundTimeFrame isRefundingState public

Refund ETH back to the investor in return of proportional amount of SRN back to Sirin wallet.


function claimTokens(address investor, uint256 tokensToClaim) isRefundingOrCloseState public

Transfer tokens from the vault to the investor while transferring proportional amount of ETH to Sirin ETH wallet.

Can be triggered by the investor only.


function claimAllTokens() public

Investors can claim all remaining tokens from the vault.

RefundVault Events


event Active();


event Deposit(address indexed beneficiary, uint256 etherWeiAmount, uint256 tokenWeiAmount);


event Closed();


event RefundsEnabled();


event RefundedETH(address indexed beneficiary, uint256 weiAmount);


event TokensClaimed(address indexed beneficiary, uint256 weiAmount);

SirinVestingTrustee Functions

Vesting trustee contract for Sirin Labs token.


function grant(address _to, uint256 _value, uint256 _start, uint256 _cliff, uint256 _end, bool _revokable)
    public onlyOwner 

Grant tokens to a specified address.


function revoke(address _holder) public onlyOwner

Revoke the grant of tokens of a specifed address.


 function vestedTokens(address _holder, uint256 _time) public constant returns (uint256)

Calculate the total amount of vested tokens of a holder at a given time.


 function unlockVestedTokens() public 

Unlock vested tokens and transfer them to their holder.

SirinVestingTrustee Events


event NewGrant(address indexed _from, address indexed _to, uint256 _value);


event UnlockGrant(address indexed _holder, uint256 _value);


event RevokeGrant(address indexed _holder, uint256 _refund);


# Install Truffle and testrpc packages globally:
$ npm install -g truffle ethereumjs-testrpc

# Install local node dependencies:
$ npm install


$ ./scripts/

Code Coverage

$ ./scripts/



Apache License v2.0


No description or website provided.




No releases published


No packages published
You can’t perform that action at this time.