Skip to content

Proof Official Helper Modules for interacting with truffle JS contract objects

License

Notifications You must be signed in to change notification settings

ProofSuite/truffle-contract-lib.js

Repository files navigation

Proof helper library for interacting with truffle contract objects.

Useful for scripts and tests within the truffle environment

API Reference

Modules

token-sale-helpers

Token Sale Helpers Module

token-helpers

Token helpers module

pausable-helpers

Pausable helpers module

ownership-helpers

Ownership helpers module

token-sale-helpers

Token Sale Helpers Module

getWallet ⇒ String

Returns wallet address for input token sale contract

Kind: Exported member
Returns: String - wallet

Param Type Description
tokenSale Object Truffle Contract Object

getToken ⇒ String

Returns token address for input token sale contract

Kind: Exported member
Returns: String - token

Param Type Description
tokenSale Object Truffle Contract Object

getPresaleToken ⇒ String

Returns presale token for input token sale contract

Kind: Exported member
Returns: String - token

Param Type Description
tokenSale Object Truffle Contract Object

getCap ⇒ String

Returns cap for input token sale contract

Kind: Exported member
Returns: String - token sale cap

Param Type Description
tokenSale Object Truffle Contract Object

getPriceInWei ⇒ String

Returns the price in wei of one token sold by the input token sale contract

Kind: Exported member
Returns: String - token price in wei

Param Type Description
tokenSale Object Truffle Contract Object

buyTokens ⇒ Object

Performs an token order from sender to the input token sale contract

Kind: Exported member
Returns: Object - txnReceipt - Transaction receipt

Param Type Description
tokenSale Object Truffle Contract Object corresponding to token sale contract
sender String Ethereum address from which ether is being sent
value Number Value to be send to the contract

tokenPriceInWei ⇒ Number

Returns the token price in wei

Kind: Exported member
Returns: Number - token price in wei

Param Type Description
tokenSale Object Truffle Contract Object

tokenPrice ⇒ Number

Returns the token price

Kind: Exported member
Returns: Number - token price in ether

Param Type Description
tokenSale Object Truffle Contract Object

numberOfTokensFor ⇒ Number

Returns number of tokens for a certain amount of ether sent to a token sale contract

Kind: Exported member
Returns: Number - number of tokens

Param Type Description
tokenSale Object Truffle Contract Object
weiAmount Number

token-helpers

Token helpers module

token-helpers~getOwner ⇒

Get owner of token contract

Kind: inner property of token-helpers
Returns: owner

Param
token

token-helpers~getTotalSupply ⇒

Get total supply of token contract

Kind: inner property of token-helpers
Returns: total supply

Param
token

token-helpers~getTokenBalance ⇒

Get token balance of owner

Kind: inner property of token-helpers
Returns: token balance

Param
token
owner

token-helpers~transferToken ⇒

Transfer amount of token from sender to receiver

Kind: inner property of token-helpers
Returns: transaction receipt

Param
token
sender
receiver
amount

token-helpers~transferTokens ⇒

Transfer amount of each token in the tokens array from sender to receiver

Kind: inner property of token-helpers
Returns: transaction receipts

Param
token
sender
receiver
amount

token-helpers~mintToken ⇒

Mint amount of token for the receiver. Only works if minter is the owner of the token

Kind: inner property of token-helpers
Returns: transaction receipt

Param
contract
minter
receiver
amount

token-helpers~finishMinting ⇒

Finish minting period for the token contract. Only works if sender is the owner of the token

Kind: inner property of token-helpers
Returns: transaction receipt

Param
token
sender

token-helpers~baseUnits ⇒

Convert ERC20 units (=number of base units times 10^decimals) to base units

Kind: inner property of token-helpers
Returns: base units

Param
token
amount

token-helpers~ERC20Units ⇒

Convert base units (=number of ERC20 units divided by 10^decimals) to ERC20 units

Kind: inner property of token-helpers
Returns: ERC20 units

Param
token
amount

token-helpers~claimTokens ⇒

Allocates (presale) tokens to the sender

Kind: inner property of token-helpers
Returns: transaction receipt

Param
token
sender

token-helpers~importBalances ⇒

Import presale tokens to the token sale contract

Kind: inner property of token-helpers
Returns: transaction receipt

Param
token
addresses
balances

pausable-helpers

Pausable helpers module

pausable-helpers~pause

Pause the contract and wait until the transaction is mined

Kind: inner property of pausable-helpers

Param Description
contract Token truffle contract
owner Ethereum Address

pausable-helpers~unpause

Unpause contract and wait until the transaction is mined

Kind: inner property of pausable-helpers

Param Description
contract Token Truffle Contract
owner Ethereum Address

ownership-helpers

Ownership helpers module

ownership-helpers~transferOwnership ⇒ Object

Transfer ownership of input contract and wait until corresponding transaction is mined

Kind: inner property of ownership-helpers
Returns: Object - transaction receipt

Param Type Description
contract Object Truffle Contract Object
sender String
receiver String

ownership-helpers~transferOwnerships

Transfer the ownerships of input contracts and wait until corresponding transactions are mined

Kind: inner property of ownership-helpers

Param Type Description
contracts Object Truffle Object Contract Array
sender String
receiver String

ownership-helpers~lockOwnership ⇒ Object

Lock ownership of input contract and wait until corresponding transaction is mined

Kind: inner property of ownership-helpers
Returns: Object - Transaction Receipt

Param Type Description
contract Object Truffle Object Contract Array
owner String -

About

Proof Official Helper Modules for interacting with truffle JS contract objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published