Store

onlyRoleHolder(uint256 roleId) modifier

Reverts unless the caller is a member of the specified roleId.

onlyRoleManager(uint256 roleId) modifier

Reverts unless the caller is a member of the manager role for the specified roleId.

onlyExclusive(uint256 roleId) modifier

Reverts unless the roleId represents an initialized, exclusive roleId.

onlyShared(uint256 roleId) modifier

Reverts unless the roleId represents an initialized, shared roleId.

onlyValidRole(uint256 roleId) modifier

Reverts if roleId is not initialized.

onlyInvalidRole(uint256 roleId) modifier

Reverts if roleId is initialized.

constructor() public

Construct the Store contract.

payOracleFees() external

Pays Oracle fees in ETH to the store.

To be used by contracts whose margin currency is ETH.

payOracleFeesErc20(address erc20Address) external

Pays oracle fees in the margin currency, erc20Address, to the store.

To be used if the margin currency is an ERC20 token rather than ETH. All approved tokens are transferred.

Parameters:

  • erc20Address: address of the ERC20 token used to pay the fee.

computeRegularFee(uint256 startTime, uint256 endTime, struct FixedPoint.Unsigned pfc) → struct FixedPoint.Unsigned regularFee, struct FixedPoint.Unsigned latePenalty external

Computes the regular oracle fees that a contract should pay for a period.

Parameters:

  • startTime: defines the beginning time from which the fee is paid.

  • endTime: end time until which the fee is paid.

  • pfc: "profit from corruption", or the maximum amount of margin currency that a token sponsor could extract from the contract through corrupting the price feed in their favor.

computeFinalFee(address currency) → struct FixedPoint.Unsigned finalFee external

Computes the final oracle fees that a contract should pay at settlement.

Parameters:

  • currency: token used to pay the final fee.

setFixedOracleFeePerSecond(struct FixedPoint.Unsigned newOracleFee) public

Sets a new oracle fee per second.

Parameters:

  • newOracleFee: new fee per second charged to use the oracle.

setWeeklyDelayFee(struct FixedPoint.Unsigned newWeeklyDelayFee) public

Sets a new weekly delay fee.

Parameters:

  • newWeeklyDelayFee: fee escalation per week of late fee payment.

setFinalFee(address currency, struct FixedPoint.Unsigned finalFee) public

Sets a new final fee for a particular currency.

Parameters:

  • currency: defines the token currency used to pay the final fee.

  • finalFee: final fee amount.

withdraw(uint256 amount) external

Withdraws ETH from the contract.

withdrawErc20(address erc20Address, uint256 amount) external

Withdraws ERC20 tokens from the contract.

createWithdrawRole(uint256 roleId, uint256 managingRoleId, address owner) internal

Internal method that allows derived contracts to create a role for withdrawal.

Either this method or setWithdrawRole must be called by the derived class for this contract to function properly.

setWithdrawRole(uint256 roleId) internal

Internal method that allows derived contracts to choose the role for withdrawal.

The role roleId must exist. Either this method or createWithdrawRole must be called by the derived class for this contract to function properly.

holdsRole(uint256 roleId, address memberToCheck) → bool public

Whether memberToCheck is a member of roleId.

Reverts if roleId does not correspond to an initialized role.

resetMember(uint256 roleId, address newMember) public

Changes the exclusive role holder of roleId to newMember.

Reverts if the caller is not a member of the managing role for roleId or if roleId is not an initialized, exclusive role.

getMember(uint256 roleId) → address public

Gets the current holder of the exclusive role, roleId.

Reverts if roleId does not represent an initialized, exclusive role.

addMember(uint256 roleId, address newMember) public

Adds newMember to the shared role, roleId.

Reverts if roleId does not represent an initialized, shared role or if the caller is not a member of the managing role for roleId.

removeMember(uint256 roleId, address memberToRemove) public

Removes memberToRemove from the shared role, roleId.

Reverts if roleId does not represent an initialized, shared role or if the caller is not a member of the managing role for roleId.

_createSharedRole(uint256 roleId, uint256 managingRoleId, address[] initialMembers) internal

Internal method to initialize a shared role, roleId, which will be managed by managingRoleId. initialMembers will be immediately added to the role.

Should be called by derived contracts, usually at construction time. Will revert if the role is already initialized.

_createExclusiveRole(uint256 roleId, uint256 managingRoleId, address initialMember) internal

Internal method to initialize a exclusive role, roleId, which will be managed by managingRoleId. initialMembers will be immediately added to the role.

Should be called by derived contracts, usually at construction time. Will revert if the role is already initialized.

NewFixedOracleFeePerSecond(struct FixedPoint.Unsigned newOracleFee) event

EVENTS

© UMA Project 2018-2019