Skip to content

Smart Contracts

Rafael Vidaurre edited this page Sep 27, 2018 · 23 revisions

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 it is only documenting the methods and properties that are used by the Front-End

Contracts

PolyToken

The smart contract for the POLY token. It implements the ERC20 interface along with other methods.

Methods

allowance

ERC20 Gets the amount of tokens owner is allowing spender to spend on their behalf. See approve()

(owner: Address, spender: Address) => allowance: Number

balanceOf

ERC20 Gets the amount of tokens owner has in their account

(owner: Address) => balance: Number

transfer

ERC20 Transfers amount of tokens from the address who called the method to to

(to: Address, amount: Number) => Success: boolean

approve

ERC20 Sets the amount of tokens the message sender allows spender to spend on their behalf

(spender: Address, amount: Number) => Success: boolean

Events

Transfer

When transfer() or transferFrom() are executed

Values:

  • from:Address
  • to:Address

Approval

When an owner sets an allowance for a spender

Values:

  • owner:Address
  • spender:Address
  • value:Number: Amount of tokens allowed

Unused but worth mentioning methods

  • increaseApproval
  • decreaseApproval
Clone this wiki locally