Overview
ETH Balance
More Info
ContractCreator
Multichain Info
Latest 25 from a total of 20,149 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Update Data | 240529427 | 21 mins ago | IN | 0 ETH | 0.00001757 | ||||
| Update Data | 240523046 | 51 mins ago | IN | 0 ETH | 0.00001745 | ||||
| Update Data | 240516544 | 1 hr ago | IN | 0 ETH | 0.00001757 | ||||
| Update Data | 240509941 | 1 hr ago | IN | 0 ETH | 0.00001792 | ||||
| Update Data | 240503564 | 2 hrs ago | IN | 0 ETH | 0.00001986 | ||||
| Batch Add Feeds | 240500326 | 2 hrs ago | IN | 0 ETH | 0.00000668 | ||||
| Batch Add Feeds | 240500298 | 2 hrs ago | IN | 0 ETH | 0.00000669 | ||||
| Update Data | 240496827 | 2 hrs ago | IN | 0 ETH | 0.00001785 | ||||
| Update Data | 240490089 | 3 hrs ago | IN | 0 ETH | 0.00001739 | ||||
| Update Data | 240483423 | 3 hrs ago | IN | 0 ETH | 0.00001748 | ||||
| Update Data | 240476678 | 4 hrs ago | IN | 0 ETH | 0.0000174 | ||||
| Update Data | 240469862 | 4 hrs ago | IN | 0 ETH | 0.0000175 | ||||
| Update Data | 240463190 | 5 hrs ago | IN | 0 ETH | 0.00001747 | ||||
| Update Data | 240456324 | 5 hrs ago | IN | 0 ETH | 0.00001754 | ||||
| Update Data | 240449465 | 6 hrs ago | IN | 0 ETH | 0.00001752 | ||||
| Update Data | 240442684 | 6 hrs ago | IN | 0 ETH | 0.00001776 | ||||
| Update Data | 240435839 | 7 hrs ago | IN | 0 ETH | 0.00001753 | ||||
| Update Data | 240428977 | 7 hrs ago | IN | 0 ETH | 0.00001755 | ||||
| Update Data | 240422252 | 8 hrs ago | IN | 0 ETH | 0.00001762 | ||||
| Update Data | 240416401 | 8 hrs ago | IN | 0 ETH | 0.00001749 | ||||
| Update Data | 240410375 | 9 hrs ago | IN | 0 ETH | 0.00001746 | ||||
| Update Data | 240404727 | 9 hrs ago | IN | 0 ETH | 0.00001715 | ||||
| Update Data | 240398653 | 10 hrs ago | IN | 0 ETH | 0.00001779 | ||||
| Update Data | 240392314 | 10 hrs ago | IN | 0 ETH | 0.00001751 | ||||
| Update Data | 240385844 | 11 hrs ago | IN | 0 ETH | 0.00001711 |
Latest 1 internal transaction
| Parent Transaction Hash | Block | From | To | Amount | ||
|---|---|---|---|---|---|---|
| 109905349 | 410 days ago | Contract Creation | 0 ETH |
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x29EAA480...C8bdD1188 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {IFeedProviderBS} from "./interfaces/IFeedProviderBS.sol";
import {IDataStorageBS} from "./interfaces/IDataStorageBS.sol";
/**
* @title DataStorageBS
* @dev A contract which stores feed data and provides access control for reading and updating data.
*/
contract DataStorageBS is IFeedProviderBS, IDataStorageBS, AccessControl {
/**
* @dev role which allows read-only access to feed data
*/
bytes32 public constant FEED_READER_ROLE = keccak256("FEED_READER");
/**
* @dev role which allows updating feed data
*/
bytes32 public constant FEED_UPDATER_ROLE = keccak256("FEED_UPDATER");
/**
* @dev main data storage array for feed data
*/
int64[] private _data;
/**
* @dev Timestamps for each data point in `_data`, should always be the same
* length as `_data`.
*/
uint32[] private _timestamps;
/**
* @dev Mapping of feed keys to their index in `_data` and `_timestamps`,
* the index is 1-based to allow for 0 to represent "not found".
*/
mapping(bytes32 => uint256) private _feedIndexes;
/**
* @dev Version of the data stored in this contract.
*/
uint256 public version;
/**
* @dev constructor which sets the initial admin role
*/
constructor(address admin) {
_grantRole(DEFAULT_ADMIN_ROLE, admin);
}
/**
* External/public functions
*/
/**
* @dev Returns the latest data for a feed. Restricted to feed readers.
* @param feed the feed to get the latest data for
* @return the latest data for the feed - including the timestamp and value
*/
function getLatestFeedData(
Feed calldata feed
) external view onlyRole(FEED_READER_ROLE) returns (FeedData memory) {
bytes32 feedKey = _getFeedKey(feed);
uint256 index = _feedIndexes[feedKey];
if (index == 0) {
revert FeedNotFound(feed);
}
return
FeedData({
value: _data[index - 1],
timestamp: _timestamps[index - 1]
});
}
/**
* @dev Updates the data for all feeds in a single batch. Restricted to feed updaters.
* @param values the new values
* @param timestamps the timestamps for the new data
*/
function updateData(
int64[] calldata values,
uint32[] calldata timestamps
)
external
onlyRole(FEED_UPDATER_ROLE)
validateDataLengths(values, timestamps)
{
_data = values;
_timestamps = timestamps;
emit DataUpdated();
}
/**
* @dev Updates the data for a single feed. Restricted to feed updaters.
* @param input the feed to update and the new data
*/
function updateDataForFeed(
UpdateDataForFeedInput calldata input
) external onlyRole(FEED_UPDATER_ROLE) {
_updateDataForFeed(input);
}
/**
* @dev Updates the data for multiple feeds in a single batch. Restricted to feed updaters.
* @param input the feeds to update and the new data
*/
function batchUpdateDataForFeeds(
UpdateDataForFeedInput[] calldata input
) external onlyRole(FEED_UPDATER_ROLE) {
uint256 inputLength = input.length;
for (uint256 i = 0; i < inputLength; i++) {
_updateDataForFeed(input[i]);
}
}
/**
* @dev Adds a new feed with data. Restricted to feed updaters.
* @param input the feed to add and the new data
*/
function addFeed(
AddFeedWithValueInput calldata input
) external onlyRole(FEED_UPDATER_ROLE) {
_addFeed(input);
}
/**
* @dev Adds multiple feeds with data in a single batch. Restricted to feed updaters.
* @param input the feeds to add and the new data
*/
function batchAddFeeds(
AddFeedWithValueInput[] calldata input
) external onlyRole(FEED_UPDATER_ROLE) {
uint256 inputLength = input.length;
for (uint256 i = 0; i < inputLength; i++) {
_addFeed(input[i]);
}
}
/**
* @dev Adds multiple feeds with data in a single batch. Restricted to feed updaters.
* @param input the feeds to add and the new data
* @param values the new values
* @param timestamps the timestamps for the new data
*/
function batchAddFeedsAndUpdateData(
AddFeedInput[] calldata input,
int64[] calldata values,
uint32[] calldata timestamps
)
external
onlyRole(FEED_UPDATER_ROLE)
validateDataLengths(values, timestamps)
{
uint256 inputLength = input.length;
for (uint256 i = 0; i < inputLength; i++) {
_addFeedIndex(input[i].feed, input[i].index);
}
_data = values;
_timestamps = timestamps;
emit DataUpdated();
}
/**
* @dev Removes a feed. Restricted to feed updaters.
* @param feed the feed to remove
*/
function removeFeed(
Feed calldata feed
) external onlyRole(FEED_UPDATER_ROLE) {
_removeFeed(feed);
}
/**
* @dev Removes multiple feeds in a single batch. Restricted to feed updaters.
* @param feeds the feeds to remove
*/
function batchRemoveFeeds(
Feed[] calldata feeds
) external onlyRole(FEED_UPDATER_ROLE) {
uint256 feedsLength = feeds.length;
for (uint256 i = 0; i < feedsLength; i++) {
_removeFeed(feeds[i]);
}
}
/**
* Internal functions
*/
/**
* @dev Updates the data for a single feed.
* @param input the feed to update and the new data
*/
function _updateDataForFeed(
UpdateDataForFeedInput calldata input
) internal {
bytes32 feedKey = _getFeedKey(input.feed);
uint256 index = _feedIndexes[feedKey];
if (index == 0) {
revert FeedNotFound(input.feed);
}
_updateDataAtIndex(index - 1, input.value, input.timestamp);
emit DataUpdatedForFeed(input);
}
/**
* @dev Adds a new feed with data.
* @param input the feed to add and the new data
*/
function _addFeed(AddFeedWithValueInput calldata input) internal {
_addFeedIndex(input.update.feed, input.index);
_updateDataAtIndex(
input.index,
input.update.value,
input.update.timestamp
);
}
/**
* @dev Adds a new feed index to the mapping.
* @param feed the feed to add
* @param index the index to add
*/
function _addFeedIndex(Feed calldata feed, uint256 index) internal {
bytes32 feedKey = _getFeedKey(feed);
if (_feedIndexes[feedKey] != 0) {
revert FeedConflict(feed);
}
// We add 1 to the index because 0 is reserved for "not found"
_feedIndexes[feedKey] = index + 1;
emit FeedAdded(feed, index);
}
/**
* @dev Removes a feed.
* @param feed the feed to remove
*/
function _removeFeed(Feed calldata feed) internal {
bytes32 feedKey = _getFeedKey(feed);
uint256 index = _feedIndexes[feedKey];
if (index == 0) {
revert FeedNotFound(feed);
}
delete _feedIndexes[feedKey];
// Explicitly set the data for the deleted index to 0. This could be
// skipped to save a small amount of gas but we are including it for
// now to provide extra safety.
_updateDataAtIndex(index - 1, 0, 0);
emit FeedRemoved(feed);
}
/**
* @dev Returns the key for a feed by hashing the feed id and parameters.
* This is used as the key in the `_feedIndexes` mapping.
* @param feed the feed to get the key for
* @return the feed key
*/
function _getFeedKey(Feed memory feed) internal view returns (bytes32) {
return keccak256(abi.encode(feed.id, version, feed.parameters));
}
/**
* @dev Updates the data at a specific index.
* @param index the index to update
* @param value the new value
* @param timestamp the new timestamp
*/
function _updateDataAtIndex(
uint256 index,
int64 value,
uint32 timestamp
) internal {
assert(_data.length == _timestamps.length);
// Allow appending a single item to the end of the array.
if (index == _data.length) {
_data.push(value);
_timestamps.push(timestamp);
} else if (index < _data.length) {
_data[index] = value;
_timestamps[index] = timestamp;
} else {
revert InvalidFeedIndex(index);
}
}
/**
* @dev Reverts if the lengths of the values and timestamps do not match.
* @param values the values to check
* @param timestamps the timestamps to check
*/
modifier validateDataLengths(
int64[] calldata values,
uint32[] calldata timestamps
) {
if (values.length != timestamps.length) {
revert DataTimestampMismatch();
}
_;
}
/**
* @dev Function to reset the data. Intended for emergency use only.
*/
function resetData() external onlyRole(DEFAULT_ADMIN_ROLE) {
delete _data;
delete _timestamps;
version++;
emit DataReset();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;
import {IFeedProviderBS} from "./IFeedProviderBS.sol";
interface IDataStorageBS {
// DataUpdater methods
/**
* @dev Updates the data for all feeds in a single batch. Restricted to feed updaters.
* @param values the new values
* @param timestamps the timestamps for the new data
*/
function updateData(
int64[] calldata values,
uint32[] calldata timestamps
) external;
/**
* @dev Updates the data for a single feed. Restricted to feed updaters.
* @param input the feed to update and the new data
*/
function updateDataForFeed(UpdateDataForFeedInput calldata input) external;
/**
* @dev Updates the data for multiple feeds in a single batch. Restricted to feed updaters.
* @param input the feeds to update and the new data
*/
function batchUpdateDataForFeeds(
UpdateDataForFeedInput[] calldata input
) external;
/**
* @dev Adds a new feed with data. Restricted to feed updaters.
* @param input the feed to add and the new data
*/
function addFeed(AddFeedWithValueInput calldata input) external;
/**
* @dev Adds multiple feeds with data in a single batch. Restricted to feed updaters.
* @param input the feeds to add and the new data
*/
function batchAddFeeds(AddFeedWithValueInput[] calldata input) external;
/**
* @dev Adds multiple feeds with data in a single batch. Restricted to feed updaters.
* @param input the feeds to add and the new data
* @param values the new values
* @param timestamps the timestamps for the new data
*/
function batchAddFeedsAndUpdateData(
AddFeedInput[] calldata input,
int64[] calldata values,
uint32[] calldata timestamps
) external;
/**
* @dev Removes a feed. Restricted to feed updaters.
* @param feed the feed to remove
*/
function removeFeed(IFeedProviderBS.Feed calldata feed) external;
/**
* @dev Removes multiple feeds in a single batch. Restricted to feed updaters.
* @param feeds the feeds to remove
*/
function batchRemoveFeeds(IFeedProviderBS.Feed[] calldata feeds) external;
// Types
/**
* @dev input for updating data for a feed
*/
struct UpdateDataForFeedInput {
IFeedProviderBS.Feed feed;
int64 value;
uint32 timestamp;
}
/**
* @dev input for adding a feed
*/
struct AddFeedInput {
IFeedProviderBS.Feed feed;
uint256 index;
}
/**
* @dev input for adding a feed with data
*/
struct AddFeedWithValueInput {
UpdateDataForFeedInput update;
uint256 index;
}
// Events
/**
* @dev emitted when a feed is added
*/
event FeedAdded(IFeedProviderBS.Feed feed, uint256 index);
/**
* @dev emitted when a feed is removed
*/
event FeedRemoved(IFeedProviderBS.Feed feed);
/**
* @dev emitted when the data is updated
*/
event DataUpdated();
/**
* @dev emitted when the data for a feed is updated
*/
event DataUpdatedForFeed(UpdateDataForFeedInput input);
/**
* @dev emitted when the data is reset
*/
event DataReset();
// Custom errors
/**
* @dev error when a feed is not found
*/
error FeedNotFound(IFeedProviderBS.Feed feed);
/**
* @dev error when adding a feed that already exists
*/
error FeedConflict(IFeedProviderBS.Feed feed);
/**
* @dev error when an invalid feed index is specified
*/
error InvalidFeedIndex(uint256 index);
/**
* @dev error when the data and timestamp lengths are mismatched
*/
error DataTimestampMismatch();
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;
// Common interface implemented by both DataStorageBS and DerivedData contracts,
// used by the AccessControl contract to read feed data in a uniform way.
/**
* @title IFeedProviderBS
* @dev common interface for feed providers to implement
*/
interface IFeedProviderBS {
/**
* @dev identifier for a single feed
*/
struct Feed {
uint32 id;
FeedParameters parameters;
}
/**
* @dev parameters for a feed
*/
struct FeedParameters {
uint8[] enumerable;
// If required, additional parameters can be passed as bytes. These
// should be encoded by the client as one of the struct types defined
// below.
bytes other;
}
/**
* @dev output data for a feed
*/
struct FeedData {
int64 value;
uint32 timestamp;
}
/**
* @dev get the latest feed data
* @param feed the feed to get data for
* @return the latest feed data
*/
function getLatestFeedData(
Feed memory feed
) external view returns (FeedData memory);
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract ABI
API[{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"DataTimestampMismatch","type":"error"},{"inputs":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"}],"name":"FeedConflict","type":"error"},{"inputs":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"}],"name":"FeedNotFound","type":"error"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"InvalidFeedIndex","type":"error"},{"anonymous":false,"inputs":[],"name":"DataReset","type":"event"},{"anonymous":false,"inputs":[],"name":"DataUpdated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"},{"internalType":"int64","name":"value","type":"int64"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct IDataStorageBS.UpdateDataForFeedInput","name":"input","type":"tuple"}],"name":"DataUpdatedForFeed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"indexed":false,"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"FeedAdded","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"indexed":false,"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"}],"name":"FeedRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEED_READER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEED_UPDATER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"},{"internalType":"int64","name":"value","type":"int64"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct IDataStorageBS.UpdateDataForFeedInput","name":"update","type":"tuple"},{"internalType":"uint256","name":"index","type":"uint256"}],"internalType":"struct IDataStorageBS.AddFeedWithValueInput","name":"input","type":"tuple"}],"name":"addFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"},{"internalType":"int64","name":"value","type":"int64"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct IDataStorageBS.UpdateDataForFeedInput","name":"update","type":"tuple"},{"internalType":"uint256","name":"index","type":"uint256"}],"internalType":"struct IDataStorageBS.AddFeedWithValueInput[]","name":"input","type":"tuple[]"}],"name":"batchAddFeeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"},{"internalType":"uint256","name":"index","type":"uint256"}],"internalType":"struct IDataStorageBS.AddFeedInput[]","name":"input","type":"tuple[]"},{"internalType":"int64[]","name":"values","type":"int64[]"},{"internalType":"uint32[]","name":"timestamps","type":"uint32[]"}],"name":"batchAddFeedsAndUpdateData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed[]","name":"feeds","type":"tuple[]"}],"name":"batchRemoveFeeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"},{"internalType":"int64","name":"value","type":"int64"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct IDataStorageBS.UpdateDataForFeedInput[]","name":"input","type":"tuple[]"}],"name":"batchUpdateDataForFeeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"}],"name":"getLatestFeedData","outputs":[{"components":[{"internalType":"int64","name":"value","type":"int64"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct IFeedProviderBS.FeedData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"}],"name":"removeFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int64[]","name":"values","type":"int64[]"},{"internalType":"uint32[]","name":"timestamps","type":"uint32[]"}],"name":"updateData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint32","name":"id","type":"uint32"},{"components":[{"internalType":"uint8[]","name":"enumerable","type":"uint8[]"},{"internalType":"bytes","name":"other","type":"bytes"}],"internalType":"struct IFeedProviderBS.FeedParameters","name":"parameters","type":"tuple"}],"internalType":"struct IFeedProviderBS.Feed","name":"feed","type":"tuple"},{"internalType":"int64","name":"value","type":"int64"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct IDataStorageBS.UpdateDataForFeedInput","name":"input","type":"tuple"}],"name":"updateDataForFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60806040523480156200001157600080fd5b5060405162001b7438038062001b748339810160408190526200003491620000f8565b6200004160008262000049565b50506200012a565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16620000ee576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000a53390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001620000f2565b5060005b92915050565b6000602082840312156200010b57600080fd5b81516001600160a01b03811681146200012357600080fd5b9392505050565b611a3a806200013a6000396000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806391d14854116100cd578063d0f845d911610081578063e26d7cbb11610066578063e26d7cbb14610325578063fc185eac1461034c578063fdee84ec1461035f57600080fd5b8063d0f845d9146102ff578063d547741f1461031257600080fd5b8063a01a25be116100b2578063a01a25be146102d1578063a217fddf146102e4578063be547fd1146102ec57600080fd5b806391d14854146102875780639d25ac9c146102be57600080fd5b806336568abe11610124578063478c4e0e11610109578063478c4e0e1461024f57806354fd4d5014610257578063715e80271461026057600080fd5b806336568abe1461022957806336bff88a1461023c57600080fd5b8063248a9ca311610155578063248a9ca3146101d057806326bbeb22146102015780632f2ff15d1461021657600080fd5b806301ffc9a71461017157806318a849e714610199575b600080fd5b61018461017f366004611172565b610372565b60405190151581526020015b60405180910390f35b6101ac6101a73660046111d3565b61040b565b60408051825160070b815260209283015163ffffffff169281019290925201610190565b6101f36101de366004611210565b60009081526020819052604090206001015490565b604051908152602001610190565b61021461020f366004611275565b610533565b005b6102146102243660046112b7565b6105a4565b6102146102373660046112b7565b6105cf565b61021461024a3660046112f3565b610620565b610214610657565b6101f360045481565b6101f37f19a22b4ed5f5730a884e01f2c8a6d92fb7e11cc4b43582af04e27283221bd3f181565b6101846102953660046112b7565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6102146102cc3660046111d3565b6106bb565b6102146102df366004611275565b6106ee565b6101f3600081565b6102146102fa3660046111d3565b610758565b61021461030d366004611275565b61078b565b6102146103203660046112b7565b6107f5565b6101f37f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff2181565b61021461035a36600461132e565b61081a565b61021461036d36600461139a565b6108b6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061040557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60408051808201909152600080825260208201527f19a22b4ed5f5730a884e01f2c8a6d92fb7e11cc4b43582af04e27283221bd3f1610449816109c8565b600061045c6104578561153e565b6109d5565b6000818152600360205260408120549192508190036104995784604051638076a65960e01b815260040161049091906117be565b60405180910390fd5b6040518060400160405280600180846104b291906117e7565b815481106104c2576104c26117fa565b600091825260209182902060048204015460039091166008026101000a900460070b82520160026104f46001856117e7565b81548110610504576105046117fa565b6000918252602090912060088204015460079091166004026101000a900463ffffffff16905295945050505050565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff2161055d816109c8565b8160005b8181101561059d5761059585858381811061057e5761057e6117fa565b90506020028101906105909190611810565b610a13565b600101610561565b5050505050565b6000828152602081905260409020600101546105bf816109c8565b6105c98383610a77565b50505050565b6001600160a01b0381163314610611576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61061b8282610b21565b505050565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff2161064a816109c8565b61065382610ba4565b5050565b6000610662816109c8565b61066e60016000610fbb565b61067a60026000610fe0565b6004805490600061068a83611830565b90915550506040517f4070f902b7aba2d975c06dcf711c1881202fab142511c113e8f1e87c270b967f90600090a150565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff216106e5816109c8565b61065382610c63565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff21610718816109c8565b8160005b8181101561059d57610750858583818110610739576107396117fa565b905060200281019061074b9190611810565b610c63565b60010161071c565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff21610782816109c8565b61065382610a13565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff216107b5816109c8565b8160005b8181101561059d576107ed8585838181106107d6576107d66117fa565b90506020028101906107e89190611849565b610ba4565b6001016107b9565b600082815260208190526040902060010154610810816109c8565b6105c98383610b21565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff21610844816109c8565b84848484808314610868576040516303b0205760e31b815260040160405180910390fd5b61087460018a8a611005565b50610881600288886110ba565b506040517f0338bfbdafb8aabb328abde5acfe20059c4c051ba2d9c13b41fa03b3bc9e637a90600090a1505050505050505050565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff216108e0816109c8565b84848484808314610904576040516303b0205760e31b815260040160405180910390fd5b8960005b818110156109765761096e8d8d83818110610925576109256117fa565b90506020028101906109379190611810565b6109419080611810565b8e8e84818110610953576109536117fa565b90506020028101906109659190611810565b60200135610cf9565b600101610908565b5061098360018b8b611005565b50610990600289896110ba565b506040517f0338bfbdafb8aabb328abde5acfe20059c4c051ba2d9c13b41fa03b3bc9e637a90600090a1505050505050505050505050565b6109d28133610da0565b50565b6000816000015160045483602001516040516020016109f69392919061185f565b604051602081830303815290604052805190602001209050919050565b610a34610a208280611849565b610a2a9080611810565b8260200135610cf9565b6109d26020820135610a468380611849565b610a57906040810190602001611928565b610a618480611849565b610a72906060810190604001611943565b610e0c565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610b19576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610ad13390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610405565b506000610405565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1615610b19576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610405565b6000610bbc610bb38380611810565b6104579061153e565b600081815260036020526040812054919250819003610bf957610bdf8380611810565b604051638076a65960e01b815260040161049091906117be565b610c27610c076001836117e7565b610c176040860160208701611928565b610a726060870160408801611943565b7f43c8fb6eddf7716ffbedae42c708ff0dabd8244e2460a49d0657e554c248c14983604051610c56919061195e565b60405180910390a1505050565b6000610c716104578361153e565b600081815260036020526040812054919250819003610ca55782604051638076a65960e01b815260040161049091906117be565b600082815260036020526040812055610cca610cc26001836117e7565b600080610e0c565b7f5f399ffb37a9961eb1b5d5a55548186234fb36a393f591e9732ed19b772fc6f383604051610c5691906117be565b6000610d076104578461153e565b60008181526003602052604090205490915015610d5257826040517fdc195c6300000000000000000000000000000000000000000000000000000000815260040161049091906117be565b610d5d8260016119b9565b6000828152600360205260409081902091909155517eba2e3e76875770608bc2caaa501d4a3ee6ec06da9022589e9db147bcfacfdf90610c5690859085906119cc565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610653576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101839052604401610490565b60025460015414610e1f57610e1f6119ee565b6001548303610ede5760018054808201825560048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805467ffffffffffffffff80881660086003909616860261010090810a9182029290910219909216179091556002805494850181556000529183047f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01805463ffffffff80871660079690961690930290930a9384029190930219909116179055505050565b600154831015610f86578160018481548110610efc57610efc6117fa565b90600052602060002090600491828204019190066008026101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055508060028481548110610f4e57610f4e6117fa565b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff160217905550505050565b6040517f9e62808900000000000000000000000000000000000000000000000000000000815260048101849052602401610490565b5080546000825560030160049004906000526020600020908101906109d2919061115d565b5080546000825560070160089004906000526020600020908101906109d2919061115d565b828054828255906000526020600020906003016004900481019282156110aa5791602002820160005b8382111561107457825467ffffffffffffffff8535811661010084900a908102910219909116178355602093840193600f8201049283019260010360089091010261102e565b80156110a85782816101000a81549067ffffffffffffffff0219169055600801602081600701049283019260010302611074565b505b506110b692915061115d565b5090565b828054828255906000526020600020906007016008900481019282156110aa5791602002820160005b8382111561112d57833563ffffffff1683826101000a81548163ffffffff021916908363ffffffff16021790555092602001926004016020816003010492830192600103026110e3565b80156110a85782816101000a81549063ffffffff021916905560040160208160030104928301926001030261112d565b5b808211156110b6576000815560010161115e565b60006020828403121561118457600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146111b457600080fd5b9392505050565b6000604082840312156111cd57600080fd5b50919050565b6000602082840312156111e557600080fd5b813567ffffffffffffffff8111156111fc57600080fd5b611208848285016111bb565b949350505050565b60006020828403121561122257600080fd5b5035919050565b60008083601f84011261123b57600080fd5b50813567ffffffffffffffff81111561125357600080fd5b6020830191508360208260051b850101111561126e57600080fd5b9250929050565b6000806020838503121561128857600080fd5b823567ffffffffffffffff81111561129f57600080fd5b6112ab85828601611229565b90969095509350505050565b600080604083850312156112ca57600080fd5b8235915060208301356001600160a01b03811681146112e857600080fd5b809150509250929050565b60006020828403121561130557600080fd5b813567ffffffffffffffff81111561131c57600080fd5b8201606081850312156111b457600080fd5b6000806000806040858703121561134457600080fd5b843567ffffffffffffffff8082111561135c57600080fd5b61136888838901611229565b9096509450602087013591508082111561138157600080fd5b5061138e87828801611229565b95989497509550505050565b600080600080600080606087890312156113b357600080fd5b863567ffffffffffffffff808211156113cb57600080fd5b6113d78a838b01611229565b909850965060208901359150808211156113f057600080fd5b6113fc8a838b01611229565b9096509450604089013591508082111561141557600080fd5b5061142289828a01611229565b979a9699509497509295939492505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561146d5761146d611434565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561149c5761149c611434565b604052919050565b803563ffffffff811681146114b857600080fd5b919050565b803560ff811681146114b857600080fd5b600082601f8301126114df57600080fd5b813567ffffffffffffffff8111156114f9576114f9611434565b61150c601f8201601f1916602001611473565b81815284602083860101111561152157600080fd5b816020850160208301376000918101602001919091529392505050565b60006040823603121561155057600080fd5b61155861144a565b611561836114a4565b815260208084013567ffffffffffffffff8082111561157f57600080fd5b81860191506040823603121561159457600080fd5b61159c61144a565b8235828111156115ab57600080fd5b830136601f8201126115bc57600080fd5b8035838111156115ce576115ce611434565b8060051b6115dd878201611473565b91825282810187019187810190368411156115f757600080fd5b938801935b8385101561161c5761160d856114bd565b825293880193908801906115fc565b855250505050828401358281111561163357600080fd5b61163f368286016114ce565b82860152509284019290925250909392505050565b60008235603e1983360301811261166a57600080fd5b90910192915050565b6000808335601e1984360301811261168a57600080fd5b830160208101925035905067ffffffffffffffff8111156116aa57600080fd5b80360382131561126e57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b63ffffffff6116f0826114a4565b1682526000602061170381840184611654565b604082860152608085018135601e1983360301811261172157600080fd5b8201838101903567ffffffffffffffff81111561173d57600080fd5b8060051b360382131561174f57600080fd5b604088810152918290529060009060a088015b8183101561178a5760ff611775856114bd565b16815292850192600192909201918501611762565b61179686860186611673565b8a8303603f190160608c0152965094506117b18187876116b9565b9998505050505050505050565b6020815260006111b460208301846116e2565b634e487b7160e01b600052601160045260246000fd5b81810381811115610405576104056117d1565b634e487b7160e01b600052603260045260246000fd5b60008235603e1983360301811261182657600080fd5b9190910192915050565b600060018201611842576118426117d1565b5060010190565b60008235605e1983360301811261182657600080fd5b63ffffffff841681526000602084818401526060604084015260a0830184516040606086015281815180845260c0870191508483019350600092505b808310156118be57835160ff16825292840192600192909201919084019061189b565b50838701519250605f198682030160808701528251915081815260005b828110156118f65783810185015182820186015284016118db565b506000818301850152601f909101601f1916019091019695505050505050565b8035600781900b81146114b857600080fd5b60006020828403121561193a57600080fd5b6111b482611916565b60006020828403121561195557600080fd5b6111b4826114a4565b60208152600061196e8384611654565b6060602084015261198260808401826116e2565b905061199060208501611916565b60070b604084015263ffffffff6119a9604086016114a4565b1660608401528091505092915050565b80820180821115610405576104056117d1565b6040815260006119df60408301856116e2565b90508260208301529392505050565b634e487b7160e01b600052600160045260246000fdfea26469706673582212201d1def3d202b770dfc0d5360433a81b06076ff8dc0da05bd7636e7158276ecd764736f6c63430008180033000000000000000000000000a77c2b72773e2442cd0f5352af21bcc4dbea16ec
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061016c5760003560e01c806391d14854116100cd578063d0f845d911610081578063e26d7cbb11610066578063e26d7cbb14610325578063fc185eac1461034c578063fdee84ec1461035f57600080fd5b8063d0f845d9146102ff578063d547741f1461031257600080fd5b8063a01a25be116100b2578063a01a25be146102d1578063a217fddf146102e4578063be547fd1146102ec57600080fd5b806391d14854146102875780639d25ac9c146102be57600080fd5b806336568abe11610124578063478c4e0e11610109578063478c4e0e1461024f57806354fd4d5014610257578063715e80271461026057600080fd5b806336568abe1461022957806336bff88a1461023c57600080fd5b8063248a9ca311610155578063248a9ca3146101d057806326bbeb22146102015780632f2ff15d1461021657600080fd5b806301ffc9a71461017157806318a849e714610199575b600080fd5b61018461017f366004611172565b610372565b60405190151581526020015b60405180910390f35b6101ac6101a73660046111d3565b61040b565b60408051825160070b815260209283015163ffffffff169281019290925201610190565b6101f36101de366004611210565b60009081526020819052604090206001015490565b604051908152602001610190565b61021461020f366004611275565b610533565b005b6102146102243660046112b7565b6105a4565b6102146102373660046112b7565b6105cf565b61021461024a3660046112f3565b610620565b610214610657565b6101f360045481565b6101f37f19a22b4ed5f5730a884e01f2c8a6d92fb7e11cc4b43582af04e27283221bd3f181565b6101846102953660046112b7565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6102146102cc3660046111d3565b6106bb565b6102146102df366004611275565b6106ee565b6101f3600081565b6102146102fa3660046111d3565b610758565b61021461030d366004611275565b61078b565b6102146103203660046112b7565b6107f5565b6101f37f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff2181565b61021461035a36600461132e565b61081a565b61021461036d36600461139a565b6108b6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061040557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60408051808201909152600080825260208201527f19a22b4ed5f5730a884e01f2c8a6d92fb7e11cc4b43582af04e27283221bd3f1610449816109c8565b600061045c6104578561153e565b6109d5565b6000818152600360205260408120549192508190036104995784604051638076a65960e01b815260040161049091906117be565b60405180910390fd5b6040518060400160405280600180846104b291906117e7565b815481106104c2576104c26117fa565b600091825260209182902060048204015460039091166008026101000a900460070b82520160026104f46001856117e7565b81548110610504576105046117fa565b6000918252602090912060088204015460079091166004026101000a900463ffffffff16905295945050505050565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff2161055d816109c8565b8160005b8181101561059d5761059585858381811061057e5761057e6117fa565b90506020028101906105909190611810565b610a13565b600101610561565b5050505050565b6000828152602081905260409020600101546105bf816109c8565b6105c98383610a77565b50505050565b6001600160a01b0381163314610611576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61061b8282610b21565b505050565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff2161064a816109c8565b61065382610ba4565b5050565b6000610662816109c8565b61066e60016000610fbb565b61067a60026000610fe0565b6004805490600061068a83611830565b90915550506040517f4070f902b7aba2d975c06dcf711c1881202fab142511c113e8f1e87c270b967f90600090a150565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff216106e5816109c8565b61065382610c63565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff21610718816109c8565b8160005b8181101561059d57610750858583818110610739576107396117fa565b905060200281019061074b9190611810565b610c63565b60010161071c565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff21610782816109c8565b61065382610a13565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff216107b5816109c8565b8160005b8181101561059d576107ed8585838181106107d6576107d66117fa565b90506020028101906107e89190611849565b610ba4565b6001016107b9565b600082815260208190526040902060010154610810816109c8565b6105c98383610b21565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff21610844816109c8565b84848484808314610868576040516303b0205760e31b815260040160405180910390fd5b61087460018a8a611005565b50610881600288886110ba565b506040517f0338bfbdafb8aabb328abde5acfe20059c4c051ba2d9c13b41fa03b3bc9e637a90600090a1505050505050505050565b7f6d0e0133a1457edff2e4e094948d00eaf179fef2a6289f55f577d0172146ff216108e0816109c8565b84848484808314610904576040516303b0205760e31b815260040160405180910390fd5b8960005b818110156109765761096e8d8d83818110610925576109256117fa565b90506020028101906109379190611810565b6109419080611810565b8e8e84818110610953576109536117fa565b90506020028101906109659190611810565b60200135610cf9565b600101610908565b5061098360018b8b611005565b50610990600289896110ba565b506040517f0338bfbdafb8aabb328abde5acfe20059c4c051ba2d9c13b41fa03b3bc9e637a90600090a1505050505050505050505050565b6109d28133610da0565b50565b6000816000015160045483602001516040516020016109f69392919061185f565b604051602081830303815290604052805190602001209050919050565b610a34610a208280611849565b610a2a9080611810565b8260200135610cf9565b6109d26020820135610a468380611849565b610a57906040810190602001611928565b610a618480611849565b610a72906060810190604001611943565b610e0c565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610b19576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610ad13390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610405565b506000610405565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1615610b19576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610405565b6000610bbc610bb38380611810565b6104579061153e565b600081815260036020526040812054919250819003610bf957610bdf8380611810565b604051638076a65960e01b815260040161049091906117be565b610c27610c076001836117e7565b610c176040860160208701611928565b610a726060870160408801611943565b7f43c8fb6eddf7716ffbedae42c708ff0dabd8244e2460a49d0657e554c248c14983604051610c56919061195e565b60405180910390a1505050565b6000610c716104578361153e565b600081815260036020526040812054919250819003610ca55782604051638076a65960e01b815260040161049091906117be565b600082815260036020526040812055610cca610cc26001836117e7565b600080610e0c565b7f5f399ffb37a9961eb1b5d5a55548186234fb36a393f591e9732ed19b772fc6f383604051610c5691906117be565b6000610d076104578461153e565b60008181526003602052604090205490915015610d5257826040517fdc195c6300000000000000000000000000000000000000000000000000000000815260040161049091906117be565b610d5d8260016119b9565b6000828152600360205260409081902091909155517eba2e3e76875770608bc2caaa501d4a3ee6ec06da9022589e9db147bcfacfdf90610c5690859085906119cc565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610653576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101839052604401610490565b60025460015414610e1f57610e1f6119ee565b6001548303610ede5760018054808201825560048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805467ffffffffffffffff80881660086003909616860261010090810a9182029290910219909216179091556002805494850181556000529183047f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01805463ffffffff80871660079690961690930290930a9384029190930219909116179055505050565b600154831015610f86578160018481548110610efc57610efc6117fa565b90600052602060002090600491828204019190066008026101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055508060028481548110610f4e57610f4e6117fa565b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff160217905550505050565b6040517f9e62808900000000000000000000000000000000000000000000000000000000815260048101849052602401610490565b5080546000825560030160049004906000526020600020908101906109d2919061115d565b5080546000825560070160089004906000526020600020908101906109d2919061115d565b828054828255906000526020600020906003016004900481019282156110aa5791602002820160005b8382111561107457825467ffffffffffffffff8535811661010084900a908102910219909116178355602093840193600f8201049283019260010360089091010261102e565b80156110a85782816101000a81549067ffffffffffffffff0219169055600801602081600701049283019260010302611074565b505b506110b692915061115d565b5090565b828054828255906000526020600020906007016008900481019282156110aa5791602002820160005b8382111561112d57833563ffffffff1683826101000a81548163ffffffff021916908363ffffffff16021790555092602001926004016020816003010492830192600103026110e3565b80156110a85782816101000a81549063ffffffff021916905560040160208160030104928301926001030261112d565b5b808211156110b6576000815560010161115e565b60006020828403121561118457600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146111b457600080fd5b9392505050565b6000604082840312156111cd57600080fd5b50919050565b6000602082840312156111e557600080fd5b813567ffffffffffffffff8111156111fc57600080fd5b611208848285016111bb565b949350505050565b60006020828403121561122257600080fd5b5035919050565b60008083601f84011261123b57600080fd5b50813567ffffffffffffffff81111561125357600080fd5b6020830191508360208260051b850101111561126e57600080fd5b9250929050565b6000806020838503121561128857600080fd5b823567ffffffffffffffff81111561129f57600080fd5b6112ab85828601611229565b90969095509350505050565b600080604083850312156112ca57600080fd5b8235915060208301356001600160a01b03811681146112e857600080fd5b809150509250929050565b60006020828403121561130557600080fd5b813567ffffffffffffffff81111561131c57600080fd5b8201606081850312156111b457600080fd5b6000806000806040858703121561134457600080fd5b843567ffffffffffffffff8082111561135c57600080fd5b61136888838901611229565b9096509450602087013591508082111561138157600080fd5b5061138e87828801611229565b95989497509550505050565b600080600080600080606087890312156113b357600080fd5b863567ffffffffffffffff808211156113cb57600080fd5b6113d78a838b01611229565b909850965060208901359150808211156113f057600080fd5b6113fc8a838b01611229565b9096509450604089013591508082111561141557600080fd5b5061142289828a01611229565b979a9699509497509295939492505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561146d5761146d611434565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561149c5761149c611434565b604052919050565b803563ffffffff811681146114b857600080fd5b919050565b803560ff811681146114b857600080fd5b600082601f8301126114df57600080fd5b813567ffffffffffffffff8111156114f9576114f9611434565b61150c601f8201601f1916602001611473565b81815284602083860101111561152157600080fd5b816020850160208301376000918101602001919091529392505050565b60006040823603121561155057600080fd5b61155861144a565b611561836114a4565b815260208084013567ffffffffffffffff8082111561157f57600080fd5b81860191506040823603121561159457600080fd5b61159c61144a565b8235828111156115ab57600080fd5b830136601f8201126115bc57600080fd5b8035838111156115ce576115ce611434565b8060051b6115dd878201611473565b91825282810187019187810190368411156115f757600080fd5b938801935b8385101561161c5761160d856114bd565b825293880193908801906115fc565b855250505050828401358281111561163357600080fd5b61163f368286016114ce565b82860152509284019290925250909392505050565b60008235603e1983360301811261166a57600080fd5b90910192915050565b6000808335601e1984360301811261168a57600080fd5b830160208101925035905067ffffffffffffffff8111156116aa57600080fd5b80360382131561126e57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b63ffffffff6116f0826114a4565b1682526000602061170381840184611654565b604082860152608085018135601e1983360301811261172157600080fd5b8201838101903567ffffffffffffffff81111561173d57600080fd5b8060051b360382131561174f57600080fd5b604088810152918290529060009060a088015b8183101561178a5760ff611775856114bd565b16815292850192600192909201918501611762565b61179686860186611673565b8a8303603f190160608c0152965094506117b18187876116b9565b9998505050505050505050565b6020815260006111b460208301846116e2565b634e487b7160e01b600052601160045260246000fd5b81810381811115610405576104056117d1565b634e487b7160e01b600052603260045260246000fd5b60008235603e1983360301811261182657600080fd5b9190910192915050565b600060018201611842576118426117d1565b5060010190565b60008235605e1983360301811261182657600080fd5b63ffffffff841681526000602084818401526060604084015260a0830184516040606086015281815180845260c0870191508483019350600092505b808310156118be57835160ff16825292840192600192909201919084019061189b565b50838701519250605f198682030160808701528251915081815260005b828110156118f65783810185015182820186015284016118db565b506000818301850152601f909101601f1916019091019695505050505050565b8035600781900b81146114b857600080fd5b60006020828403121561193a57600080fd5b6111b482611916565b60006020828403121561195557600080fd5b6111b4826114a4565b60208152600061196e8384611654565b6060602084015261198260808401826116e2565b905061199060208501611916565b60070b604084015263ffffffff6119a9604086016114a4565b1660608401528091505092915050565b80820180821115610405576104056117d1565b6040815260006119df60408301856116e2565b90508260208301529392505050565b634e487b7160e01b600052600160045260246000fdfea26469706673582212201d1def3d202b770dfc0d5360433a81b06076ff8dc0da05bd7636e7158276ecd764736f6c63430008180033
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.