ERC20-Ether exchange contract.
/contracts/exchange/Exchange.sol

event

Error 9cf38cf2

inputs0addressexchange
inputs1uint256errorCode
event

ExchangeActiveChanged f7477d39

inputs0addressexchange
inputs1boolisActive
inputs2addressby
event

ExchangeBuy 666f2a1e

inputs0addressexchange
inputs1addresswho
inputs2uint256token
inputs3uint256eth
event

ExchangeFeeUpdated 8de091a3

inputs0addressexchange
inputs1addressrewards
inputs2uint256feeValue
inputs3addressby
event

ExchangePricesUpdated 1c12d27d

inputs0addressexchange
inputs1uint256buyPrice
inputs2uint256sellPrice
inputs3boolusePriceTicker
inputs4addressby
event

ExchangeReceivedEther 64421356

inputs0addressexchange
inputs1addresssender
inputs2uint256amount
event

ExchangeSell 9396518c

inputs0addressexchange
inputs1addresswho
inputs2uint256token
inputs3uint256eth
event

ExchangeWithdrawEther e44fa178

inputs0addressexchange
inputs1addressrecipient
inputs2uint256amount
inputs3addressby
event

ExchangeWithdrawTokens 33a424bf

inputs0addressexchange
inputs1addressrecipient
inputs2uint256amount
inputs3addressby
fallback, payable

Exchange

function, constant

asset 38d52e0f

function, constant

assetBalance c66f2455

Returns ERC20 balance of an exchange

outputs0uint256
function, payable

buy d6febde8

Buy tokens for ether at specified price. Payment needs to be sent along with the call, and should equal amount * price. Price should be greater than or equal to current exchange sellPrice.

inputs0uint256_amount

amount of tokens to buy.

inputs1uint256_price

price in wei at which buy will happen.

outputs0uint256
function, constant

buyPrice 8620410b

Returns the buy price

outputs0uint256
function

changeContractOwnership 557f4bc9

Prepares ownership pass. * Can only be called by current owner.

inputs0address_to

address of the next owner. 0x0 is not allowed.

outputs0bool
function

claimContractOwnership 4592cd1d

Finalize ownership pass. * Can only be called by pending owner.

outputs0bool
function, constant

contractOwner ce606ee0

function

destroy 83197ef0

Use kill() instead of destroy() to prevent accidental ether/ERC20 loosing

function

emitActiveChanged db3dccc0

inputs0bool_isActive
inputs1address_by
function

emitBuy 4e3f0a01

inputs0address_who
inputs1uint256_token
inputs2uint256_eth
function

emitError df26ca08

inputs0uint256_errorCode
function

emitFeeUpdated 808700f5

inputs0address_rewards
inputs1uint256_feePercent
inputs2address_by
function

emitPricesUpdated 4f701e54

inputs0uint256_buyPrice
inputs1uint256_sellPrice
inputs2bool_usePriceTicker
inputs3address_by
function

emitReceivedEther c81e7908

inputs0address_sender
inputs1uint256_amount
function

emitSell 88ae3c6b

inputs0address_who
inputs1uint256_token
inputs2uint256_eth
function

emitWithdrawEther c1538d45

inputs0address_recipient
inputs1uint256_amount
inputs2address_by
function

emitWithdrawTokens a64abab9

inputs0address_recipient
inputs1uint256_amount
inputs2address_by
function, constant

feePercent 7fd6f15c

function, constant

getEventsHistory fff10aba

function, constant

getPriceTickerPrice 20743e00

Returns price fetched from external price ticker

function, constant

getTokenSymbol f1850af8

Returns symbol of the asset

outputs0bytes32
function

grantAuthorized 94f3ed31

Authorizes given address to execute restricted methods.

Can be called only by contract owner.

inputs0address_authorized
outputs0uint256
function

init 46639dba

Assigns ERC20 token for exchange. /// Can be set only once, and only by contract owner.

inputs0address_contractsManager
inputs1address_asset

ERC20 token address.

inputs2address_rewards
inputs3uint256_fee
outputs0uint256errorCode
function, constant

isActive 22f3e2d4

function, constant

isAuthorized fe9fbb80

Tells whether given address is authorized or not

inputs0address_authorized
outputs0bool
function

kill 41c0e1b5

Kills an exchnage contract. /// Checks balances of an exchange before destroying. Destroys an exchange only if balances are empty.

outputs0uint256errorCode
function, constant

pendingContractOwner 5aa77d3c

function

revokeAuthorized 3f48be2d

Revokes granted access rights.

Can be called only by contract owner.

inputs0address_authorized
outputs0uint256
function, constant

rewards 9ec5a894

function

sell d79875eb

Sell tokens for ether at specified price. Tokens are taken from caller though an allowance logic. Amount should be less than or equal to current allowance value. Price should be less than or equal to current exchange buyPrice.

inputs0uint256_amount

amount of tokens to sell.

inputs1uint256_price

price in wei at which sell will happen.

outputs0uint256
function, constant

sellPrice 4b750334

Returns the sell price

outputs0uint256
function

setActive acec338a

Exchange must be activated before using. /// Note: An exchange is not activated by default after init(). Make sure that prices are valid before activation.

inputs0bool_active
outputs0uint256
function

setPrices 935bb767

Set exchange operation prices. Sell price cannot be less than buy price. /// Can be set only by contract owner.

inputs0uint256_buyPrice

price in wei at which exchange buys tokens or but price coeff if price ticker is enabled

inputs1uint256_sellPrice

price in wei at which exchange sells tokens. or sell price coeff if price ticker is enabled

inputs2bool_usePriceTicker

force use prices from external price ticker

outputs0uint256
function

transferContractOwnership a843c51f

Direct ownership pass without change/claim pattern. Can be invoked only by current contract owner

inputs0address_to

the next contract owner

outputs0bool
function, constant

usePriceTicker b0a31465

function

withdrawAll fa09e630

Transfer all tokens and wei from exchange to specified address. /// Can be called only by contract owner.

inputs0address_recipient

address to transfer tokens and wei to.

outputs0uint256result
function

withdrawAllEth d46d79bb

Transfer all wei from exchange to specified address. /// Can be called only by contract owner.

inputs0address_recipient

address to transfer wei to.

outputs0uint256
function

withdrawAllTokens a878aee6

Transfer all tokens from exchange to specified address. /// Can be called only by contract owner.

inputs0address_recipient

address to transfer tokens to.

outputs0uint256
function

withdrawEth 1b9a91a4

Transfer specified amount of wei from exchange to specified address. /// Can be called only by contract owner.

inputs0address_recipient

address to transfer wei to.

inputs1uint256_amount

amount of wei to transfer.

outputs0uint256
function

withdrawTokens 06b091f9

Transfer specified amount of tokens from exchange to specified address. /// Can be called only by contract owner.

inputs0address_recipient

address to transfer tokens to.

inputs1uint256_amount

amount of tokens to transfer.

outputs0uint256
function

withdrawnTokens d8f9659b

inputs0address[]tokens
inputs1address_to