sirin-labs
crowdsale-smart-contract
JavaScript

No description available.

Last updated Dec 9, 2025
45
Stars
38
Forks
0
Issues
0
Stars/day
Attention Score
40
Language breakdown
No language data available.
Files click to expand
README

SIRIN LABS' Crowdsale Contracts

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

SirinLabs Token

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

Overview

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.

Contracts

Please see the contracts/ directory.

The Crowdsale Specification

* SRN token is ERC-20 compliant. * SRN Token is [Bancor][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.

SRN PRICING PROGRAM

| 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.

Develop

  • Contracts are written in [Solidity][solidity] and tested using [Truffle][truffle] and [testrpc][testrpc].
  • Our smart contract is based on [Open Zeppelin][openzeppelin] smart contracts [v1.3.0][openzeppelin_v1.3.0] (latest OZ commit merged is 8e01dd14f9211239213ae7bd4c6af92dd18d4ab7 from 24.10.2017).
  • SRN token is a SmartToken, implementing Bancor's SmartToken contract.

Audit

The contract was audited by several Ethereum blockchain experts.

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

  • [Matthew di Ferrante][mattdf] and [Dean Eigenmann][decnus], well-known Ethereum experts who have provided auditing services for many other token sale contracts.
The audit report is available here: https://github.com/sirin-labs/crowdsale-smart-contract/blob/master/audit/sirin-audit.pdf
  • [Leonid Beder][leonid], a renowned external security expert.
  • [Bokky Poobah][bokk], a well-known cybersecurity auditor that provides auditing services for Ethereum based projects.
The audit report is available here: https://github.com/bokkypoobah/SirinLabsCrowdsaleContractAudit/tree/master/bokkyAudit

Code

Class Diagram

Class Diagram

SirinCrowdsale Functions

getRate

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.

getTotalFundsRaised

function getTotalFundsRaised() public view returns (uint256)
Returns the total funds collected in wei(ETH and none ETH).

addUpdateGrantee

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.

isActive

function isActive() public view returns (bool)
Return true if the crowdsale is active, hence users can buy tokens

deleteGrantee

function deleteGrantee(address _grantee) external onlyOwner onlyWhileSale
Deletes entries from the grants list.

setFiatRaisedConvertedToWei

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.

claimTokenOwnership

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.

claimRefundVaultOwnership

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.

buyTokensWithGuarantee

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

GrantAdded

event GrantAdded(address indexed grantee, uint256 amount);

GrantUpdated

event GrantUpdated(address indexed grantee, uint256 oldAmount, uint256 _newAmount);

GrantDeleted

event GrantDeleted(address indexed grantee, uint256 hadAmount);

FiatRaisedUpdated

event FiatRaisedUpdated(address indexed address, uint256 fiatRaised)

TokenPurchaseWithGuarantee

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

RefundVault Functions

deposit

function deposit(address investor, uint256 tokensAmount) onlyOwner public payable
Adds Investor tokens and ETH to the vault.

close

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.

enableRefunds

function enableRefunds() onlyOwner public
Start the refunding. Should be called after the crowdsale.

refundETH

function refundETH(uint256 ETHToRefundAmountWei) isInRefundTimeFrame isRefundingState public
Refund ETH back to the investor in return of proportional amount of SRN back to Sirin wallet.

claimTokens

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.

claimAllTokens

function claimAllTokens() public
Investors can claim all remaining tokens from the vault.

RefundVault Events

Active

event Active();

Deposit

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

Closed

event Closed();

RefundsEnabled

event RefundsEnabled();

RefundedETH

event RefundedETH(address indexed beneficiary, uint256 weiAmount);

TokensClaimed

event TokensClaimed(address indexed beneficiary, uint256 weiAmount);

SirinVestingTrustee Functions

Vesting trustee contract for Sirin Labs token.

grant

function grant(address to, uint256 value, uint256 start, uint256 cliff, uint256 end, bool revokable)     public onlyOwner
Grant tokens to a specified address.

revoke

function revoke(address _holder) public onlyOwner
Revoke the grant of tokens of a specifed address.

vestedTokens

function vestedTokens(address holder, uint256 time) public constant returns (uint256)
Calculate the total amount of vested tokens of a holder at a given time.

unlockVestedTokens

function unlockVestedTokens() public
Unlock vested tokens and transfer them to their holder.

SirinVestingTrustee Events

NewGrant

event NewGrant(address indexed from, address indexed to, uint256 _value);

UnlockGrant

event UnlockGrant(address indexed holder, uint256 value);

RevokeGrant

event RevokeGrant(address indexed holder, uint256 refund);

Dependencies

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

Install local node dependencies:

$ npm install

Test

$ ./scripts/test.sh

Code Coverage

$ ./scripts/coverage.sh

Collaborators

License

Apache License v2.0

[sirinlabs]: https://www.sirinlabs.com [ethereum]: https://www.ethereum.org/

[solidity]: https://solidity.readthedocs.io/en/develop/ [truffle]: http://truffleframework.com/ [testrpc]: https://github.com/ethereumjs/testrpc [bancor]: https://github.com/bancorprotocol/contracts [openzeppelin]: https://openzeppelin.org [openzeppelin_v1.3.0]: https://github.com/OpenZeppelin/zeppelin-solidity/releases/tag/v1.3.0 [mattdf]: http://github.com/mattdf [decnus]: http://github.com/decanus [leonid]: https://www.linkedin.com/in/leonidb/ [bokk]: https://github.com/bokkypoobah/

© 2026 GitRepoTrend · sirin-labs/crowdsale-smart-contract · Updated daily from GitHub