-
Notifications
You must be signed in to change notification settings - Fork 16
Smart Contracts
The following document describes the smart contracts the Front-End interacts with and how those interactions work.
Note (Sept, 2018): At this point in time this document is only describing the methods and properties that are used by the Front-End
TODO: Explain types from-to JS
The following properties and methods are available in every contract
Contract PolyToken {
name: String = 'Polymath' // Name of the token
symbol: String = 'POLY' // Symbol of the token
decimals: Uint8 = 18 // Number of decimals the token supports (TODO: Confirm)
// Gets the amount of tokens `owner` is allowing `spender` to spend on their behalf
allowance(owner: Address, spender: Address): Number
// Gets the amount of tokens `owner` has in their account
balanceOf(owner: Address): Number
// Transfers `amount` of tokens from the address who called the method to `to`
transfer(_to: Address, _value: Uint256): Boolean
// Sets the `amount` of tokens the message sender allows `spender` to spend on their behalf
approve(_spender: Address, _value: Uint256): Boolean
}
// When a transfer from one address to another is executed
Event Transfer {
from: Address
to: Address
value: Uint256
}
// When an address approves an allowance
Event Approval {
owner: Address
spender: Address
value: Uint256
}
Saves information about ticker reservations. It allows users to reserve their ticker symbols before actually generating their security token
Returns the fee in POLY
that is required to reserve a ticker
registrationFee() => fee:Number
Reserves a ticker to owner
. Requires allowance
of at least the registration fee in POLY
to be approved. See approve() and allowance()
registerTicker(owner:Address, symbol:String, tokenName:String, swarmHash:String) => void
Emits:
Returns the owner and timestamp for a given symbol (ticker)
getDetails(symbol:String) => [address:String, timestamp:Number, tokenName:String, swarmHash:String, status:Boolean]
When a ticker gets registered
Values:
_owner:Address
_symbol:String
_name:String
_swarmHash:String
_timestamp:Number
- isReserved