- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
constructor(address _registry)
withdrawFee(address _tokenAddress)
create(struct LibDerivative.Derivative _derivative, uint256 _quantity, address[2] _addresses)
execute(uint256 _tokenId, uint256 _quantity, struct LibDerivative.Derivative _derivative)
execute(address _tokenOwner, uint256 _tokenId, uint256 _quantity, struct LibDerivative.Derivative _derivative)
execute(uint256[] _tokenIds, uint256[] _quantities, struct LibDerivative.Derivative[] _derivatives)
execute(address _tokenOwner, uint256[] _tokenIds, uint256[] _quantities, struct LibDerivative.Derivative[] _derivatives)
cancel(uint256 _tokenId, uint256 _quantity, struct LibDerivative.Derivative _derivative)
cancel(uint256[] _tokenIds, uint256[] _quantities, struct LibDerivative.Derivative[] _derivatives)
getRegistry()
getDerivativeHash(struct LibDerivative.Derivative _derivative)
Created(address buyer, address seller, bytes32 derivativeHash, uint256 quantity)
Executed(address tokenOwner, uint256 tokenId, uint256 quantity)
Canceled(bytes32 derivativeHash)
RegistrySet(address registry)
Calls Core.Lib.UsingRegistry constructor
This function allows fee recipients to withdraw their fees
create(struct LibDerivative.Derivative _derivative, uint256 _quantity, address[2] _addresses)
(public)
Creates derivative contracts (positions)
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 tokenId
s
execute(address _tokenOwner, uint256[] _tokenIds, uint256[] _quantities, struct LibDerivative.Derivative[] _derivatives)
(public)
Executes several positions of _tokenOwner
with different tokenId
s
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
balancesOf(address _user, contract IERC20[] _tokens, address _tokenSpender) → uint256 ethBalance, struct BalanceHelper.TokenBalance[] tokensBalances
(public)
Getter for thirdparty execution allowance
Sets third party execution settings for msg.sender
Sets msg.sender
as syntheticId author
Getter for syntheticId author address
Getter for syntheticId author commission
getExecutionPayouts(struct LibDerivative.Derivative _derivative, uint256[] _results)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
getExecutionPayouts(struct LibDerivative.Derivative _derivative, uint256[] _results) → struct PayoutHelper.ExecutionPayout[] executionPayouts
(public)
validateInput(struct LibDerivative.Derivative _derivative)
getMargin(struct LibDerivative.Derivative _derivative)
getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result)
getAuthorAddress()
getAuthorCommission()
thirdpartyExecutionAllowed(address _derivativeOwner)
isPool()
allowThirdpartyExecution(bool _allow)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
MetadataSet(string metadata)
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
Returns syntheticId author address for Opium commissions
Returns syntheticId author commission in base of COMMISSION_BASE
Returns whether thirdparty could execute on derivative's owner's behalf
Returns whether syntheticId implements pool logic
Sets whether thirds parties are allowed or not to execute derivative's on msg.sender's behalf
fetchData(uint256 timestamp)
recursivelyFetchData(uint256 timestamp, uint256 period, uint256 times)
calculateFetchPrice()
MetadataSet(string metadata)
Requests data from oracleId
one time
Requests data from oracleId
multiple times
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.
Calculates hash of provided Derivative
Hashes EIP712Message
This modifier restricts access to functions, which could be called only by Opium.Core
Defines registry instance and emits appropriate event
Getter for registry variable
This modifier restricts access to functions, which could be called only by whitelisted addresses
Getter for whitelisted addresses array
onlyGovernor()
onlyWhitelisted()
constructor(uint256 _timeLockInterval, address _governor)
proposeWhitelist(address[] _whitelist)
commitWhitelist()
setGovernor(address _governor)
getWhitelist()
GovernorSet(address governor)
Proposed(address[] whitelist)
Committed(address[] whitelist)
This modifier restricts access to functions, which could be called only by governor
Contract constructor
Calling this function governor could propose new whitelist addresses array. Also it allows to initialize first whitelist if it was not initialized yet.
Calling this function governor commits proposed whitelist if timelock interval of proposal was passed
This function allows governor to transfer governance to a new governor and emits event
Opium.Lib.WhitelistedWithGovernanceAndChangableTimelock contract implements Opium.Lib.WhitelistedWithGovernance and adds possibility for governor to change timelock interval within timelock interval
onlyGovernor()
onlyWhitelisted()
proposeTimelock(uint256 _timelock)
commitTimelock()
constructor(uint256 _timeLockInterval, address _governor)
proposeWhitelist(address[] _whitelist)
commitWhitelist()
setGovernor(address _governor)
getWhitelist()
Proposed(uint256 timelock)
Committed(uint256 timelock)
GovernorSet(address governor)
Proposed(address[] whitelist)
Committed(address[] whitelist)
Calling this function governor could propose new timelock
Calling this function governor could commit previously proposed new timelock if timelock interval of proposal was passed
hashOrder(struct LibOrder.Order _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Hashes the order
Verifies order signature
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
constructor(address _registry)
swap(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder)
create(struct LibOrder.Order _buyOrder, struct LibOrder.Order _sellOrder, struct LibDerivative.Derivative _derivative, bool _buyerIsMaker)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
cancel(struct LibOrder.Order _order)
withdraw(contract IERC20 _token)
validateNotCanceled(bytes32 _hash)
validateTakerAddress(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder)
validateExpiration(struct LibOrder.Order _order)
validateSenderAddress(struct LibOrder.Order _order)
validateSignature(bytes32 orderHash, struct LibOrder.Order _order)
takeFees(bytes32 _orderHash, struct LibOrder.Order _order)
min(uint256 _a, uint256 _b)
getDivisionPercentage(uint256 _numerator, uint256 _denominator)
getInitialPercentageValue(uint256 _divisionPercentage, uint256 _denominator)
getRegistry()
hashOrder(struct LibOrder.Order _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Swap(uint256 leftMakerTokenId, uint256 leftMakerTokenAmount, address leftMakerMarginAddress, uint256 leftMakerMarginAmount, uint256 rightMakerTokenId, uint256 rightMakerTokenAmount, address rightMakerMarginAddress, uint256 rightMakerMarginAmount)
Create(bytes32 derivativeHash, address buyerPremiumAddress, uint256 buyerPremiumAmount, address sellerPremiumAddress, uint256 sellerPremiumAmount, uint256 filled)
Canceled(bytes32 orderHash)
RegistrySet(address registry)
Calls constructors of super-contracts
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
create(struct LibOrder.Order _buyOrder, struct LibOrder.Order _sellOrder, struct LibDerivative.Derivative _derivative, bool _buyerIsMaker)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
cancel(struct LibOrder.Order _order)
withdraw(contract IERC20 _token)
validateNotCanceled(bytes32 _hash)
validateTakerAddress(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder)
validateExpiration(struct LibOrder.Order _order)
validateSenderAddress(struct LibOrder.Order _order)
validateSignature(bytes32 orderHash, struct LibOrder.Order _order)
takeFees(bytes32 _orderHash, struct LibOrder.Order _order)
min(uint256 _a, uint256 _b)
getDivisionPercentage(uint256 _numerator, uint256 _denominator)
getInitialPercentageValue(uint256 _divisionPercentage, uint256 _denominator)
- [
constructor()
][ReentrancyGuard-constructor--] getRegistry()
hashOrder(struct LibOrder.Order _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Create(bytes32 derivativeHash, address buyerPremiumAddress, uint256 buyerPremiumAmount, address sellerPremiumAddress, uint256 sellerPremiumAmount, uint256 filled)
Canceled(bytes32 orderHash)
RegistrySet(address registry)
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)
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
cancel(struct LibOrder.Order _order)
withdraw(contract IERC20 _token)
validateNotCanceled(bytes32 _hash)
validateTakerAddress(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder)
validateExpiration(struct LibOrder.Order _order)
validateSenderAddress(struct LibOrder.Order _order)
validateSignature(bytes32 orderHash, struct LibOrder.Order _order)
takeFees(bytes32 _orderHash, struct LibOrder.Order _order)
min(uint256 _a, uint256 _b)
getDivisionPercentage(uint256 _numerator, uint256 _denominator)
getInitialPercentageValue(uint256 _divisionPercentage, uint256 _denominator)
- [
constructor()
][ReentrancyGuard-constructor--] getRegistry()
hashOrder(struct LibOrder.Order _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Canceled(bytes32 orderHash)
RegistrySet(address registry)
Calling this function maker of the order could cancel it on-chain
Function to withdraw fees from orders for relayer and affiliates
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
This function validates whether order was expired or it's expiresAt
is set to zero
This function validates whether sender address equals to msg.sender
or set to zero address
This function validates order signature if not validated before
This function is responsible for taking relayer and affiliate fees, if they were not taken already
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%
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
constructor(address _registry)
create(struct LibOrder.Order _buyOrder, struct LibDerivative.Derivative _derivative)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
cancel(struct LibOrder.Order _order)
withdraw(contract IERC20 _token)
validateNotCanceled(bytes32 _hash)
validateTakerAddress(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder)
validateExpiration(struct LibOrder.Order _order)
validateSenderAddress(struct LibOrder.Order _order)
validateSignature(bytes32 orderHash, struct LibOrder.Order _order)
takeFees(bytes32 _orderHash, struct LibOrder.Order _order)
min(uint256 _a, uint256 _b)
getDivisionPercentage(uint256 _numerator, uint256 _denominator)
getInitialPercentageValue(uint256 _divisionPercentage, uint256 _denominator)
getRegistry()
hashOrder(struct LibOrder.Order _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Canceled(bytes32 orderHash)
RegistrySet(address registry)
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
swap(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder)
cancel(struct LibOrder.Order _order)
withdraw(contract IERC20 _token)
validateNotCanceled(bytes32 _hash)
validateTakerAddress(struct LibOrder.Order _leftOrder, struct LibOrder.Order _rightOrder)
validateExpiration(struct LibOrder.Order _order)
validateSenderAddress(struct LibOrder.Order _order)
validateSignature(bytes32 orderHash, struct LibOrder.Order _order)
takeFees(bytes32 _orderHash, struct LibOrder.Order _order)
min(uint256 _a, uint256 _b)
getDivisionPercentage(uint256 _numerator, uint256 _denominator)
getInitialPercentageValue(uint256 _divisionPercentage, uint256 _denominator)
- [
constructor()
][ReentrancyGuard-constructor--] getRegistry()
hashOrder(struct LibOrder.Order _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Swap(uint256 leftMakerTokenId, uint256 leftMakerTokenAmount, address leftMakerMarginAddress, uint256 leftMakerMarginAmount, uint256 rightMakerTokenId, uint256 rightMakerTokenAmount, address rightMakerMarginAddress, uint256 rightMakerMarginAmount)
Canceled(bytes32 orderHash)
RegistrySet(address registry)
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)
hashOrder(struct LibSwaprateOrder.SwaprateOrder _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Hashes the order
Verifies order signature
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
constructor(address _registry)
create(struct LibSwaprateOrder.SwaprateOrder _leftOrder, struct LibSwaprateOrder.SwaprateOrder _rightOrder, struct LibDerivative.Derivative _derivative)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
cancel(struct LibSwaprateOrder.SwaprateOrder _order)
withdraw(contract IERC20 _token)
validateNotCanceled(bytes32 _hash)
validateTakerAddress(struct LibSwaprateOrder.SwaprateOrder _leftOrder, struct LibSwaprateOrder.SwaprateOrder _rightOrder)
validateSenderAddress(struct LibSwaprateOrder.SwaprateOrder _order)
validateSignature(bytes32 orderHash, struct LibSwaprateOrder.SwaprateOrder _order)
takeFees(bytes32 _orderHash, struct LibSwaprateOrder.SwaprateOrder _order)
min(uint256 _a, uint256 _b)
getRegistry()
hashOrder(struct LibSwaprateOrder.SwaprateOrder _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Canceled(bytes32 orderHash)
RegistrySet(address registry)
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
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] onlyCore()
cancel(struct LibSwaprateOrder.SwaprateOrder _order)
withdraw(contract IERC20 _token)
validateNotCanceled(bytes32 _hash)
validateTakerAddress(struct LibSwaprateOrder.SwaprateOrder _leftOrder, struct LibSwaprateOrder.SwaprateOrder _rightOrder)
validateSenderAddress(struct LibSwaprateOrder.SwaprateOrder _order)
validateSignature(bytes32 orderHash, struct LibSwaprateOrder.SwaprateOrder _order)
takeFees(bytes32 _orderHash, struct LibSwaprateOrder.SwaprateOrder _order)
min(uint256 _a, uint256 _b)
- [
constructor()
][ReentrancyGuard-constructor--] getRegistry()
hashOrder(struct LibSwaprateOrder.SwaprateOrder _order)
verifySignature(bytes32 _hash, bytes _signature, address _address)
hashEIP712Message(bytes32 hashStruct)
Canceled(bytes32 orderHash)
RegistrySet(address registry)
Calling this function maker of the order could cancel it on-chain
Function to withdraw fees from orders for relayer and affiliates
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
This function validates whether sender address equals to msg.sender
or set to zero address
This function validates order signature if not validated before
This function is responsible for taking relayer and affiliate fees, if they were not taken already
Helper to get minimal of two integers
enoughEtherProvided(address oracleId, uint256 times)
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] fetchData(address oracleId, uint256 timestamp)
recursivelyFetchData(address oracleId, uint256 timestamp, uint256 period, uint256 times)
__callback(uint256 timestamp, uint256 data)
calculateFetchPrice(address oracleId)
getData(address oracleId, uint256 timestamp)
hasData(address oracleId, uint256 timestamp)
- [
constructor()
][ReentrancyGuard-constructor--]
Checks whether enough ETH were provided withing data request to proceed
Requests data from oracleId
one time
Requests data from oracleId
multiple times
Receives and caches data from msg.sender
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.
Returns cached data if they exist, or reverts with an error
Getter for dataExist mapping
onlyInitializer()
constructor()
init(address _minter, address _core, address _oracleAggregator, address _syntheticAggregator, address _tokenSpender, address _opiumAddress)
changeOpiumAddress(address _opiumAddress)
getMinter()
getCore()
getOracleAggregator()
getSyntheticAggregator()
getTokenSpender()
getOpiumAddress()
This modifier restricts access to functions, which could be called only by initializer
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
Allows opium commission receiver address to change itself
Returns address of Opium.TokenMinter
Returns address of Opium.Core
Returns address of Opium.OracleAggregator
Returns address of Opium.SyntheticAggregator
Returns address of Opium.TokenSpender
Returns address of Opium commission receiver
Opium.SyntheticAggregator contract initialized, identifies and caches syntheticId sensitive data
- [
nonReentrant()
][ReentrancyGuard-nonReentrant--] getAuthorCommission(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative)
getAuthorAddress(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative)
getMargin(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative)
isPool(bytes32 _derivativeHash, struct LibDerivative.Derivative _derivative)
- [
constructor()
][ReentrancyGuard-constructor--] getDerivativeHash(struct LibDerivative.Derivative _derivative)
Create(struct LibDerivative.Derivative derivative, bytes32 derivativeHash)
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
Checks whether syntheticId
implements pooled logic
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---]
Calls constructors of super-contracts
Mints LONG and SHORT position tokens
Mints only LONG position tokens for "pooled" derivatives
Burns position tokens
ERC721 interface compatible function for position token name retrieving
ERC721 interface compatible function for position token symbol retrieving
VIEW FUNCTIONS Checks whether _spender is approved to spend tokens on _owners behalf or owner itself
Checks whether _spender is Opium.TokenSpender
onlyGovernor()
onlyWhitelisted()
constructor(address _governor)
claimTokens(contract IERC20 token, address from, address to, uint256 amount)
claimPositions(contract IERC721O token, address from, address to, uint256 tokenId, uint256 amount)
proposeTimelock(uint256 _timelock)
commitTimelock()
proposeWhitelist(address[] _whitelist)
commitWhitelist()
setGovernor(address _governor)
getWhitelist()
Proposed(uint256 timelock)
Committed(uint256 timelock)
GovernorSet(address governor)
Proposed(address[] whitelist)
Committed(address[] whitelist)
Calls constructors of super-contracts
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
validateInput(struct LibDerivative.Derivative _derivative)
getMargin(struct LibDerivative.Derivative _derivative)
getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result)
isPool()
constructor()
getAuthorAddress()
getAuthorCommission()
thirdpartyExecutionAllowed(address derivativeOwner)
allowThirdpartyExecution(bool allow)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
MetadataSet(string metadata)
getMargin(struct LibDerivative.Derivative _derivative) → uint256 buyerMargin, uint256 sellerMargin
(public)
getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result) → uint256 buyerPayout, uint256 sellerPayout
(public)
validateInput(struct LibDerivative.Derivative _derivative)
getMargin(struct LibDerivative.Derivative _derivative)
getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result)
isPool()
constructor()
getAuthorAddress()
getAuthorCommission()
thirdpartyExecutionAllowed(address derivativeOwner)
allowThirdpartyExecution(bool allow)
getDerivativeHash(struct LibDerivative.Derivative _derivative)
MetadataSet(string metadata)
getMargin(struct LibDerivative.Derivative _derivative) → uint256 buyerMargin, uint256 sellerMargin
(public)
getExecutionPayout(struct LibDerivative.Derivative _derivative, uint256 _result) → uint256 buyerPayout, uint256 sellerPayout
(public)
onlyCore()
constructor(uint256 _fetchPrice, address _registry)
triggerCallback(uint256 timestamp, uint256 returnData)
fetchData(uint256 timestamp)
recursivelyFetchData(uint256 timestamp, uint256 period, uint256 times)
calculateFetchPrice()
getRegistry()
RegistrySet(address registry)
MetadataSet(string metadata)
balanceOf(address who)
transfer(address to, uint256 value)
Transfer(address from, address to, uint256 value)
mul(uint256 a, uint256 b)
div(uint256 a, uint256 b)
sub(uint256 a, uint256 b)
add(uint256 a, uint256 b)
Basic version of StandardToken, with no allowances.
transfer(address _to, uint256 _value)
balanceOf(address _owner)
Transfer(address from, address to, uint256 value)
transfer token for a specified address
Gets the balance of the specified address.
see ethereum/EIPs#20
allowance(address owner, address spender)
transferFrom(address from, address to, uint256 value)
approve(address spender, uint256 value)
balanceOf(address who)
transfer(address to, uint256 value)
Approval(address owner, address spender, uint256 value)
Transfer(address from, address to, uint256 value)
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)
approve(address _spender, uint256 _value)
allowance(address _owner, address _spender)
increaseApproval(address _spender, uint256 _addedValue)
decreaseApproval(address _spender, uint256 _subtractedValue)
transfer(address _to, uint256 _value)
balanceOf(address _owner)
Approval(address owner, address spender, uint256 value)
Transfer(address from, address to, uint256 value)
Transfer tokens from one address to another
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)
Function to check the amount of tokens that an owner allowed to a spender.
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
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
constructor(string _name, string _symbol, uint8 _decimals)
mint(address _to, uint256 _amount)
transferFrom(address _from, address _to, uint256 _value)
approve(address _spender, uint256 _value)
allowance(address _owner, address _spender)
increaseApproval(address _spender, uint256 _addedValue)
decreaseApproval(address _spender, uint256 _subtractedValue)
transfer(address _to, uint256 _value)
balanceOf(address _owner)
Approval(address owner, address spender, uint256 value)
Transfer(address from, address to, uint256 value)
fallback()
deposit()
withdraw(uint256 wad)
totalSupply()
approve(address guy, uint256 wad)
transfer(address dst, uint256 wad)
transferFrom(address src, address dst, uint256 wad)
Approval(address src, address guy, uint256 wad)
Transfer(address src, address dst, uint256 wad)
Deposit(address dst, uint256 wad)
Withdrawal(address src, uint256 wad)