Skip to content

Latest commit

 

History

History
2230 lines (1055 loc) · 102 KB

index.md

File metadata and controls

2230 lines (1055 loc) · 102 KB

Core

constructor(address _registry) (public)

Calls Core.Lib.UsingRegistry constructor

withdrawFee(address _tokenAddress) (public)

This function allows fee recipients to withdraw their fees

create(struct LibDerivative.Derivative _derivative, uint256 _quantity, address[2] _addresses) (public)

Creates derivative contracts (positions)

execute(uint256 _tokenId, uint256 _quantity, struct LibDerivative.Derivative _derivative) (public)

Executes several positions of msg.sender with same tokenId

execute(address _tokenOwner, uint256 _tokenId, uint256 _quantity, struct LibDerivative.Derivative _derivative) (public)

Executes several positions of _tokenOwner with same tokenId

execute(uint256[] _tokenIds, uint256[] _quantities, struct LibDerivative.Derivative[] _derivatives) (public)

Executes several positions of msg.sender with different tokenIds

execute(address _tokenOwner, uint256[] _tokenIds, uint256[] _quantities, struct LibDerivative.Derivative[] _derivatives) (public)

Executes several positions of _tokenOwner with different tokenIds

cancel(uint256 _tokenId, uint256 _quantity, struct LibDerivative.Derivative _derivative) (public)

Cancels tickers, burns positions and returns margins to positions owners in case no data were provided within NO_DATA_CANCELLATION_PERIOD

cancel(uint256[] _tokenIds, uint256[] _quantities, struct LibDerivative.Derivative[] _derivatives) (public)

Cancels tickers, burns positions and returns margins to positions owners in case no data were provided within NO_DATA_CANCELLATION_PERIOD

Created(address buyer, address seller, bytes32 derivativeHash, uint256 quantity)

Executed(address tokenOwner, uint256 tokenId, uint256 quantity)

Canceled(bytes32 derivativeHash)

CoreErrors

MatchingErrors

OracleAggregatorErrors

RegistryErrors

SyntheticAggregatorErrors

UsingRegistryErrors

BalanceHelper

balancesOf(address _user, contract IERC20[] _tokens, address _tokenSpender) → uint256 ethBalance, struct BalanceHelper.TokenBalance[] tokensBalances (public)

ExecutableByThirdParty

thirdpartyExecutionAllowed(address derivativeOwner) → bool (public)

Getter for thirdparty execution allowance

allowThirdpartyExecution(bool allow) (public)

Sets third party execution settings for msg.sender

HasCommission

constructor() (public)

Sets msg.sender as syntheticId author

getAuthorAddress() → address (public)

Getter for syntheticId author address

getAuthorCommission() → uint256 (public)

Getter for syntheticId author commission

PayoutHelper

getExecutionPayouts(struct LibDerivative.Derivative _derivative, uint256[] _results) → struct PayoutHelper.ExecutionPayout[] executionPayouts (public)

IDerivativeLogic

validateInput(struct LibDerivative.Derivative _derivative) → bool (public)

Validates ticker

getMargin(struct LibDerivative.Derivative _derivative) → uint256 buyerMargin, uint256 sellerMargin (public)

Calculates margin required for derivative creation

getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result) → uint256 buyerPayout, uint256 sellerPayout (public)

Calculates payout for derivative execution

getAuthorAddress() → address authorAddress (public)

Returns syntheticId author address for Opium commissions

getAuthorCommission() → uint256 commission (public)

Returns syntheticId author commission in base of COMMISSION_BASE

thirdpartyExecutionAllowed(address _derivativeOwner) → bool (public)

Returns whether thirdparty could execute on derivative's owner's behalf

isPool() → bool (public)

Returns whether syntheticId implements pool logic

allowThirdpartyExecution(bool _allow) (public)

Sets whether thirds parties are allowed or not to execute derivative's on msg.sender's behalf

MetadataSet(string metadata)

IOracleId

fetchData(uint256 timestamp) (external)

Requests data from oracleId one time

recursivelyFetchData(uint256 timestamp, uint256 period, uint256 times) (external)

Requests data from oracleId multiple times

calculateFetchPrice() → uint256 fetchPrice (external)

Requests and returns price in ETH for one request. This function could be called as view function. Oraclize API for price calculations restricts making this function as view.

MetadataSet(string metadata)

LibCommission

LibDerivative

getDerivativeHash(struct LibDerivative.Derivative _derivative) → bytes32 derivativeHash (public)

Calculates hash of provided Derivative

LibEIP712

hashEIP712Message(bytes32 hashStruct) → bytes32 result (internal)

Hashes EIP712Message

UsingRegistry

onlyCore()

This modifier restricts access to functions, which could be called only by Opium.Core

constructor(address _registry) (public)

Defines registry instance and emits appropriate event

getRegistry() → address (external)

Getter for registry variable

RegistrySet(address registry)

Whitelisted

onlyWhitelisted()

This modifier restricts access to functions, which could be called only by whitelisted addresses

getWhitelist() → address[] (public)

Getter for whitelisted addresses array

WhitelistedWithGovernance

onlyGovernor()

This modifier restricts access to functions, which could be called only by governor

constructor(uint256 _timeLockInterval, address _governor) (public)

Contract constructor

proposeWhitelist(address[] _whitelist) (public)

Calling this function governor could propose new whitelist addresses array. Also it allows to initialize first whitelist if it was not initialized yet.

commitWhitelist() (public)

Calling this function governor commits proposed whitelist if timelock interval of proposal was passed

setGovernor(address _governor) (public)

This function allows governor to transfer governance to a new governor and emits event

GovernorSet(address governor)

Proposed(address[] whitelist)

Committed(address[] whitelist)

WhitelistedWithGovernanceAndChangableTimelock

Opium.Lib.WhitelistedWithGovernanceAndChangableTimelock contract implements Opium.Lib.WhitelistedWithGovernance and adds possibility for governor to change timelock interval within timelock interval

proposeTimelock(uint256 _timelock) (public)

Calling this function governor could propose new timelock

commitTimelock() (public)

Calling this function governor could commit previously proposed new timelock if timelock interval of proposal was passed

Proposed(uint256 timelock)

Committed(uint256 timelock)

LibOrder

hashOrder(struct LibOrder.Order _order) → bytes32 hash (public)

Hashes the order

verifySignature(bytes32 _hash, bytes _signature, address _address) → bool (internal)

Verifies order signature

Match

constructor(address _registry) (public)

Calls constructors of super-contracts

MatchCreate

create(struct LibOrder.Order _buyOrder, struct LibOrder.Order _sellOrder, struct LibDerivative.Derivative _derivative, bool _buyerIsMaker) (public)

This function receives buy and sell orders, derivative related to it and information whether buy order was first in orderbook (maker)

Create(bytes32 derivativeHash, address buyerPremiumAddress, uint256 buyerPremiumAmount, address sellerPremiumAddress, uint256 sellerPremiumAmount, uint256 filled)

MatchLogic

cancel(struct LibOrder.Order _order) (public)

Calling this function maker of the order could cancel it on-chain

withdraw(contract IERC20 _token) (public)

Function to withdraw fees from orders for relayer and affiliates

validateNotCanceled(bytes32 _hash) (internal)

This function checks whether order was canceled

validateTakerAddress(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder) (internal)

This function validates takerAddress of _leftOrder. It should match either with _rightOrder.makerAddress or be set to zero address

validateExpiration(struct LibOrder.Order _order) (internal)

This function validates whether order was expired or it's expiresAt is set to zero

validateSenderAddress(struct LibOrder.Order _order) (internal)

This function validates whether sender address equals to msg.sender or set to zero address

validateSignature(bytes32 orderHash, struct LibOrder.Order _order) (internal)

This function validates order signature if not validated before

takeFees(bytes32 _orderHash, struct LibOrder.Order _order) (internal)

This function is responsible for taking relayer and affiliate fees, if they were not taken already

min(uint256 _a, uint256 _b) → uint256 (internal)

Helper to get minimal of two integers

getDivisionPercentage(uint256 _numerator, uint256 _denominator) → uint256 divisionPercentage (internal)

Helper to get percentage of division in base of PERCENTAGE_BASE devP = numerator / denominator * 100%

getInitialPercentageValue(uint256 _divisionPercentage, uint256 _denominator) → uint256 numerator (internal)

Helper to recover numerator from percentage of division in base of PERCENTAGE_BASE numerator = devP * denominator / 100%

Canceled(bytes32 orderHash)

MatchPool

constructor(address _registry) (public)

create(struct LibOrder.Order _buyOrder, struct LibDerivative.Derivative _derivative) (public)

MatchSwap

swap(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder) (public)

This function receives left and right orders, and performs swap of Token + Margin to Token + Margin swaps

Swap(uint256 leftMakerTokenId, uint256 leftMakerTokenAmount, address leftMakerMarginAddress, uint256 leftMakerMarginAmount, uint256 rightMakerTokenId, uint256 rightMakerTokenAmount, address rightMakerMarginAddress, uint256 rightMakerMarginAmount)

LibSwaprateOrder

hashOrder(struct LibSwaprateOrder.SwaprateOrder _order) → bytes32 hash (public)

Hashes the order

verifySignature(bytes32 _hash, bytes _signature, address _address) → bool (internal)

Verifies order signature

SwaprateMatch

constructor(address _registry) (public)

Calls constructors of super-contracts

create(struct LibSwaprateOrder.SwaprateOrder _leftOrder, struct LibSwaprateOrder.SwaprateOrder _rightOrder, struct LibDerivative.Derivative _derivative) (public)

This function receives left and right orders, derivative related to it

SwaprateMatchBase

cancel(struct LibSwaprateOrder.SwaprateOrder _order) (public)

Calling this function maker of the order could cancel it on-chain

withdraw(contract IERC20 _token) (public)

Function to withdraw fees from orders for relayer and affiliates

validateNotCanceled(bytes32 _hash) (internal)

This function checks whether order was canceled

validateTakerAddress(struct LibSwaprateOrder.SwaprateOrder _leftOrder, struct LibSwaprateOrder.SwaprateOrder _rightOrder) (internal)

This function validates takerAddress of _leftOrder. It should match either with _rightOrder.makerAddress or be set to zero address

validateSenderAddress(struct LibSwaprateOrder.SwaprateOrder _order) (internal)

This function validates whether sender address equals to msg.sender or set to zero address

validateSignature(bytes32 orderHash, struct LibSwaprateOrder.SwaprateOrder _order) (internal)

This function validates order signature if not validated before

takeFees(bytes32 _orderHash, struct LibSwaprateOrder.SwaprateOrder _order) (internal)

This function is responsible for taking relayer and affiliate fees, if they were not taken already

min(uint256 _a, uint256 _b) → uint256 (internal)

Helper to get minimal of two integers

Canceled(bytes32 orderHash)

Migrations

restricted()

setCompleted(uint256 completed) (public)

upgrade(address new_address) (public)

OracleAggregator

enoughEtherProvided(address oracleId, uint256 times)

Checks whether enough ETH were provided withing data request to proceed

fetchData(address oracleId, uint256 timestamp) (public)

Requests data from oracleId one time

recursivelyFetchData(address oracleId, uint256 timestamp, uint256 period, uint256 times) (public)

Requests data from oracleId multiple times

__callback(uint256 timestamp, uint256 data) (public)

Receives and caches data from msg.sender

calculateFetchPrice(address oracleId) → uint256 fetchPrice (public)

Requests and returns price in ETH for one request. This function could be called as view function. Oraclize API for price calculations restricts making this function as view.

getData(address oracleId, uint256 timestamp) → uint256 dataResult (public)

Returns cached data if they exist, or reverts with an error

hasData(address oracleId, uint256 timestamp) → bool result (public)

Getter for dataExist mapping

Registry

onlyInitializer()

This modifier restricts access to functions, which could be called only by initializer

constructor() (public)

Sets initializer

init(address _minter, address _core, address _oracleAggregator, address _syntheticAggregator, address _tokenSpender, address _opiumAddress) (external)

Sets Opium.TokenMinter, Opium.Core, Opium.OracleAggregator, Opium.SyntheticAggregator, Opium.TokenSpender, Opium commission receiver addresses and allows to do it only once

changeOpiumAddress(address _opiumAddress) (external)

Allows opium commission receiver address to change itself

getMinter() → address result (external)

Returns address of Opium.TokenMinter

getCore() → address result (external)

Returns address of Opium.Core

getOracleAggregator() → address result (external)

Returns address of Opium.OracleAggregator

getSyntheticAggregator() → address result (external)

Returns address of Opium.SyntheticAggregator

getTokenSpender() → address result (external)

Returns address of Opium.TokenSpender

getOpiumAddress() → address result (external)

Returns address of Opium commission receiver

SyntheticAggregator

Opium.SyntheticAggregator contract initialized, identifies and caches syntheticId sensitive data

getAuthorCommission(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative) → uint256 commission (public)

Initializes ticker, if was not initialized and returns syntheticId author commission from cache

getAuthorAddress(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative) → address authorAddress (public)

Initializes ticker, if was not initialized and returns syntheticId author address from cache

getMargin(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative) → uint256 buyerMargin, uint256 sellerMargin (public)

Initializes ticker, if was not initialized and returns buyer and seller margin from cache

isPool(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative) → bool result (public)

Checks whether syntheticId implements pooled logic

Create(struct LibDerivative.Derivative derivative, bytes32 derivativeHash)

TokenMinter

  • onlyCore()
  • [nonReentrant()][ReentrancyGuard-nonReentrant--]
  • [isOperatorOrOwner(address _from)][ERC721OBase-isOperatorOrOwner-address-]
  • constructor(string _baseTokenURI, address _registry)
  • mint(address _buyer, address _seller, bytes32 _derivativeHash, uint256 _quantity)
  • mint(address _buyer, bytes32 _derivativeHash, uint256 _quantity)
  • burn(address _tokenOwner, uint256 _tokenId, uint256 _quantity)
  • name()
  • symbol()
  • isApprovedOrOwner(address _spender, address _owner, uint256 _tokenId)
  • isOpiumSpender(address _spender)
  • getRegistry()
  • [implementsERC721()][ERC721OBackwardCompatible-implementsERC721--]
  • [ownerOf(uint256 _tokenId)][ERC721OBackwardCompatible-ownerOf-uint256-]
  • [balanceOf(address _owner)][ERC721OBackwardCompatible-balanceOf-address-]
  • [tokenByIndex(uint256 _index)][ERC721OBackwardCompatible-tokenByIndex-uint256-]
  • [tokenOfOwnerByIndex(address _owner, uint256 _index)][ERC721OBackwardCompatible-tokenOfOwnerByIndex-address-uint256-]
  • [tokenURI(uint256 _tokenId)][ERC721OBackwardCompatible-tokenURI-uint256-]
  • [getApproved(uint256 _tokenId)][ERC721OBackwardCompatible-getApproved-uint256-]
  • [safeTransferFrom(address _from, address _to, uint256 _tokenId)][ERC721OBackwardCompatible-safeTransferFrom-address-address-uint256-]
  • [safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes _data)][ERC721OBackwardCompatible-safeTransferFrom-address-address-uint256-bytes-]
  • [transferFrom(address _from, address _to, uint256 _tokenId)][ERC721OBackwardCompatible-transferFrom-address-address-uint256-]
  • [_checkAndCallSafeTransfer(address _from, address _to, uint256 _tokenId, bytes _data)][ERC721OBackwardCompatible-_checkAndCallSafeTransfer-address-address-uint256-bytes-]
  • [compose(uint256[] _tokenIds, uint256[] _tokenRatio, uint256 _quantity)][ERC721OComposable-compose-uint256---uint256---uint256-]
  • [decompose(uint256 _portfolioId, uint256[] _tokenIds, uint256[] _tokenRatio, uint256 _quantity)][ERC721OComposable-decompose-uint256-uint256---uint256---uint256-]
  • [recompose(uint256 _portfolioId, uint256[] _initialTokenIds, uint256[] _initialTokenRatio, uint256[] _finalTokenIds, uint256[] _finalTokenRatio, uint256 _quantity)][ERC721OComposable-recompose-uint256-uint256---uint256---uint256---uint256---uint256-]
  • [_mint(uint256 _tokenId, address _to, uint256 _supply)][ERC721OMintable-_mint-uint256-address-uint256-]
  • [_burn(address _tokenOwner, uint256 _tokenId, uint256 _quantity)][ERC721OMintable-_burn-address-uint256-uint256-]
  • [_mint(address _buyer, address _seller, bytes32 _derivativeHash, uint256 _quantity)][ERC721OMintable-_mint-address-address-bytes32-uint256-]
  • [_mintLong(address _buyer, bytes32 _derivativeHash, uint256 _quantity)][ERC721OMintable-_mintLong-address-bytes32-uint256-]
  • [_mintShort(address _seller, bytes32 _derivativeHash, uint256 _quantity)][ERC721OMintable-_mintShort-address-bytes32-uint256-]
  • [_registerPortfolio(uint256 _portfolioId, uint256[] _tokenIds, uint256[] _tokenRatio)][ERC721OMintable-_registerPortfolio-uint256-uint256---uint256---]
  • [batchTransferFrom(address _from, address _to, uint256[] _tokenIds, uint256[] _amounts)][ERC721OTransferable-batchTransferFrom-address-address-uint256---uint256---]
  • [safeBatchTransferFrom(address _from, address _to, uint256[] _tokenIds, uint256[] _amounts, bytes _data)][ERC721OTransferable-safeBatchTransferFrom-address-address-uint256---uint256---bytes-]
  • [safeBatchTransferFrom(address _from, address _to, uint256[] _tokenIds, uint256[] _amounts)][ERC721OTransferable-safeBatchTransferFrom-address-address-uint256---uint256---]
  • [transfer(address _to, uint256 _tokenId, uint256 _amount)][ERC721OTransferable-transfer-address-uint256-uint256-]
  • [transferFrom(address _from, address _to, uint256 _tokenId, uint256 _amount)][ERC721OTransferable-transferFrom-address-address-uint256-uint256-]
  • [safeTransferFrom(address _from, address _to, uint256 _tokenId, uint256 _amount)][ERC721OTransferable-safeTransferFrom-address-address-uint256-uint256-]
  • [safeTransferFrom(address _from, address _to, uint256 _tokenId, uint256 _amount, bytes _data)][ERC721OTransferable-safeTransferFrom-address-address-uint256-uint256-bytes-]
  • [_batchTransferFrom(address _from, address _to, uint256[] _tokenIds, uint256[] _amounts)][ERC721OTransferable-_batchTransferFrom-address-address-uint256---uint256---]
  • [_transferFrom(address _from, address _to, uint256 _tokenId, uint256 _amount)][ERC721OTransferable-_transferFrom-address-address-uint256-uint256-]
  • [_checkAndCallSafeTransfer(address _from, address _to, uint256 _tokenId, uint256 _amount, bytes _data)][ERC721OTransferable-_checkAndCallSafeTransfer-address-address-uint256-uint256-bytes-]
  • [implementsERC721O()][ERC721OBase-implementsERC721O--]
  • [exists(uint256 _tokenId)][ERC721OBase-exists-uint256-]
  • [balanceOf(address _address, uint256 _tokenId)][ERC721OBase-balanceOf-address-uint256-]
  • [totalSupply()][ERC721OBase-totalSupply--]
  • [tokensOwned(address _owner)][ERC721OBase-tokensOwned-address-]
  • [setApprovalForAll(address _operator, bool _approved)][ERC721OBase-setApprovalForAll-address-bool-]
  • [permit(address _holder, address _spender, uint256 _nonce, uint256 _expiry, bool _allowed, bytes _signature)][ERC721OBase-permit-address-address-uint256-uint256-bool-bytes-]
  • [approve(address _to, uint256 _tokenId)][ERC721OBase-approve-address-uint256-]
  • [getApproved(uint256 _tokenId, address _tokenOwner)][ERC721OBase-getApproved-uint256-address-]
  • [isApprovedForAll(address _owner, address _operator)][ERC721OBase-isApprovedForAll-address-address-]
  • [_updateTokenBalance(address _from, uint256 _tokenId, uint256 _amount, enum ObjectLib.Operations op)][ERC721OBase-_updateTokenBalance-address-uint256-uint256-enum-ObjectLib-Operations-]
  • [supportsInterface(bytes4 interfaceId)][ERC165-supportsInterface-bytes4-]
  • [_registerInterface(bytes4 interfaceId)][ERC165-_registerInterface-bytes4-]
  • RegistrySet(address registry)
  • [Transfer(address from, address to, uint256 tokenId)][IERC721-Transfer-address-address-uint256-]
  • [Approval(address owner, address approved, uint256 tokenId)][IERC721-Approval-address-address-uint256-]
  • [ApprovalForAll(address owner, address operator, bool approved)][IERC721-ApprovalForAll-address-address-bool-]
  • [TransferWithQuantity(address from, address to, uint256 tokenId, uint256 quantity)][IERC721O-TransferWithQuantity-address-address-uint256-uint256-]
  • [BatchTransfer(address from, address to, uint256[] tokenTypes, uint256[] amounts)][IERC721O-BatchTransfer-address-address-uint256---uint256---]
  • [Composition(uint256 portfolioId, uint256[] tokenIds, uint256[] tokenRatio)][IERC721O-Composition-uint256-uint256---uint256---]

constructor(string _baseTokenURI, address _registry) (public)

Calls constructors of super-contracts

mint(address _buyer, address _seller, bytes32 _derivativeHash, uint256 _quantity) (external)

Mints LONG and SHORT position tokens

mint(address _buyer, bytes32 _derivativeHash, uint256 _quantity) (external)

Mints only LONG position tokens for "pooled" derivatives

burn(address _tokenOwner, uint256 _tokenId, uint256 _quantity) (external)

Burns position tokens

name() → string (external)

ERC721 interface compatible function for position token name retrieving

symbol() → string (external)

ERC721 interface compatible function for position token symbol retrieving

isApprovedOrOwner(address _spender, address _owner, uint256 _tokenId) → bool (public)

VIEW FUNCTIONS Checks whether _spender is approved to spend tokens on _owners behalf or owner itself

isOpiumSpender(address _spender) → bool (public)

Checks whether _spender is Opium.TokenSpender

TokenSpender

constructor(address _governor) (public)

Calls constructors of super-contracts

claimTokens(contract IERC20 token, address from, address to, uint256 amount) (external)

Using this function whitelisted contracts could call ERC20 transfers

claimPositions(contract IERC721O token, address from, address to, uint256 tokenId, uint256 amount) (external)

Using this function whitelisted contracts could call ERC721O transfers

DummySyntheticIdMock

validateInput(struct LibDerivative.Derivative _derivative) → bool (public)

getMargin(struct LibDerivative.Derivative _derivative) → uint256 buyerMargin, uint256 sellerMargin (public)

getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result) → uint256 buyerPayout, uint256 sellerPayout (public)

isPool() → bool (public)

OptionCallSyntheticIdMock

validateInput(struct LibDerivative.Derivative _derivative) → bool (public)

getMargin(struct LibDerivative.Derivative _derivative) → uint256 buyerMargin, uint256 sellerMargin (public)

getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result) → uint256 buyerPayout, uint256 sellerPayout (public)

isPool() → bool (public)

OracleIdMock

constructor(uint256 _fetchPrice, address _registry) (public)

triggerCallback(uint256 timestamp, uint256 returnData) (external)

fetchData(uint256 timestamp) (external)

recursivelyFetchData(uint256 timestamp, uint256 period, uint256 times) (external)

calculateFetchPrice() → uint256 (external)

ERC20Basic

balanceOf(address who) → uint256 (public)

transfer(address to, uint256 value) → bool (public)

Transfer(address from, address to, uint256 value)

SafeMath

mul(uint256 a, uint256 b) → uint256 (internal)

div(uint256 a, uint256 b) → uint256 (internal)

sub(uint256 a, uint256 b) → uint256 (internal)

add(uint256 a, uint256 b) → uint256 (internal)

BasicToken

Basic version of StandardToken, with no allowances.

transfer(address _to, uint256 _value) → bool (public)

transfer token for a specified address

balanceOf(address _owner) → uint256 balance (public)

Gets the balance of the specified address.

ERC20

see ethereum/EIPs#20

allowance(address owner, address spender) → uint256 (public)

transferFrom(address from, address to, uint256 value) → bool (public)

approve(address spender, uint256 value) → bool (public)

Approval(address owner, address spender, uint256 value)

StandardToken

Implementation of the basic standard token. ethereum/EIPs#20 Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol

transferFrom(address _from, address _to, uint256 _value) → bool (public)

Transfer tokens from one address to another

approve(address _spender, uint256 _value) → bool (public)

Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.

Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: ethereum/EIPs#20 (comment)

allowance(address _owner, address _spender) → uint256 (public)

Function to check the amount of tokens that an owner allowed to a spender.

increaseApproval(address _spender, uint256 _addedValue) → bool (public)

Increase the amount of tokens that an owner allowed to a spender.

approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol

decreaseApproval(address _spender, uint256 _subtractedValue) → bool (public)

Decrease the amount of tokens that an owner allowed to a spender.

approve should be called when allowed[_spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol

TestToken

constructor(string _name, string _symbol, uint8 _decimals) (public)

mint(address _to, uint256 _amount) (public)

WETH

fallback() (external)

deposit() (public)

withdraw(uint256 wad) (public)

totalSupply() → uint256 (public)

approve(address guy, uint256 wad) → bool (public)

transfer(address dst, uint256 wad) → bool (public)

transferFrom(address src, address dst, uint256 wad) → bool (public)

Approval(address src, address guy, uint256 wad)

Transfer(address src, address dst, uint256 wad)

Deposit(address dst, uint256 wad)

Withdrawal(address src, uint256 wad)