Skip to content

katmai/crowdsale-smart-contract

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

Audit

The contract was audited by several Ethereum blockchain experts.

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

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 72.7%
  • Solidity 25.4%
  • Shell 1.9%