STO module for private presales (PreSaleSTO.sol)

View Source: contracts/modules/STO/PreSale/PreSaleSTO.solโ€‹

โ†— Extends: PreSaleSTOStorage, STOโ€‹

PreSaleSTO

Events

event TokensAllocated(address _investor, uint256 _amount);

Functions

Constructor

function (address _securityToken, address _polyToken) public nonpayable Module

Arguments

Name

Type

Description

_securityToken

address

Address of the security token

_polyToken

address

โ€‹

configure

Function used to initialize the different variables

function configure(uint256 _endTime) public nonpayable onlyFactory

Arguments

Name

Type

Description

_endTime

uint256

Unix timestamp at which offering ends

getInitFunction

โคพ overrides IModule.getInitFunctionโ€‹

This function returns the signature of the configure function

function getInitFunction() public pure
returns(bytes4)

Arguments

Name

Type

Description

getNumberInvestors

Returns the total no. of investors

function getNumberInvestors() public view
returns(uint256)

Arguments

Name

Type

Description

getTokensSold

โคพ overrides STO.getTokensSoldโ€‹

Returns the total no. of tokens sold

function getTokensSold() external view
returns(uint256)

Arguments

Name

Type

Description

getPermissions

โคพ overrides IModule.getPermissionsโ€‹

Returns the permissions flag that are associated with STO

function getPermissions() public view
returns(bytes32[])

Arguments

Name

Type

Description

allocateTokens

Function used to allocate tokens to the investor

function allocateTokens(address _investor, uint256 _amount, uint256 _etherContributed, uint256 _polyContributed) public nonpayable withPerm

Arguments

Name

Type

Description

_investor

address

Address of the investor

_amount

uint256

No. of tokens to be transferred to the investor

_etherContributed

uint256

How much ETH was contributed

_polyContributed

uint256

How much POLY was contributed

allocateTokensMulti

Function used to allocate tokens to multiple investors

function allocateTokensMulti(address[] _investors, uint256[] _amounts, uint256[] _etherContributed, uint256[] _polyContributed) public nonpayable withPerm

Arguments

Name

Type

Description

_investors

address[]

Array of address of the investors

_amounts

uint256[]

Array of no. of tokens to be transferred to the investors

_etherContributed

uint256[]

Array of amount of ETH contributed by each investor

_polyContributed

uint256[]

Array of amount of POLY contributed by each investor