ERC1155Controller
implements all of the functionality needed to mint, burn, approve, and transfer the ERC1155 option tokens (e.g. bTokens
and wTokens
). It inherits from the Open Zeppelin ERC1155PresetMinterPauser contract, which implements functions for minting, burning, approving, and transferring tokens, either as a single token or multiple tokens as a batch.ERC1155Controller
contract address.ERC20
standard because it provides us a more gas efficient way to create option series. Rather than deploy a new ERC20
contract with every new Series we create, we add an additional id to the same ERC1155
contract. It also standardizes the ERC1155.setApprovalForAll
, which allows an owner address to make only a single onchain transaction in order to approve an operator account to transfer any/all of the option tokens, which is more gas efficient than an onchain transaction for each option token.SeriesController
contract, such as the mint
and burn
functions. This is to ensure that no arbitrary address can inflate or deflate the supply of option tokens.updateImplementation
and transferOwnership
exist so that the owners can update the contracts in the event of a critical vulnerability that puts user's funds at risk.\{id\}
substring with the actual token type ID._id
account
's balance on the ERC1155 token id
. In the ERC1155 standard, a single contract tracks multiple tokens using different ID's. This is similar to the ERC20
standard's balanceOf
function, but the caller must also specify the ERC1155 token id
.account
id
accounts
for multiple ERC1155 token id
s. This is a more gas-efficient way to fetch multiple balances, compared to multiple calls to balanceOf. The length of the accounts
array must equal the length of the ids
array.accounts
ids
true
if the account
has approved operator
to transfer all of account
's bTokens
and wTokens
on its behalf, and false
if the operator
is not approved to transfer any of account
's ERC1155 tokens. The ERC1155 standard does not expose a function for approving individual ERC1155 token ids, but does expose setApprovalForAll
for approving the transfer of all account
's ERC1155 tokens.account
operator
operator
account
's fundsapproved
is true
, allows the operator
to transfer all of the caller's bTokens
and wTokens
on the caller's behalf. If false
, the operator
can no longer transfer tokens. This is similar to the ERC20
's approve
function, except in the ERC1155 standard you only need to call the approval function once and forever after the operator
can transfer any amount of tokens. However, this is more dangerous than single token approvals, because the operator
has control over all of the caller's balance of ERC1155 tokens.account
operator
to be able to transfer tokensapproved
true
if the account
is allowing the operator
to transfer the account
's tokens, and false
if the operator
is already approved and account
no longer wants operator
to be approved to transfer its tokensamount
tokens of token type id
from from
to to
. to
cannot be the zero address, and if the caller is not from
then prior to calling this function the from
address must have called setApprovalForAll
with the caller as the operator
argument, or else this call will fail. If to
refers to a smart contract, it must implement 'onERC1155Received'.from
to
id
SeriesController.bTokenIndex(_seriesId)
or SeriesController.wTokenIndex(_seriesId)
amount
data
safeTransferFrom
, but more gas efficient when multiple transactions for different amounts of different token ids must be sent to the same to
address. Use this function rather than safeTransferFrom
when the caller wants to save gas while sending multiple tokens to the same recipient address.from
to
ids
SeriesController.bTokenIndex(_seriesId)
or SeriesController.wTokenIndex(_seriesId)
amounts
data
amount
tokens of token type id
and sends them to address to
. to
cannot be the zero address, and if to
refers to a smart contract, it must implement 'onERC1155Received'.to
id
SeriesController.bTokenIndex(_seriesId)
or SeriesController.wTokenIndex(_seriesId)
amount
data
to
ids
SeriesController.bTokenIndex(_seriesId)
or SeriesController.wTokenIndex(_seriesId)
amounts
data
amount
tokens of token type id
owned by the address account
. account
cannot be the zero address, and account
must have at least amount
of the tokens for this call to succeed. If the caller is not account
, then account
must have approved the caller using setApprovalForAll
prior to calling burn
.SeriesController
calls this inside of SeriesController.exerciseOption
and SeriesController.claimCollateral
.id
SeriesController.bTokenIndex(_seriesId)
or SeriesController.wTokenIndex(_seriesId)
amount
ids
SeriesController.bTokenIndex(_seriesId)
or SeriesController.wTokenIndex(_seriesId)
amounts
ERC1155Controller
's logic contract. The SIREN protocol's contracts use the EIP-1822 standard for implementing upgradeable contracts. This allows us to update vulnerable contracts and keep users' option tokens safe. When the SIREN protocol has reached a certain level of stability, we can remove these safety guards and ensure no one on the Siren team can swap out the smart contract functionality._newImplementation
ERC1155Controller
's function implementations_newAdmin
address. See the onlyOwner
modifier for the permissions granted to the protocol admin._newAdmin