Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MockScalingPriceOracle
Compiler Version
v0.8.10+commit.fc410830
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2022-04-08
*/
// Sources flattened with hardhat v2.8.2 https://hardhat.org
// File @openzeppelin/contracts/access/IAccessControl.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @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.
*
* _Available since v3.1._
*/
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 `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
// File @openzeppelin/contracts/utils/Context.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}
// File @openzeppelin/contracts/utils/Strings.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
// File @openzeppelin/contracts/utils/introspection/ERC165.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @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);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File @openzeppelin/contracts/access/AccessControl.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)
pragma solidity ^0.8.0;
/**
* @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:
*
* ```
* 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}:
*
* ```
* 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.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @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 override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @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 override 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.
*/
function grantRole(bytes32 role, address account) public virtual override 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.
*/
function revokeRole(bytes32 role, address account) public virtual override 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 `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @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 Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
// File contracts/core/IPermissionsRead.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title Permissions Read interface
/// @author Fei Protocol
interface IPermissionsRead {
// ----------- Getters -----------
function isBurner(address _address) external view returns (bool);
function isMinter(address _address) external view returns (bool);
function isGovernor(address _address) external view returns (bool);
function isGuardian(address _address) external view returns (bool);
function isPCVController(address _address) external view returns (bool);
}
// File contracts/core/IPermissions.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title Permissions interface
/// @author Fei Protocol
interface IPermissions is IAccessControl, IPermissionsRead {
// ----------- Governor only state changing api -----------
function createRole(bytes32 role, bytes32 adminRole) external;
function grantMinter(address minter) external;
function grantBurner(address burner) external;
function grantPCVController(address pcvController) external;
function grantGovernor(address governor) external;
function grantGuardian(address guardian) external;
function revokeMinter(address minter) external;
function revokeBurner(address burner) external;
function revokePCVController(address pcvController) external;
function revokeGovernor(address governor) external;
function revokeGuardian(address guardian) external;
// ----------- Revoker only state changing api -----------
function revokeOverride(bytes32 role, address account) external;
// ----------- Getters -----------
function GUARDIAN_ROLE() external view returns (bytes32);
function GOVERN_ROLE() external view returns (bytes32);
function BURNER_ROLE() external view returns (bytes32);
function MINTER_ROLE() external view returns (bytes32);
function PCV_CONTROLLER_ROLE() external view returns (bytes32);
}
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: 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:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File contracts/volt/IVolt.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title FEI stablecoin interface
/// @author Fei Protocol
interface IVolt is IERC20 {
// ----------- Events -----------
event Minting(
address indexed _to,
address indexed _minter,
uint256 _amount
);
event Burning(
address indexed _to,
address indexed _burner,
uint256 _amount
);
event IncentiveContractUpdate(
address indexed _incentivized,
address indexed _incentiveContract
);
// ----------- State changing api -----------
function burn(uint256 amount) external;
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
// ----------- Minter only state changing api -----------
function mint(address account, uint256 amount) external;
}
// File contracts/core/ICore.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title Core Interface
/// @author Fei Protocol
interface ICore is IPermissions {
// ----------- Events -----------
event VoltUpdate(IERC20 indexed _volt);
event VconUpdate(IERC20 indexed _vcon);
// ----------- Getters -----------
function volt() external view returns (IVolt);
function vcon() external view returns (IERC20);
}
// File contracts/refs/ICoreRef.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title CoreRef interface
/// @author Fei Protocol
interface ICoreRef {
// ----------- Events -----------
event CoreUpdate(address indexed oldCore, address indexed newCore);
event ContractAdminRoleUpdate(
bytes32 indexed oldContractAdminRole,
bytes32 indexed newContractAdminRole
);
// ----------- Governor only state changing api -----------
function setContractAdminRole(bytes32 newContractAdminRole) external;
// ----------- Governor or Guardian only state changing api -----------
function pause() external;
function unpause() external;
// ----------- Getters -----------
function core() external view returns (ICore);
function volt() external view returns (IVolt);
function vcon() external view returns (IERC20);
function voltBalance() external view returns (uint256);
function vconBalance() external view returns (uint256);
function CONTRACT_ADMIN_ROLE() external view returns (bytes32);
function isContractAdmin(address admin) external view returns (bool);
}
// File @openzeppelin/contracts/security/Pausable.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File contracts/refs/CoreRef.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title A Reference to Core
/// @author Fei Protocol
/// @notice defines some modifiers and utilities around interacting with Core
abstract contract CoreRef is ICoreRef, Pausable {
ICore private immutable _core;
IVolt private immutable _volt;
IERC20 private immutable _vcon;
/// @notice a role used with a subset of governor permissions for this contract only
bytes32 public override CONTRACT_ADMIN_ROLE;
constructor(address coreAddress) {
_core = ICore(coreAddress);
_volt = ICore(coreAddress).volt();
_vcon = ICore(coreAddress).vcon();
_setContractAdminRole(ICore(coreAddress).GOVERN_ROLE());
}
function _initialize() internal {} // no-op for backward compatibility
modifier ifMinterSelf() {
if (_core.isMinter(address(this))) {
_;
}
}
modifier onlyMinter() {
require(_core.isMinter(msg.sender), "CoreRef: Caller is not a minter");
_;
}
modifier onlyBurner() {
require(_core.isBurner(msg.sender), "CoreRef: Caller is not a burner");
_;
}
modifier onlyPCVController() {
require(
_core.isPCVController(msg.sender),
"CoreRef: Caller is not a PCV controller"
);
_;
}
modifier onlyGovernorOrAdmin() {
require(
_core.isGovernor(msg.sender) || isContractAdmin(msg.sender),
"CoreRef: Caller is not a governor or contract admin"
);
_;
}
modifier onlyGovernor() {
require(
_core.isGovernor(msg.sender),
"CoreRef: Caller is not a governor"
);
_;
}
modifier onlyGuardianOrGovernor() {
require(
_core.isGovernor(msg.sender) || _core.isGuardian(msg.sender),
"CoreRef: Caller is not a guardian or governor"
);
_;
}
modifier onlyGovernorOrGuardianOrAdmin() {
require(
_core.isGovernor(msg.sender) ||
_core.isGuardian(msg.sender) ||
isContractAdmin(msg.sender),
"CoreRef: Caller is not governor or guardian or admin"
);
_;
}
// Named onlyTribeRole to prevent collision with OZ onlyRole modifier
modifier onlyTribeRole(bytes32 role) {
require(_core.hasRole(role, msg.sender), "UNAUTHORIZED");
_;
}
// Modifiers to allow any combination of roles
modifier hasAnyOfTwoRoles(bytes32 role1, bytes32 role2) {
require(
_core.hasRole(role1, msg.sender) ||
_core.hasRole(role2, msg.sender),
"UNAUTHORIZED"
);
_;
}
modifier hasAnyOfThreeRoles(
bytes32 role1,
bytes32 role2,
bytes32 role3
) {
require(
_core.hasRole(role1, msg.sender) ||
_core.hasRole(role2, msg.sender) ||
_core.hasRole(role3, msg.sender),
"UNAUTHORIZED"
);
_;
}
modifier hasAnyOfFourRoles(
bytes32 role1,
bytes32 role2,
bytes32 role3,
bytes32 role4
) {
require(
_core.hasRole(role1, msg.sender) ||
_core.hasRole(role2, msg.sender) ||
_core.hasRole(role3, msg.sender) ||
_core.hasRole(role4, msg.sender),
"UNAUTHORIZED"
);
_;
}
modifier hasAnyOfFiveRoles(
bytes32 role1,
bytes32 role2,
bytes32 role3,
bytes32 role4,
bytes32 role5
) {
require(
_core.hasRole(role1, msg.sender) ||
_core.hasRole(role2, msg.sender) ||
_core.hasRole(role3, msg.sender) ||
_core.hasRole(role4, msg.sender) ||
_core.hasRole(role5, msg.sender),
"UNAUTHORIZED"
);
_;
}
modifier onlyVolt() {
require(msg.sender == address(_volt), "CoreRef: Caller is not VOLT");
_;
}
/// @notice sets a new admin role for this contract
function setContractAdminRole(bytes32 newContractAdminRole)
external
override
onlyGovernor
{
_setContractAdminRole(newContractAdminRole);
}
/// @notice returns whether a given address has the admin role for this contract
function isContractAdmin(address _admin)
public
view
override
returns (bool)
{
return _core.hasRole(CONTRACT_ADMIN_ROLE, _admin);
}
/// @notice set pausable methods to paused
function pause() public override onlyGuardianOrGovernor {
_pause();
}
/// @notice set pausable methods to unpaused
function unpause() public override onlyGuardianOrGovernor {
_unpause();
}
/// @notice address of the Core contract referenced
/// @return ICore implementation address
function core() public view override returns (ICore) {
return _core;
}
/// @notice address of the Fei contract referenced by Core
/// @return IFei implementation address
function volt() public view override returns (IVolt) {
return _volt;
}
/// @notice address of the Tribe contract referenced by Core
/// @return IERC20 implementation address
function vcon() public view override returns (IERC20) {
return _vcon;
}
/// @notice volt balance of contract
/// @return volt amount held
function voltBalance() public view override returns (uint256) {
return _volt.balanceOf(address(this));
}
/// @notice vcon balance of contract
/// @return vcon amount held
function vconBalance() public view override returns (uint256) {
return _vcon.balanceOf(address(this));
}
function _burnVoltHeld() internal {
_volt.burn(voltBalance());
}
function _mintVolt(address to, uint256 amount) internal virtual {
if (amount != 0) {
_volt.mint(to, amount);
}
}
function _setContractAdminRole(bytes32 newContractAdminRole) internal {
bytes32 oldContractAdminRole = CONTRACT_ADMIN_ROLE;
CONTRACT_ADMIN_ROLE = newContractAdminRole;
emit ContractAdminRoleUpdate(
oldContractAdminRole,
newContractAdminRole
);
}
}
// File contracts/utils/Timed.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title an abstract contract for timed events
/// @author Fei Protocol
abstract contract Timed {
/// @notice the start timestamp of the timed period
uint256 public startTime;
/// @notice the duration of the timed period
uint256 public duration;
event DurationUpdate(uint256 oldDuration, uint256 newDuration);
event TimerReset(uint256 startTime);
constructor(uint256 _duration) {
_setDuration(_duration);
}
modifier duringTime() {
require(isTimeStarted(), "Timed: time not started");
require(!isTimeEnded(), "Timed: time ended");
_;
}
modifier afterTime() {
require(isTimeEnded(), "Timed: time not ended");
_;
}
modifier afterTimeInit() {
require(isTimeEnded(), "Timed: time not ended, init");
_;
_initTimed();
}
/// @notice return true if time period has ended
function isTimeEnded() public view returns (bool) {
return remainingTime() == 0;
}
/// @notice number of seconds remaining until time is up
/// @return remaining
function remainingTime() public view returns (uint256) {
return duration - timeSinceStart(); // duration always >= timeSinceStart which is on [0,d]
}
/// @notice number of seconds since contract was initialized
/// @return timestamp
/// @dev will be less than or equal to duration
function timeSinceStart() public view returns (uint256) {
if (!isTimeStarted()) {
return 0; // uninitialized
}
uint256 _duration = duration;
uint256 timePassed = block.timestamp - startTime; // block timestamp always >= startTime
return timePassed > _duration ? _duration : timePassed;
}
function isTimeStarted() public view returns (bool) {
return startTime != 0;
}
function _initTimed() internal {
startTime = block.timestamp;
emit TimerReset(block.timestamp);
}
function _setDuration(uint256 newDuration) internal {
require(newDuration != 0, "Timed: zero duration");
uint256 oldDuration = duration;
duration = newDuration;
emit DurationUpdate(oldDuration, newDuration);
}
}
// File @openzeppelin/contracts/utils/math/SafeMath.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File contracts/external/Decimal.sol
/*
Copyright 2019 dYdX Trading Inc.
Copyright 2020 Empty Set Squad <emptysetsquad@protonmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.8.4;
/**
* @title Decimal
* @author dYdX
*
* Library that defines a fixed-point number with 18 decimal places.
*/
library Decimal {
using SafeMath for uint256;
// ============ Constants ============
uint256 private constant BASE = 10**18;
// ============ Structs ============
struct D256 {
uint256 value;
}
// ============ Static Functions ============
function zero() internal pure returns (D256 memory) {
return D256({value: 0});
}
function one() internal pure returns (D256 memory) {
return D256({value: BASE});
}
function from(uint256 a) internal pure returns (D256 memory) {
return D256({value: a.mul(BASE)});
}
function ratio(uint256 a, uint256 b) internal pure returns (D256 memory) {
return D256({value: getPartial(a, BASE, b)});
}
// ============ Self Functions ============
function add(D256 memory self, uint256 b)
internal
pure
returns (D256 memory)
{
return D256({value: self.value.add(b.mul(BASE))});
}
function sub(D256 memory self, uint256 b)
internal
pure
returns (D256 memory)
{
return D256({value: self.value.sub(b.mul(BASE))});
}
function sub(
D256 memory self,
uint256 b,
string memory reason
) internal pure returns (D256 memory) {
return D256({value: self.value.sub(b.mul(BASE), reason)});
}
function mul(D256 memory self, uint256 b)
internal
pure
returns (D256 memory)
{
return D256({value: self.value.mul(b)});
}
function div(D256 memory self, uint256 b)
internal
pure
returns (D256 memory)
{
return D256({value: self.value.div(b)});
}
function pow(D256 memory self, uint256 b)
internal
pure
returns (D256 memory)
{
if (b == 0) {
return from(1);
}
D256 memory temp = D256({value: self.value});
for (uint256 i = 1; i < b; i++) {
temp = mul(temp, self);
}
return temp;
}
function add(D256 memory self, D256 memory b)
internal
pure
returns (D256 memory)
{
return D256({value: self.value.add(b.value)});
}
function sub(D256 memory self, D256 memory b)
internal
pure
returns (D256 memory)
{
return D256({value: self.value.sub(b.value)});
}
function sub(
D256 memory self,
D256 memory b,
string memory reason
) internal pure returns (D256 memory) {
return D256({value: self.value.sub(b.value, reason)});
}
function mul(D256 memory self, D256 memory b)
internal
pure
returns (D256 memory)
{
return D256({value: getPartial(self.value, b.value, BASE)});
}
function div(D256 memory self, D256 memory b)
internal
pure
returns (D256 memory)
{
return D256({value: getPartial(self.value, BASE, b.value)});
}
function equals(D256 memory self, D256 memory b)
internal
pure
returns (bool)
{
return self.value == b.value;
}
function greaterThan(D256 memory self, D256 memory b)
internal
pure
returns (bool)
{
return compareTo(self, b) == 2;
}
function lessThan(D256 memory self, D256 memory b)
internal
pure
returns (bool)
{
return compareTo(self, b) == 0;
}
function greaterThanOrEqualTo(D256 memory self, D256 memory b)
internal
pure
returns (bool)
{
return compareTo(self, b) > 0;
}
function lessThanOrEqualTo(D256 memory self, D256 memory b)
internal
pure
returns (bool)
{
return compareTo(self, b) < 2;
}
function isZero(D256 memory self) internal pure returns (bool) {
return self.value == 0;
}
function asUint256(D256 memory self) internal pure returns (uint256) {
return self.value.div(BASE);
}
// ============ Core Methods ============
function getPartial(
uint256 target,
uint256 numerator,
uint256 denominator
) private pure returns (uint256) {
return target.mul(numerator).div(denominator);
}
function compareTo(D256 memory a, D256 memory b)
private
pure
returns (uint256)
{
if (a.value == b.value) {
return 1;
}
return a.value > b.value ? 2 : 0;
}
}
// File @uniswap/v2-periphery/contracts/interfaces/IWETH.sol@v1.1.0-beta.0
pragma solidity >=0.5.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
// File contracts/Constants.sol
// GPL-3.0-or-later
pragma solidity ^0.8.0;
library Constants {
/// @notice the denominator for basis points granularity (10,000)
uint256 public constant BASIS_POINTS_GRANULARITY = 10_000;
/// @notice the denominator for basis points granularity (10,000) expressed as an int data type
int256 public constant BP_INT = int256(BASIS_POINTS_GRANULARITY);
uint256 public constant ONE_YEAR = 365.25 days;
int256 public constant ONE_YEAR_INT = int256(ONE_YEAR);
/// @notice WETH9 address
IWETH public constant WETH =
IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
/// @notice USD stand-in address
address public constant USD = 0x1111111111111111111111111111111111111111;
/// @notice Wei per ETH, i.e. 10**18
uint256 public constant ETH_GRANULARITY = 1e18;
/// @notice number of decimals in ETH, 18
uint256 public constant ETH_DECIMALS = 18;
}
// File @openzeppelin/contracts/utils/math/SafeCast.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)
pragma solidity ^0.8.0;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*
* Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
* all math on `uint256` and `int256` and then downcasting.
*/
library SafeCast {
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
return uint224(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
return uint96(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v3.1._
*/
function toInt128(int256 value) internal pure returns (int128) {
require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits");
return int128(value);
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v3.1._
*/
function toInt64(int256 value) internal pure returns (int64) {
require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits");
return int64(value);
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v3.1._
*/
function toInt32(int256 value) internal pure returns (int32) {
require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits");
return int32(value);
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v3.1._
*/
function toInt16(int256 value) internal pure returns (int16) {
require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits");
return int16(value);
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*
* _Available since v3.1._
*/
function toInt8(int256 value) internal pure returns (int8) {
require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits");
return int8(value);
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}
// File contracts/utils/Deviation.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @title contract that determines whether or not a new value is within
/// an acceptable deviation threshold
/// @author Elliot Friedman, FEI Protocol
library Deviation {
using SafeCast for *;
/// @notice event that is emitted when the threshold is changed
event DeviationThresholdUpdate(uint256 oldThreshold, uint256 newThreshold);
/// @notice return the percent deviation between a and b in basis points terms
function calculateDeviationThresholdBasisPoints(int256 a, int256 b)
internal
pure
returns (uint256)
{
int256 delta = a - b;
int256 basisPoints = (delta * Constants.BP_INT) / a;
return (basisPoints < 0 ? basisPoints * -1 : basisPoints).toUint256();
}
/// @notice function to return whether or not the new price is within
/// the acceptable deviation threshold
function isWithinDeviationThreshold(
uint256 maxDeviationThresholdBasisPoints,
int256 oldValue,
int256 newValue
) internal pure returns (bool) {
return
maxDeviationThresholdBasisPoints >=
calculateDeviationThresholdBasisPoints(oldValue, newValue);
}
}
// File contracts/oracle/IScalingPriceOracle.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @notice contract that receives a chainlink price feed and then linearly interpolates that rate over
/// a 1 month period into the VOLT price. Interest is compounded monthly when the rate is updated
/// @author Elliot Friedman
interface IScalingPriceOracle {
/// @notice the time frame over which all changes in CPI data are applied
/// 28 days was chosen as that is the shortest length of a month
function TIMEFRAME() external view returns (uint256);
/// @notice the maximum allowable deviation in basis points for a new chainlink oracle update
/// only allow price changes by 20% in a month.
/// Any change over this threshold in either direction will be rejected
function MAXORACLEDEVIATION() external view returns (uint256);
/// @notice get the current scaled oracle price
/// applies the change smoothly over a 28 day period
/// scaled by 18 decimals
function getCurrentOraclePrice() external view returns (uint256);
/// @notice current amount that oracle price is inflating/deflating by monthly in basis points
function monthlyChangeRateBasisPoints() external view returns (int256);
/// @notice oracle price. starts off at 1 scaled up by 18 decimals
function oraclePrice() external view returns (uint256);
/// @notice event when the monthly change rate is updated
event CPIMonthlyChangeRateUpdate(
int256 oldChangeRateBasisPoints,
int256 newChangeRateBasisPoints
);
}
// File contracts/external/calendar/BokkyPooBahsDateTimeLibrary.sol
// GNU Lesser General Public License 3.0
pragma solidity ^0.8.4;
// ----------------------------------------------------------------------------
// BokkyPooBah's DateTime Library v1.00
//
// A gas-efficient Solidity date and time library
//
// https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
//
// Tested date range 1970/01/01 to 2345/12/31
//
// Conventions:
// Unit | Range | Notes
// :-------- |:-------------:|:-----
// timestamp | >= 0 | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC
// year | 1970 ... 2345 |
// month | 1 ... 12 |
// day | 1 ... 31 |
// hour | 0 ... 23 |
// minute | 0 ... 59 |
// second | 0 ... 59 |
// dayOfWeek | 1 ... 7 | 1 = Monday, ..., 7 = Sunday
//
//
// Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018.
//
// GNU Lesser General Public License 3.0
// https://www.gnu.org/licenses/lgpl-3.0.en.html
// ----------------------------------------------------------------------------
library BokkyPooBahsDateTimeLibrary {
uint256 constant SECONDS_PER_DAY = 24 * 60 * 60;
uint256 constant SECONDS_PER_HOUR = 60 * 60;
uint256 constant SECONDS_PER_MINUTE = 60;
int256 constant OFFSET19700101 = 2440588;
uint256 constant DOW_MON = 1;
uint256 constant DOW_TUE = 2;
uint256 constant DOW_WED = 3;
uint256 constant DOW_THU = 4;
uint256 constant DOW_FRI = 5;
uint256 constant DOW_SAT = 6;
uint256 constant DOW_SUN = 7;
// ------------------------------------------------------------------------
// Calculate the number of days from 1970/01/01 to year/month/day using
// the date conversion algorithm from
// http://aa.usno.navy.mil/faq/docs/JD_Formula.php
// and subtracting the offset 2440588 so that 1970/01/01 is day 0
//
// days = day
// - 32075
// + 1461 * (year + 4800 + (month - 14) / 12) / 4
// + 367 * (month - 2 - (month - 14) / 12 * 12) / 12
// - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4
// - offset
// ------------------------------------------------------------------------
function _daysFromDate(
uint256 year,
uint256 month,
uint256 day
) internal pure returns (uint256 _days) {
require(year >= 1970);
int256 _year = int256(year);
int256 _month = int256(month);
int256 _day = int256(day);
int256 __days = _day -
32075 +
(1461 * (_year + 4800 + (_month - 14) / 12)) /
4 +
(367 * (_month - 2 - ((_month - 14) / 12) * 12)) /
12 -
(3 * ((_year + 4900 + (_month - 14) / 12) / 100)) /
4 -
OFFSET19700101;
_days = uint256(__days);
}
// ------------------------------------------------------------------------
// Calculate year/month/day from the number of days since 1970/01/01 using
// the date conversion algorithm from
// http://aa.usno.navy.mil/faq/docs/JD_Formula.php
// and adding the offset 2440588 so that 1970/01/01 is day 0
//
// int L = days + 68569 + offset
// int N = 4 * L / 146097
// L = L - (146097 * N + 3) / 4
// year = 4000 * (L + 1) / 1461001
// L = L - 1461 * year / 4 + 31
// month = 80 * L / 2447
// dd = L - 2447 * month / 80
// L = month / 11
// month = month + 2 - 12 * L
// year = 100 * (N - 49) + year + L
// ------------------------------------------------------------------------
function _daysToDate(uint256 _days)
internal
pure
returns (
uint256 year,
uint256 month,
uint256 day
)
{
int256 __days = int256(_days);
int256 L = __days + 68569 + OFFSET19700101;
int256 N = (4 * L) / 146097;
L = L - (146097 * N + 3) / 4;
int256 _year = (4000 * (L + 1)) / 1461001;
L = L - (1461 * _year) / 4 + 31;
int256 _month = (80 * L) / 2447;
int256 _day = L - (2447 * _month) / 80;
L = _month / 11;
_month = _month + 2 - 12 * L;
_year = 100 * (N - 49) + _year + L;
year = uint256(_year);
month = uint256(_month);
day = uint256(_day);
}
function timestampFromDate(
uint256 year,
uint256 month,
uint256 day
) internal pure returns (uint256 timestamp) {
timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY;
}
function timestampFromDateTime(
uint256 year,
uint256 month,
uint256 day,
uint256 hour,
uint256 minute,
uint256 second
) internal pure returns (uint256 timestamp) {
timestamp =
_daysFromDate(year, month, day) *
SECONDS_PER_DAY +
hour *
SECONDS_PER_HOUR +
minute *
SECONDS_PER_MINUTE +
second;
}
function timestampToDate(uint256 timestamp)
internal
pure
returns (
uint256 year,
uint256 month,
uint256 day
)
{
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
}
function timestampToDateTime(uint256 timestamp)
internal
pure
returns (
uint256 year,
uint256 month,
uint256 day,
uint256 hour,
uint256 minute,
uint256 second
)
{
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
uint256 secs = timestamp % SECONDS_PER_DAY;
hour = secs / SECONDS_PER_HOUR;
secs = secs % SECONDS_PER_HOUR;
minute = secs / SECONDS_PER_MINUTE;
second = secs % SECONDS_PER_MINUTE;
}
function isValidDate(
uint256 year,
uint256 month,
uint256 day
) internal pure returns (bool valid) {
if (year >= 1970 && month > 0 && month <= 12) {
uint256 daysInMonth = _getDaysInMonth(year, month);
if (day > 0 && day <= daysInMonth) {
valid = true;
}
}
}
function isValidDateTime(
uint256 year,
uint256 month,
uint256 day,
uint256 hour,
uint256 minute,
uint256 second
) internal pure returns (bool valid) {
if (isValidDate(year, month, day)) {
if (hour < 24 && minute < 60 && second < 60) {
valid = true;
}
}
}
function isLeapYear(uint256 timestamp)
internal
pure
returns (bool leapYear)
{
uint256 year;
uint256 month;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
leapYear = _isLeapYear(year);
}
function _isLeapYear(uint256 year) internal pure returns (bool leapYear) {
leapYear = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
function isWeekDay(uint256 timestamp) internal pure returns (bool weekDay) {
weekDay = getDayOfWeek(timestamp) <= DOW_FRI;
}
function isWeekEnd(uint256 timestamp) internal pure returns (bool weekEnd) {
weekEnd = getDayOfWeek(timestamp) >= DOW_SAT;
}
function getDaysInMonth(uint256 timestamp)
internal
pure
returns (uint256 daysInMonth)
{
uint256 year;
uint256 month;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
daysInMonth = _getDaysInMonth(year, month);
}
function _getDaysInMonth(uint256 year, uint256 month)
internal
pure
returns (uint256 daysInMonth)
{
if (
month == 1 ||
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
daysInMonth = 31;
} else if (month != 2) {
daysInMonth = 30;
} else {
daysInMonth = _isLeapYear(year) ? 29 : 28;
}
}
// 1 = Monday, 7 = Sunday
function getDayOfWeek(uint256 timestamp)
internal
pure
returns (uint256 dayOfWeek)
{
uint256 _days = timestamp / SECONDS_PER_DAY;
dayOfWeek = ((_days + 3) % 7) + 1;
}
function getYear(uint256 timestamp) internal pure returns (uint256 year) {
uint256 month;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
}
function getMonth(uint256 timestamp) internal pure returns (uint256 month) {
uint256 year;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
}
function getDay(uint256 timestamp) internal pure returns (uint256 day) {
uint256 year;
uint256 month;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
}
function getHour(uint256 timestamp) internal pure returns (uint256 hour) {
uint256 secs = timestamp % SECONDS_PER_DAY;
hour = secs / SECONDS_PER_HOUR;
}
function getMinute(uint256 timestamp)
internal
pure
returns (uint256 minute)
{
uint256 secs = timestamp % SECONDS_PER_HOUR;
minute = secs / SECONDS_PER_MINUTE;
}
function getSecond(uint256 timestamp)
internal
pure
returns (uint256 second)
{
second = timestamp % SECONDS_PER_MINUTE;
}
function addYears(uint256 timestamp, uint256 _years)
internal
pure
returns (uint256 newTimestamp)
{
uint256 year;
uint256 month;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
year += _years;
uint256 daysInMonth = _getDaysInMonth(year, month);
if (day > daysInMonth) {
day = daysInMonth;
}
newTimestamp =
_daysFromDate(year, month, day) *
SECONDS_PER_DAY +
(timestamp % SECONDS_PER_DAY);
require(newTimestamp >= timestamp);
}
function addMonths(uint256 timestamp, uint256 _months)
internal
pure
returns (uint256 newTimestamp)
{
uint256 year;
uint256 month;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
month += _months;
year += (month - 1) / 12;
month = ((month - 1) % 12) + 1;
uint256 daysInMonth = _getDaysInMonth(year, month);
if (day > daysInMonth) {
day = daysInMonth;
}
newTimestamp =
_daysFromDate(year, month, day) *
SECONDS_PER_DAY +
(timestamp % SECONDS_PER_DAY);
require(newTimestamp >= timestamp);
}
function addDays(uint256 timestamp, uint256 _days)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp + _days * SECONDS_PER_DAY;
require(newTimestamp >= timestamp);
}
function addHours(uint256 timestamp, uint256 _hours)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp + _hours * SECONDS_PER_HOUR;
require(newTimestamp >= timestamp);
}
function addMinutes(uint256 timestamp, uint256 _minutes)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp + _minutes * SECONDS_PER_MINUTE;
require(newTimestamp >= timestamp);
}
function addSeconds(uint256 timestamp, uint256 _seconds)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp + _seconds;
require(newTimestamp >= timestamp);
}
function subYears(uint256 timestamp, uint256 _years)
internal
pure
returns (uint256 newTimestamp)
{
uint256 year;
uint256 month;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
year -= _years;
uint256 daysInMonth = _getDaysInMonth(year, month);
if (day > daysInMonth) {
day = daysInMonth;
}
newTimestamp =
_daysFromDate(year, month, day) *
SECONDS_PER_DAY +
(timestamp % SECONDS_PER_DAY);
require(newTimestamp <= timestamp);
}
function subMonths(uint256 timestamp, uint256 _months)
internal
pure
returns (uint256 newTimestamp)
{
uint256 year;
uint256 month;
uint256 day;
(year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
uint256 yearMonth = year * 12 + (month - 1) - _months;
year = yearMonth / 12;
month = (yearMonth % 12) + 1;
uint256 daysInMonth = _getDaysInMonth(year, month);
if (day > daysInMonth) {
day = daysInMonth;
}
newTimestamp =
_daysFromDate(year, month, day) *
SECONDS_PER_DAY +
(timestamp % SECONDS_PER_DAY);
require(newTimestamp <= timestamp);
}
function subDays(uint256 timestamp, uint256 _days)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp - _days * SECONDS_PER_DAY;
require(newTimestamp <= timestamp);
}
function subHours(uint256 timestamp, uint256 _hours)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp - _hours * SECONDS_PER_HOUR;
require(newTimestamp <= timestamp);
}
function subMinutes(uint256 timestamp, uint256 _minutes)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp - _minutes * SECONDS_PER_MINUTE;
require(newTimestamp <= timestamp);
}
function subSeconds(uint256 timestamp, uint256 _seconds)
internal
pure
returns (uint256 newTimestamp)
{
newTimestamp = timestamp - _seconds;
require(newTimestamp <= timestamp);
}
function diffYears(uint256 fromTimestamp, uint256 toTimestamp)
internal
pure
returns (uint256 _years)
{
require(fromTimestamp <= toTimestamp);
uint256 fromYear;
uint256 fromMonth;
uint256 fromDay;
uint256 toYear;
uint256 toMonth;
uint256 toDay;
(fromYear, fromMonth, fromDay) = _daysToDate(
fromTimestamp / SECONDS_PER_DAY
);
(toYear, toMonth, toDay) = _daysToDate(toTimestamp / SECONDS_PER_DAY);
_years = toYear - fromYear;
}
function diffMonths(uint256 fromTimestamp, uint256 toTimestamp)
internal
pure
returns (uint256 _months)
{
require(fromTimestamp <= toTimestamp);
uint256 fromYear;
uint256 fromMonth;
uint256 fromDay;
uint256 toYear;
uint256 toMonth;
uint256 toDay;
(fromYear, fromMonth, fromDay) = _daysToDate(
fromTimestamp / SECONDS_PER_DAY
);
(toYear, toMonth, toDay) = _daysToDate(toTimestamp / SECONDS_PER_DAY);
_months = toYear * 12 + toMonth - fromYear * 12 - fromMonth;
}
function diffDays(uint256 fromTimestamp, uint256 toTimestamp)
internal
pure
returns (uint256 _days)
{
require(fromTimestamp <= toTimestamp);
_days = (toTimestamp - fromTimestamp) / SECONDS_PER_DAY;
}
function diffHours(uint256 fromTimestamp, uint256 toTimestamp)
internal
pure
returns (uint256 _hours)
{
require(fromTimestamp <= toTimestamp);
_hours = (toTimestamp - fromTimestamp) / SECONDS_PER_HOUR;
}
function diffMinutes(uint256 fromTimestamp, uint256 toTimestamp)
internal
pure
returns (uint256 _minutes)
{
require(fromTimestamp <= toTimestamp);
_minutes = (toTimestamp - fromTimestamp) / SECONDS_PER_MINUTE;
}
function diffSeconds(uint256 fromTimestamp, uint256 toTimestamp)
internal
pure
returns (uint256 _seconds)
{
require(fromTimestamp <= toTimestamp);
_seconds = toTimestamp - fromTimestamp;
}
}
// File contracts/external/calendar/BokkyPooBahsDateTimeContract.sol
// GNU Lesser General Public License 3.0
pragma solidity ^0.8.4;
// ----------------------------------------------------------------------------
// BokkyPooBah's DateTime Library v1.00 - Contract Instance
//
// A gas-efficient Solidity date and time library
//
// https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
//
// Tested date range 1970/01/01 to 2345/12/31
//
// Conventions:
// Unit | Range | Notes
// :-------- |:-------------:|:-----
// timestamp | >= 0 | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC
// year | 1970 ... 2345 |
// month | 1 ... 12 |
// day | 1 ... 31 |
// hour | 0 ... 23 |
// minute | 0 ... 59 |
// second | 0 ... 59 |
// dayOfWeek | 1 ... 7 | 1 = Monday, ..., 7 = Sunday
//
//
// Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018.
//
// GNU Lesser General Public License 3.0
// https://www.gnu.org/licenses/lgpl-3.0.en.html
// ----------------------------------------------------------------------------
contract BokkyPooBahsDateTimeContract {
uint256 public constant SECONDS_PER_DAY = 24 * 60 * 60;
uint256 public constant SECONDS_PER_HOUR = 60 * 60;
uint256 public constant SECONDS_PER_MINUTE = 60;
int256 public constant OFFSET19700101 = 2440588;
uint256 public constant DOW_MON = 1;
uint256 public constant DOW_TUE = 2;
uint256 public constant DOW_WED = 3;
uint256 public constant DOW_THU = 4;
uint256 public constant DOW_FRI = 5;
uint256 public constant DOW_SAT = 6;
uint256 public constant DOW_SUN = 7;
function _now() public view returns (uint256 timestamp) {
timestamp = block.timestamp;
}
function _nowDateTime()
public
view
returns (
uint256 year,
uint256 month,
uint256 day,
uint256 hour,
uint256 minute,
uint256 second
)
{
(year, month, day, hour, minute, second) = BokkyPooBahsDateTimeLibrary
.timestampToDateTime(block.timestamp);
}
function _daysFromDate(
uint256 year,
uint256 month,
uint256 day
) public pure returns (uint256 _days) {
return BokkyPooBahsDateTimeLibrary._daysFromDate(year, month, day);
}
function _daysToDate(uint256 _days)
public
pure
returns (
uint256 year,
uint256 month,
uint256 day
)
{
return BokkyPooBahsDateTimeLibrary._daysToDate(_days);
}
function timestampFromDate(
uint256 year,
uint256 month,
uint256 day
) public pure returns (uint256 timestamp) {
return BokkyPooBahsDateTimeLibrary.timestampFromDate(year, month, day);
}
function timestampFromDateTime(
uint256 year,
uint256 month,
uint256 day,
uint256 hour,
uint256 minute,
uint256 second
) public pure returns (uint256 timestamp) {
return
BokkyPooBahsDateTimeLibrary.timestampFromDateTime(
year,
month,
day,
hour,
minute,
second
);
}
function timestampToDate(uint256 timestamp)
public
pure
returns (
uint256 year,
uint256 month,
uint256 day
)
{
(year, month, day) = BokkyPooBahsDateTimeLibrary.timestampToDate(
timestamp
);
}
function timestampToDateTime(uint256 timestamp)
public
pure
returns (
uint256 year,
uint256 month,
uint256 day,
uint256 hour,
uint256 minute,
uint256 second
)
{
(year, month, day, hour, minute, second) = BokkyPooBahsDateTimeLibrary
.timestampToDateTime(timestamp);
}
function isValidDate(
uint256 year,
uint256 month,
uint256 day
) public pure returns (bool valid) {
valid = BokkyPooBahsDateTimeLibrary.isValidDate(year, month, day);
}
function isValidDateTime(
uint256 year,
uint256 month,
uint256 day,
uint256 hour,
uint256 minute,
uint256 second
) public pure returns (bool valid) {
valid = BokkyPooBahsDateTimeLibrary.isValidDateTime(
year,
month,
day,
hour,
minute,
second
);
}
function isLeapYear(uint256 timestamp) public pure returns (bool leapYear) {
leapYear = BokkyPooBahsDateTimeLibrary.isLeapYear(timestamp);
}
function _isLeapYear(uint256 year) public pure returns (bool leapYear) {
leapYear = BokkyPooBahsDateTimeLibrary._isLeapYear(year);
}
function isWeekDay(uint256 timestamp) public pure returns (bool weekDay) {
weekDay = BokkyPooBahsDateTimeLibrary.isWeekDay(timestamp);
}
function isWeekEnd(uint256 timestamp) public pure returns (bool weekEnd) {
weekEnd = BokkyPooBahsDateTimeLibrary.isWeekEnd(timestamp);
}
function getDaysInMonth(uint256 timestamp)
public
pure
returns (uint256 daysInMonth)
{
daysInMonth = BokkyPooBahsDateTimeLibrary.getDaysInMonth(timestamp);
}
function _getDaysInMonth(uint256 year, uint256 month)
public
pure
returns (uint256 daysInMonth)
{
daysInMonth = BokkyPooBahsDateTimeLibrary._getDaysInMonth(year, month);
}
function getDayOfWeek(uint256 timestamp)
public
pure
returns (uint256 dayOfWeek)
{
dayOfWeek = BokkyPooBahsDateTimeLibrary.getDayOfWeek(timestamp);
}
function getYear(uint256 timestamp) public pure returns (uint256 year) {
year = BokkyPooBahsDateTimeLibrary.getYear(timestamp);
}
function getMonth(uint256 timestamp) public pure returns (uint256 month) {
month = BokkyPooBahsDateTimeLibrary.getMonth(timestamp);
}
function getDay(uint256 timestamp) public pure returns (uint256 day) {
day = BokkyPooBahsDateTimeLibrary.getDay(timestamp);
}
function getHour(uint256 timestamp) public pure returns (uint256 hour) {
hour = BokkyPooBahsDateTimeLibrary.getHour(timestamp);
}
function getMinute(uint256 timestamp) public pure returns (uint256 minute) {
minute = BokkyPooBahsDateTimeLibrary.getMinute(timestamp);
}
function getSecond(uint256 timestamp) public pure returns (uint256 second) {
second = BokkyPooBahsDateTimeLibrary.getSecond(timestamp);
}
function addYears(uint256 timestamp, uint256 _years)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.addYears(timestamp, _years);
}
function addMonths(uint256 timestamp, uint256 _months)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.addMonths(
timestamp,
_months
);
}
function addDays(uint256 timestamp, uint256 _days)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.addDays(timestamp, _days);
}
function addHours(uint256 timestamp, uint256 _hours)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.addHours(timestamp, _hours);
}
function addMinutes(uint256 timestamp, uint256 _minutes)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.addMinutes(
timestamp,
_minutes
);
}
function addSeconds(uint256 timestamp, uint256 _seconds)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.addSeconds(
timestamp,
_seconds
);
}
function subYears(uint256 timestamp, uint256 _years)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.subYears(timestamp, _years);
}
function subMonths(uint256 timestamp, uint256 _months)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.subMonths(
timestamp,
_months
);
}
function subDays(uint256 timestamp, uint256 _days)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.subDays(timestamp, _days);
}
function subHours(uint256 timestamp, uint256 _hours)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.subHours(timestamp, _hours);
}
function subMinutes(uint256 timestamp, uint256 _minutes)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.subMinutes(
timestamp,
_minutes
);
}
function subSeconds(uint256 timestamp, uint256 _seconds)
public
pure
returns (uint256 newTimestamp)
{
newTimestamp = BokkyPooBahsDateTimeLibrary.subSeconds(
timestamp,
_seconds
);
}
function diffYears(uint256 fromTimestamp, uint256 toTimestamp)
public
pure
returns (uint256 _years)
{
_years = BokkyPooBahsDateTimeLibrary.diffYears(
fromTimestamp,
toTimestamp
);
}
function diffMonths(uint256 fromTimestamp, uint256 toTimestamp)
public
pure
returns (uint256 _months)
{
_months = BokkyPooBahsDateTimeLibrary.diffMonths(
fromTimestamp,
toTimestamp
);
}
function diffDays(uint256 fromTimestamp, uint256 toTimestamp)
public
pure
returns (uint256 _days)
{
_days = BokkyPooBahsDateTimeLibrary.diffDays(
fromTimestamp,
toTimestamp
);
}
function diffHours(uint256 fromTimestamp, uint256 toTimestamp)
public
pure
returns (uint256 _hours)
{
_hours = BokkyPooBahsDateTimeLibrary.diffHours(
fromTimestamp,
toTimestamp
);
}
function diffMinutes(uint256 fromTimestamp, uint256 toTimestamp)
public
pure
returns (uint256 _minutes)
{
_minutes = BokkyPooBahsDateTimeLibrary.diffMinutes(
fromTimestamp,
toTimestamp
);
}
function diffSeconds(uint256 fromTimestamp, uint256 toTimestamp)
public
pure
returns (uint256 _seconds)
{
_seconds = BokkyPooBahsDateTimeLibrary.diffSeconds(
fromTimestamp,
toTimestamp
);
}
}
// File @openzeppelin/contracts/utils/math/Math.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a / b + (a % b == 0 ? 0 : 1);
}
}
// File @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File @openzeppelin/contracts/token/ERC20/ERC20.sol@v4.4.2
// MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// File @chainlink/contracts/src/v0.8/vendor/BufferChainlink.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for writing to them. At any time you can fetch a bytes object containing the
* current contents of the buffer. The bytes object should not be stored between
* operations, as it may change due to resizing of the buffer.
*/
library BufferChainlink {
/**
* @dev Represents a mutable buffer. Buffers have a current value (buf) and
* a capacity. The capacity may be longer than the current value, in
* which case it can be extended without the need to allocate more memory.
*/
struct buffer {
bytes buf;
uint256 capacity;
}
/**
* @dev Initializes a buffer with an initial capacity.
* @param buf The buffer to initialize.
* @param capacity The number of bytes of space to allocate the buffer.
* @return The buffer, for chaining.
*/
function init(buffer memory buf, uint256 capacity) internal pure returns (buffer memory) {
if (capacity % 32 != 0) {
capacity += 32 - (capacity % 32);
}
// Allocate space for the buffer data
buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(ptr, 0)
mstore(0x40, add(32, add(ptr, capacity)))
}
return buf;
}
/**
* @dev Initializes a new buffer from an existing bytes object.
* Changes to the buffer may mutate the original value.
* @param b The bytes object to initialize the buffer with.
* @return A new buffer.
*/
function fromBytes(bytes memory b) internal pure returns (buffer memory) {
buffer memory buf;
buf.buf = b;
buf.capacity = b.length;
return buf;
}
function resize(buffer memory buf, uint256 capacity) private pure {
bytes memory oldbuf = buf.buf;
init(buf, capacity);
append(buf, oldbuf);
}
function max(uint256 a, uint256 b) private pure returns (uint256) {
if (a > b) {
return a;
}
return b;
}
/**
* @dev Sets buffer length to 0.
* @param buf The buffer to truncate.
* @return The original buffer, for chaining..
*/
function truncate(buffer memory buf) internal pure returns (buffer memory) {
assembly {
let bufptr := mload(buf)
mstore(bufptr, 0)
}
return buf;
}
/**
* @dev Writes a byte string to a buffer. Resizes if doing so would exceed
* the capacity of the buffer.
* @param buf The buffer to append to.
* @param off The start offset to write to.
* @param data The data to append.
* @param len The number of bytes to copy.
* @return The original buffer, for chaining.
*/
function write(
buffer memory buf,
uint256 off,
bytes memory data,
uint256 len
) internal pure returns (buffer memory) {
require(len <= data.length);
if (off + len > buf.capacity) {
resize(buf, max(buf.capacity, len + off) * 2);
}
uint256 dest;
uint256 src;
assembly {
// Memory address of the buffer data
let bufptr := mload(buf)
// Length of existing buffer data
let buflen := mload(bufptr)
// Start address = buffer address + offset + sizeof(buffer length)
dest := add(add(bufptr, 32), off)
// Update buffer length if we're extending it
if gt(add(len, off), buflen) {
mstore(bufptr, add(len, off))
}
src := add(data, 32)
}
// Copy word-length chunks while possible
for (; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
unchecked {
uint256 mask = (256**(32 - len)) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
}
return buf;
}
/**
* @dev Appends a byte string to a buffer. Resizes if doing so would exceed
* the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @param len The number of bytes to copy.
* @return The original buffer, for chaining.
*/
function append(
buffer memory buf,
bytes memory data,
uint256 len
) internal pure returns (buffer memory) {
return write(buf, buf.buf.length, data, len);
}
/**
* @dev Appends a byte string to a buffer. Resizes if doing so would exceed
* the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer, for chaining.
*/
function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {
return write(buf, buf.buf.length, data, data.length);
}
/**
* @dev Writes a byte to the buffer. Resizes if doing so would exceed the
* capacity of the buffer.
* @param buf The buffer to append to.
* @param off The offset to write the byte at.
* @param data The data to append.
* @return The original buffer, for chaining.
*/
function writeUint8(
buffer memory buf,
uint256 off,
uint8 data
) internal pure returns (buffer memory) {
if (off >= buf.capacity) {
resize(buf, buf.capacity * 2);
}
assembly {
// Memory address of the buffer data
let bufptr := mload(buf)
// Length of existing buffer data
let buflen := mload(bufptr)
// Address = buffer address + sizeof(buffer length) + off
let dest := add(add(bufptr, off), 32)
mstore8(dest, data)
// Update buffer length if we extended it
if eq(off, buflen) {
mstore(bufptr, add(buflen, 1))
}
}
return buf;
}
/**
* @dev Appends a byte to the buffer. Resizes if doing so would exceed the
* capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer, for chaining.
*/
function appendUint8(buffer memory buf, uint8 data) internal pure returns (buffer memory) {
return writeUint8(buf, buf.buf.length, data);
}
/**
* @dev Writes up to 32 bytes to the buffer. Resizes if doing so would
* exceed the capacity of the buffer.
* @param buf The buffer to append to.
* @param off The offset to write at.
* @param data The data to append.
* @param len The number of bytes to write (left-aligned).
* @return The original buffer, for chaining.
*/
function write(
buffer memory buf,
uint256 off,
bytes32 data,
uint256 len
) private pure returns (buffer memory) {
if (len + off > buf.capacity) {
resize(buf, (len + off) * 2);
}
unchecked {
uint256 mask = (256**len) - 1;
// Right-align data
data = data >> (8 * (32 - len));
assembly {
// Memory address of the buffer data
let bufptr := mload(buf)
// Address = buffer address + sizeof(buffer length) + off + len
let dest := add(add(bufptr, off), len)
mstore(dest, or(and(mload(dest), not(mask)), data))
// Update buffer length if we extended it
if gt(add(off, len), mload(bufptr)) {
mstore(bufptr, add(off, len))
}
}
}
return buf;
}
/**
* @dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the
* capacity of the buffer.
* @param buf The buffer to append to.
* @param off The offset to write at.
* @param data The data to append.
* @return The original buffer, for chaining.
*/
function writeBytes20(
buffer memory buf,
uint256 off,
bytes20 data
) internal pure returns (buffer memory) {
return write(buf, off, bytes32(data), 20);
}
/**
* @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed
* the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer, for chhaining.
*/
function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {
return write(buf, buf.buf.length, bytes32(data), 20);
}
/**
* @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed
* the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer, for chaining.
*/
function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {
return write(buf, buf.buf.length, data, 32);
}
/**
* @dev Writes an integer to the buffer. Resizes if doing so would exceed
* the capacity of the buffer.
* @param buf The buffer to append to.
* @param off The offset to write at.
* @param data The data to append.
* @param len The number of bytes to write (right-aligned).
* @return The original buffer, for chaining.
*/
function writeInt(
buffer memory buf,
uint256 off,
uint256 data,
uint256 len
) private pure returns (buffer memory) {
if (len + off > buf.capacity) {
resize(buf, (len + off) * 2);
}
uint256 mask = (256**len) - 1;
assembly {
// Memory address of the buffer data
let bufptr := mload(buf)
// Address = buffer address + off + sizeof(buffer length) + len
let dest := add(add(bufptr, off), len)
mstore(dest, or(and(mload(dest), not(mask)), data))
// Update buffer length if we extended it
if gt(add(off, len), mload(bufptr)) {
mstore(bufptr, add(off, len))
}
}
return buf;
}
/**
* @dev Appends a byte to the end of the buffer. Resizes if doing so would
* exceed the capacity of the buffer.
* @param buf The buffer to append to.
* @param data The data to append.
* @return The original buffer.
*/
function appendInt(
buffer memory buf,
uint256 data,
uint256 len
) internal pure returns (buffer memory) {
return writeInt(buf, buf.buf.length, data, len);
}
}
// File @chainlink/contracts/src/v0.8/vendor/CBORChainlink.sol@v0.3.1
// MIT
pragma solidity >=0.4.19;
library CBORChainlink {
using BufferChainlink for BufferChainlink.buffer;
uint8 private constant MAJOR_TYPE_INT = 0;
uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;
uint8 private constant MAJOR_TYPE_BYTES = 2;
uint8 private constant MAJOR_TYPE_STRING = 3;
uint8 private constant MAJOR_TYPE_ARRAY = 4;
uint8 private constant MAJOR_TYPE_MAP = 5;
uint8 private constant MAJOR_TYPE_TAG = 6;
uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;
uint8 private constant TAG_TYPE_BIGNUM = 2;
uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;
function encodeFixedNumeric(BufferChainlink.buffer memory buf, uint8 major, uint64 value) private pure {
if(value <= 23) {
buf.appendUint8(uint8((major << 5) | value));
} else if (value <= 0xFF) {
buf.appendUint8(uint8((major << 5) | 24));
buf.appendInt(value, 1);
} else if (value <= 0xFFFF) {
buf.appendUint8(uint8((major << 5) | 25));
buf.appendInt(value, 2);
} else if (value <= 0xFFFFFFFF) {
buf.appendUint8(uint8((major << 5) | 26));
buf.appendInt(value, 4);
} else {
buf.appendUint8(uint8((major << 5) | 27));
buf.appendInt(value, 8);
}
}
function encodeIndefiniteLengthType(BufferChainlink.buffer memory buf, uint8 major) private pure {
buf.appendUint8(uint8((major << 5) | 31));
}
function encodeUInt(BufferChainlink.buffer memory buf, uint value) internal pure {
if(value > 0xFFFFFFFFFFFFFFFF) {
encodeBigNum(buf, value);
} else {
encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));
}
}
function encodeInt(BufferChainlink.buffer memory buf, int value) internal pure {
if(value < -0x10000000000000000) {
encodeSignedBigNum(buf, value);
} else if(value > 0xFFFFFFFFFFFFFFFF) {
encodeBigNum(buf, uint(value));
} else if(value >= 0) {
encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(uint256(value)));
} else {
encodeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(uint256(-1 - value)));
}
}
function encodeBytes(BufferChainlink.buffer memory buf, bytes memory value) internal pure {
encodeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));
buf.append(value);
}
function encodeBigNum(BufferChainlink.buffer memory buf, uint value) internal pure {
buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));
encodeBytes(buf, abi.encode(value));
}
function encodeSignedBigNum(BufferChainlink.buffer memory buf, int input) internal pure {
buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM));
encodeBytes(buf, abi.encode(uint256(-1 - input)));
}
function encodeString(BufferChainlink.buffer memory buf, string memory value) internal pure {
encodeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));
buf.append(bytes(value));
}
function startArray(BufferChainlink.buffer memory buf) internal pure {
encodeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);
}
function startMap(BufferChainlink.buffer memory buf) internal pure {
encodeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);
}
function endSequence(BufferChainlink.buffer memory buf) internal pure {
encodeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);
}
}
// File @chainlink/contracts/src/v0.8/Chainlink.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
/**
* @title Library for common Chainlink functions
* @dev Uses imported CBOR library for encoding to buffer
*/
library Chainlink {
uint256 internal constant defaultBufferSize = 256; // solhint-disable-line const-name-snakecase
using CBORChainlink for BufferChainlink.buffer;
struct Request {
bytes32 id;
address callbackAddress;
bytes4 callbackFunctionId;
uint256 nonce;
BufferChainlink.buffer buf;
}
/**
* @notice Initializes a Chainlink request
* @dev Sets the ID, callback address, and callback function signature on the request
* @param self The uninitialized request
* @param jobId The Job Specification ID
* @param callbackAddr The callback address
* @param callbackFunc The callback function signature
* @return The initialized request
*/
function initialize(
Request memory self,
bytes32 jobId,
address callbackAddr,
bytes4 callbackFunc
) internal pure returns (Chainlink.Request memory) {
BufferChainlink.init(self.buf, defaultBufferSize);
self.id = jobId;
self.callbackAddress = callbackAddr;
self.callbackFunctionId = callbackFunc;
return self;
}
/**
* @notice Sets the data for the buffer without encoding CBOR on-chain
* @dev CBOR can be closed with curly-brackets {} or they can be left off
* @param self The initialized request
* @param data The CBOR data
*/
function setBuffer(Request memory self, bytes memory data) internal pure {
BufferChainlink.init(self.buf, data.length);
BufferChainlink.append(self.buf, data);
}
/**
* @notice Adds a string value to the request with a given key name
* @param self The initialized request
* @param key The name of the key
* @param value The string value to add
*/
function add(
Request memory self,
string memory key,
string memory value
) internal pure {
self.buf.encodeString(key);
self.buf.encodeString(value);
}
/**
* @notice Adds a bytes value to the request with a given key name
* @param self The initialized request
* @param key The name of the key
* @param value The bytes value to add
*/
function addBytes(
Request memory self,
string memory key,
bytes memory value
) internal pure {
self.buf.encodeString(key);
self.buf.encodeBytes(value);
}
/**
* @notice Adds a int256 value to the request with a given key name
* @param self The initialized request
* @param key The name of the key
* @param value The int256 value to add
*/
function addInt(
Request memory self,
string memory key,
int256 value
) internal pure {
self.buf.encodeString(key);
self.buf.encodeInt(value);
}
/**
* @notice Adds a uint256 value to the request with a given key name
* @param self The initialized request
* @param key The name of the key
* @param value The uint256 value to add
*/
function addUint(
Request memory self,
string memory key,
uint256 value
) internal pure {
self.buf.encodeString(key);
self.buf.encodeUInt(value);
}
/**
* @notice Adds an array of strings to the request with a given key name
* @param self The initialized request
* @param key The name of the key
* @param values The array of string values to add
*/
function addStringArray(
Request memory self,
string memory key,
string[] memory values
) internal pure {
self.buf.encodeString(key);
self.buf.startArray();
for (uint256 i = 0; i < values.length; i++) {
self.buf.encodeString(values[i]);
}
self.buf.endSequence();
}
}
// File @chainlink/contracts/src/v0.8/interfaces/ENSInterface.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
interface ENSInterface {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(
bytes32 node,
bytes32 label,
address owner
) external;
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
// File @chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
interface LinkTokenInterface {
function allowance(address owner, address spender) external view returns (uint256 remaining);
function approve(address spender, uint256 value) external returns (bool success);
function balanceOf(address owner) external view returns (uint256 balance);
function decimals() external view returns (uint8 decimalPlaces);
function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
function increaseApproval(address spender, uint256 subtractedValue) external;
function name() external view returns (string memory tokenName);
function symbol() external view returns (string memory tokenSymbol);
function totalSupply() external view returns (uint256 totalTokensIssued);
function transfer(address to, uint256 value) external returns (bool success);
function transferAndCall(
address to,
uint256 value,
bytes calldata data
) external returns (bool success);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool success);
}
// File @chainlink/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
interface ChainlinkRequestInterface {
function oracleRequest(
address sender,
uint256 requestPrice,
bytes32 serviceAgreementID,
address callbackAddress,
bytes4 callbackFunctionId,
uint256 nonce,
uint256 dataVersion,
bytes calldata data
) external;
function cancelOracleRequest(
bytes32 requestId,
uint256 payment,
bytes4 callbackFunctionId,
uint256 expiration
) external;
}
// File @chainlink/contracts/src/v0.8/interfaces/OracleInterface.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
interface OracleInterface {
function fulfillOracleRequest(
bytes32 requestId,
uint256 payment,
address callbackAddress,
bytes4 callbackFunctionId,
uint256 expiration,
bytes32 data
) external returns (bool);
function isAuthorizedSender(address node) external view returns (bool);
function withdraw(address recipient, uint256 amount) external;
function withdrawable() external view returns (uint256);
}
// File @chainlink/contracts/src/v0.8/interfaces/OperatorInterface.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
interface OperatorInterface is OracleInterface, ChainlinkRequestInterface {
function operatorRequest(
address sender,
uint256 payment,
bytes32 specId,
bytes4 callbackFunctionId,
uint256 nonce,
uint256 dataVersion,
bytes calldata data
) external;
function fulfillOracleRequest2(
bytes32 requestId,
uint256 payment,
address callbackAddress,
bytes4 callbackFunctionId,
uint256 expiration,
bytes calldata data
) external returns (bool);
function ownerTransferAndCall(
address to,
uint256 value,
bytes calldata data
) external returns (bool success);
function distributeFunds(address payable[] calldata receivers, uint256[] calldata amounts) external payable;
function getAuthorizedSenders() external returns (address[] memory);
function setAuthorizedSenders(address[] calldata senders) external;
function getForwarder() external returns (address);
}
// File @chainlink/contracts/src/v0.8/interfaces/PointerInterface.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
interface PointerInterface {
function getAddress() external view returns (address);
}
// File @chainlink/contracts/src/v0.8/vendor/ENSResolver.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
abstract contract ENSResolver {
function addr(bytes32 node) public view virtual returns (address);
}
// File @chainlink/contracts/src/v0.8/ChainlinkClient.sol@v0.3.1
// MIT
pragma solidity ^0.8.0;
/**
* @title The ChainlinkClient contract
* @notice Contract writers can inherit this contract in order to create requests for the
* Chainlink network
*/
abstract contract ChainlinkClient {
using Chainlink for Chainlink.Request;
uint256 internal constant LINK_DIVISIBILITY = 10**18;
uint256 private constant AMOUNT_OVERRIDE = 0;
address private constant SENDER_OVERRIDE = address(0);
uint256 private constant ORACLE_ARGS_VERSION = 1;
uint256 private constant OPERATOR_ARGS_VERSION = 2;
bytes32 private constant ENS_TOKEN_SUBNAME = keccak256("link");
bytes32 private constant ENS_ORACLE_SUBNAME = keccak256("oracle");
address private constant LINK_TOKEN_POINTER = 0xC89bD4E1632D3A43CB03AAAd5262cbe4038Bc571;
ENSInterface private s_ens;
bytes32 private s_ensNode;
LinkTokenInterface private s_link;
OperatorInterface private s_oracle;
uint256 private s_requestCount = 1;
mapping(bytes32 => address) private s_pendingRequests;
event ChainlinkRequested(bytes32 indexed id);
event ChainlinkFulfilled(bytes32 indexed id);
event ChainlinkCancelled(bytes32 indexed id);
/**
* @notice Creates a request that can hold additional parameters
* @param specId The Job Specification ID that the request will be created for
* @param callbackAddr address to operate the callback on
* @param callbackFunctionSignature function signature to use for the callback
* @return A Chainlink Request struct in memory
*/
function buildChainlinkRequest(
bytes32 specId,
address callbackAddr,
bytes4 callbackFunctionSignature
) internal pure returns (Chainlink.Request memory) {
Chainlink.Request memory req;
return req.initialize(specId, callbackAddr, callbackFunctionSignature);
}
/**
* @notice Creates a request that can hold additional parameters
* @param specId The Job Specification ID that the request will be created for
* @param callbackFunctionSignature function signature to use for the callback
* @return A Chainlink Request struct in memory
*/
function buildOperatorRequest(bytes32 specId, bytes4 callbackFunctionSignature)
internal
view
returns (Chainlink.Request memory)
{
Chainlink.Request memory req;
return req.initialize(specId, address(this), callbackFunctionSignature);
}
/**
* @notice Creates a Chainlink request to the stored oracle address
* @dev Calls `chainlinkRequestTo` with the stored oracle address
* @param req The initialized Chainlink Request
* @param payment The amount of LINK to send for the request
* @return requestId The request ID
*/
function sendChainlinkRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {
return sendChainlinkRequestTo(address(s_oracle), req, payment);
}
/**
* @notice Creates a Chainlink request to the specified oracle address
* @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to
* send LINK which creates a request on the target oracle contract.
* Emits ChainlinkRequested event.
* @param oracleAddress The address of the oracle for the request
* @param req The initialized Chainlink Request
* @param payment The amount of LINK to send for the request
* @return requestId The request ID
*/
function sendChainlinkRequestTo(
address oracleAddress,
Chainlink.Request memory req,
uint256 payment
) internal returns (bytes32 requestId) {
uint256 nonce = s_requestCount;
s_requestCount = nonce + 1;
bytes memory encodedRequest = abi.encodeWithSelector(
ChainlinkRequestInterface.oracleRequest.selector,
SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address
AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent
req.id,
address(this),
req.callbackFunctionId,
nonce,
ORACLE_ARGS_VERSION,
req.buf.buf
);
return _rawRequest(oracleAddress, nonce, payment, encodedRequest);
}
/**
* @notice Creates a Chainlink request to the stored oracle address
* @dev This function supports multi-word response
* @dev Calls `sendOperatorRequestTo` with the stored oracle address
* @param req The initialized Chainlink Request
* @param payment The amount of LINK to send for the request
* @return requestId The request ID
*/
function sendOperatorRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {
return sendOperatorRequestTo(address(s_oracle), req, payment);
}
/**
* @notice Creates a Chainlink request to the specified oracle address
* @dev This function supports multi-word response
* @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to
* send LINK which creates a request on the target oracle contract.
* Emits ChainlinkRequested event.
* @param oracleAddress The address of the oracle for the request
* @param req The initialized Chainlink Request
* @param payment The amount of LINK to send for the request
* @return requestId The request ID
*/
function sendOperatorRequestTo(
address oracleAddress,
Chainlink.Request memory req,
uint256 payment
) internal returns (bytes32 requestId) {
uint256 nonce = s_requestCount;
s_requestCount = nonce + 1;
bytes memory encodedRequest = abi.encodeWithSelector(
OperatorInterface.operatorRequest.selector,
SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address
AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent
req.id,
req.callbackFunctionId,
nonce,
OPERATOR_ARGS_VERSION,
req.buf.buf
);
return _rawRequest(oracleAddress, nonce, payment, encodedRequest);
}
/**
* @notice Make a request to an oracle
* @param oracleAddress The address of the oracle for the request
* @param nonce used to generate the request ID
* @param payment The amount of LINK to send for the request
* @param encodedRequest data encoded for request type specific format
* @return requestId The request ID
*/
function _rawRequest(
address oracleAddress,
uint256 nonce,
uint256 payment,
bytes memory encodedRequest
) private returns (bytes32 requestId) {
requestId = keccak256(abi.encodePacked(this, nonce));
s_pendingRequests[requestId] = oracleAddress;
emit ChainlinkRequested(requestId);
require(s_link.transferAndCall(oracleAddress, payment, encodedRequest), "unable to transferAndCall to oracle");
}
/**
* @notice Allows a request to be cancelled if it has not been fulfilled
* @dev Requires keeping track of the expiration value emitted from the oracle contract.
* Deletes the request from the `pendingRequests` mapping.
* Emits ChainlinkCancelled event.
* @param requestId The request ID
* @param payment The amount of LINK sent for the request
* @param callbackFunc The callback function specified for the request
* @param expiration The time of the expiration for the request
*/
function cancelChainlinkRequest(
bytes32 requestId,
uint256 payment,
bytes4 callbackFunc,
uint256 expiration
) internal {
OperatorInterface requested = OperatorInterface(s_pendingRequests[requestId]);
delete s_pendingRequests[requestId];
emit ChainlinkCancelled(requestId);
requested.cancelOracleRequest(requestId, payment, callbackFunc, expiration);
}
/**
* @notice the next request count to be used in generating a nonce
* @dev starts at 1 in order to ensure consistent gas cost
* @return returns the next request count to be used in a nonce
*/
function getNextRequestCount() internal view returns (uint256) {
return s_requestCount;
}
/**
* @notice Sets the stored oracle address
* @param oracleAddress The address of the oracle contract
*/
function setChainlinkOracle(address oracleAddress) internal {
s_oracle = OperatorInterface(oracleAddress);
}
/**
* @notice Sets the LINK token address
* @param linkAddress The address of the LINK token contract
*/
function setChainlinkToken(address linkAddress) internal {
s_link = LinkTokenInterface(linkAddress);
}
/**
* @notice Sets the Chainlink token address for the public
* network as given by the Pointer contract
*/
function setPublicChainlinkToken() internal {
setChainlinkToken(PointerInterface(LINK_TOKEN_POINTER).getAddress());
}
/**
* @notice Retrieves the stored address of the LINK token
* @return The address of the LINK token
*/
function chainlinkTokenAddress() internal view returns (address) {
return address(s_link);
}
/**
* @notice Retrieves the stored address of the oracle contract
* @return The address of the oracle contract
*/
function chainlinkOracleAddress() internal view returns (address) {
return address(s_oracle);
}
/**
* @notice Allows for a request which was created on another contract to be fulfilled
* on this contract
* @param oracleAddress The address of the oracle contract that will fulfill the request
* @param requestId The request ID used for the response
*/
function addChainlinkExternalRequest(address oracleAddress, bytes32 requestId) internal notPendingRequest(requestId) {
s_pendingRequests[requestId] = oracleAddress;
}
/**
* @notice Sets the stored oracle and LINK token contracts with the addresses resolved by ENS
* @dev Accounts for subnodes having different resolvers
* @param ensAddress The address of the ENS contract
* @param node The ENS node hash
*/
function useChainlinkWithENS(address ensAddress, bytes32 node) internal {
s_ens = ENSInterface(ensAddress);
s_ensNode = node;
bytes32 linkSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_TOKEN_SUBNAME));
ENSResolver resolver = ENSResolver(s_ens.resolver(linkSubnode));
setChainlinkToken(resolver.addr(linkSubnode));
updateChainlinkOracleWithENS();
}
/**
* @notice Sets the stored oracle contract with the address resolved by ENS
* @dev This may be called on its own as long as `useChainlinkWithENS` has been called previously
*/
function updateChainlinkOracleWithENS() internal {
bytes32 oracleSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_ORACLE_SUBNAME));
ENSResolver resolver = ENSResolver(s_ens.resolver(oracleSubnode));
setChainlinkOracle(resolver.addr(oracleSubnode));
}
/**
* @notice Ensures that the fulfillment is valid for this contract
* @dev Use if the contract developer prefers methods instead of modifiers for validation
* @param requestId The request ID for fulfillment
*/
function validateChainlinkCallback(bytes32 requestId)
internal
recordChainlinkFulfillment(requestId)
// solhint-disable-next-line no-empty-blocks
{
}
/**
* @dev Reverts if the sender is not the oracle of the request.
* Emits ChainlinkFulfilled event.
* @param requestId The request ID for fulfillment
*/
modifier recordChainlinkFulfillment(bytes32 requestId) {
require(msg.sender == s_pendingRequests[requestId], "Source must be the oracle of the request");
delete s_pendingRequests[requestId];
emit ChainlinkFulfilled(requestId);
_;
}
/**
* @dev Reverts if the request is already pending
* @param requestId The request ID for fulfillment
*/
modifier notPendingRequest(bytes32 requestId) {
require(s_pendingRequests[requestId] == address(0), "Request is already pending");
_;
}
}
// File contracts/oracle/ScalingPriceOracle.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @notice contract that receives a chainlink price feed and then linearly interpolates that rate over
/// a 28 day period into the VOLT price. Interest is compounded monthly when the rate is updated
/// @author Elliot Friedman
contract ScalingPriceOracle is
Timed,
ChainlinkClient,
IScalingPriceOracle,
BokkyPooBahsDateTimeContract
{
using SafeCast for *;
using Deviation for *;
using Decimal for Decimal.D256;
using Chainlink for Chainlink.Request;
/// ---------- Mutable Price Variables ----------
/// @notice current amount that oracle price is inflating/deflating by monthly in basis points
int256 public override monthlyChangeRateBasisPoints;
/// @notice oracle price. starts off at 1e18 and compounds monthly
uint256 public override oraclePrice = 1e18;
/// ---------- Mutable CPI Variables Packed Into Single Storage Slot to Save an SSTORE & SLOAD ----------
/// @notice the current month's CPI data
uint128 public currentMonth;
/// @notice the previous month's CPI data
uint128 public previousMonth;
/// ---------- Immutable Variables ----------
/// @notice the time frame over which all changes in CPI data are applied
/// 28 days was chosen as that is the shortest length of a month
uint256 public constant override TIMEFRAME = 28 days;
/// @notice the maximum allowable deviation in basis points for a new chainlink oracle update
/// only allow price changes by 20% in a month.
/// Any change over this threshold in either direction will be rejected
uint256 public constant override MAXORACLEDEVIATION = 2_000;
/// @notice address of chainlink oracle to send request
address public immutable oracle;
/// @notice job id that retrieves the latest CPI data
bytes32 public immutable jobId;
/// @notice amount in LINK paid to node operator for each request
uint256 public immutable fee;
/// @param _oracle address of chainlink data provider
/// @param _jobid job id
/// @param _fee maximum fee paid to chainlink data provider
/// @param _currentMonth current month's inflation data
/// @param _previousMonth previous month's inflation data
constructor(
address _oracle,
bytes32 _jobid,
uint256 _fee,
uint128 _currentMonth,
uint128 _previousMonth
) Timed(TIMEFRAME) {
uint256 chainId;
// solhint-disable-next-line no-inline-assembly
assembly {
chainId := chainid()
}
if (chainId == 1 || chainId == 42) {
setPublicChainlinkToken();
}
oracle = _oracle;
jobId = _jobid;
fee = _fee;
currentMonth = _currentMonth;
previousMonth = _previousMonth;
_initTimed();
/// calculate new monthly CPI-U rate in basis points based on current and previous month
int256 aprBasisPoints = getMonthlyAPR();
/// store data and apply the change rate over the next month to the VOLT price
_oracleUpdateChangeRate(aprBasisPoints);
}
// ----------- Getters -----------
/// @notice get the current scaled oracle price
/// applies the change smoothly over a 28 day period
/// scaled by 18 decimals
// prettier-ignore
function getCurrentOraclePrice() public view override returns (uint256) {
int256 oraclePriceInt = oraclePrice.toInt256();
int256 timeDelta = Math.min(block.timestamp - startTime, TIMEFRAME).toInt256();
int256 pricePercentageChange = oraclePriceInt * monthlyChangeRateBasisPoints / Constants.BP_INT;
int256 priceDelta = pricePercentageChange * timeDelta / TIMEFRAME.toInt256();
return (oraclePriceInt + priceDelta).toUint256();
}
/// @notice get APR from chainlink data by measuring (current month - previous month) / previous month
/// @return percentageChange percentage change in basis points over past month
function getMonthlyAPR() public view returns (int256 percentageChange) {
int256 delta = int128(currentMonth) - int128(previousMonth);
percentageChange = (delta * Constants.BP_INT) / int128(previousMonth);
}
/// ------------- Public API To Request Chainlink Data -------------
/// @notice Create a Chainlink request to retrieve API response, find the target
/// data, then multiply by 1000 (to remove decimal places from data).
/// @return requestId for this request
/// only allows 1 request per month after the 14th day
/// callable by anyone after time period and 14th day of the month
function requestCPIData()
external
virtual /// virtual for overriding in mock
afterTimeInit
returns (bytes32 requestId)
{
require(
getDay(block.timestamp) > 14,
"ScalingPriceOracle: cannot request data before the 15th"
);
Chainlink.Request memory request = buildChainlinkRequest(
jobId,
address(this),
this.fulfill.selector
);
return sendChainlinkRequestTo(oracle, request, fee);
}
/// ------------- Chainlink Node Operator API -------------
/// @notice Receive the response in the form of uint256
/// @param _requestId of the chainlink request
/// @param _cpiData latest CPI data from BLS
/// called by the chainlink oracle
function fulfill(bytes32 _requestId, uint256 _cpiData)
external
recordChainlinkFulfillment(_requestId)
{
_updateCPIData(_cpiData);
}
// ----------- Internal state changing api -----------
/// @notice helper function to store and validate new chainlink data
/// @param _cpiData latest CPI data from BLS
/// update will fail if new values exceed deviation threshold of 20% monthly
function _updateCPIData(uint256 _cpiData) internal {
require(
MAXORACLEDEVIATION.isWithinDeviationThreshold(
currentMonth.toInt256(),
_cpiData.toInt256()
),
"ScalingPriceOracle: Chainlink data outside of deviation threshold"
);
/// store CPI data, removes stale data
_addNewMonth(uint128(_cpiData));
/// calculate new monthly CPI-U rate in basis points
int256 aprBasisPoints = getMonthlyAPR();
/// pass data to VOLT Price Oracle
_oracleUpdateChangeRate(aprBasisPoints);
}
/// @notice function for chainlink oracle to be able to call in and change the rate
/// @param newChangeRateBasisPoints the new monthly interest rate applied to the chainlink oracle price
///
/// function effects:
/// compounds interest accumulated over period
/// set new change rate in basis points for next period
function _oracleUpdateChangeRate(int256 newChangeRateBasisPoints) internal {
/// compound the interest with the current rate
oraclePrice = getCurrentOraclePrice();
int256 currentChangeRateBasisPoints = monthlyChangeRateBasisPoints; /// save 1 SSLOAD
/// emit even if there isn't an update
emit CPIMonthlyChangeRateUpdate(
currentChangeRateBasisPoints,
newChangeRateBasisPoints
);
/// if the oracle change rate is the same as last time, save an SSTORE
if (newChangeRateBasisPoints == currentChangeRateBasisPoints) {
return;
}
monthlyChangeRateBasisPoints = newChangeRateBasisPoints;
}
/// @notice this is the only method needed as we will be storing the most recent 2 months of data
/// @param newMonth the new month to store
function _addNewMonth(uint128 newMonth) internal {
previousMonth = currentMonth;
currentMonth = newMonth;
}
}
// File contracts/mock/MockScalingPriceOracle.sol
// GPL-3.0-or-later
pragma solidity ^0.8.4;
/// @notice Testing contract that allows for updates without mocking chainlink calls
contract MockScalingPriceOracle is ScalingPriceOracle {
using Chainlink for Chainlink.Request;
address owner;
constructor(
address _oracle,
bytes32 _jobid,
uint256 _fee,
uint128 _currentMonth,
uint128 _previousMonth
)
ScalingPriceOracle(_oracle, _jobid, _fee, _currentMonth, _previousMonth)
{
owner = msg.sender;
}
function fulfill(uint256 _cpiData) external {
_updateCPIData(_cpiData);
}
function compoundInterest() public {
_oracleUpdateChangeRate(monthlyChangeRateBasisPoints);
}
function setStartTime(uint256 newStartTime) public {
startTime = newStartTime;
}
function setStartTimeAndCompoundInterest(uint256 newStartTime) public {
setStartTime(newStartTime);
compoundInterest();
}
function rescueTokens(IERC20 token, address to, uint256 amount) external {
require(msg.sender == owner, "!owner");
token.transfer(to, amount);
}
/// @notice Create a Chainlink request to retrieve API response, find the target
/// data, then multiply by 1000 (to remove decimal places from data).
/// @return requestId for this request
/// only allows 1 request per month after the 14th day
/// callable by anyone after time period and 14th day of the month
function requestCPIData()
external
override
returns (bytes32 requestId)
{
Chainlink.Request memory request = buildChainlinkRequest(
jobId,
address(this),
ScalingPriceOracle.fulfill.selector
);
return sendChainlinkRequestTo(oracle, request, fee);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"bytes32","name":"_jobid","type":"bytes32"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint128","name":"_currentMonth","type":"uint128"},{"internalType":"uint128","name":"_previousMonth","type":"uint128"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int256","name":"oldChangeRateBasisPoints","type":"int256"},{"indexed":false,"internalType":"int256","name":"newChangeRateBasisPoints","type":"int256"}],"name":"CPIMonthlyChangeRateUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"DurationUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"TimerReset","type":"event"},{"inputs":[],"name":"DOW_FRI","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOW_MON","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOW_SAT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOW_SUN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOW_THU","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOW_TUE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOW_WED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXORACLEDEVIATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OFFSET19700101","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECONDS_PER_DAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECONDS_PER_HOUR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECONDS_PER_MINUTE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMEFRAME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"}],"name":"_daysFromDate","outputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"_daysToDate","outputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"}],"name":"_getDaysInMonth","outputs":[{"internalType":"uint256","name":"daysInMonth","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"year","type":"uint256"}],"name":"_isLeapYear","outputs":[{"internalType":"bool","name":"leapYear","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"_now","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_nowDateTime","outputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"},{"internalType":"uint256","name":"hour","type":"uint256"},{"internalType":"uint256","name":"minute","type":"uint256"},{"internalType":"uint256","name":"second","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"addDays","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_hours","type":"uint256"}],"name":"addHours","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_minutes","type":"uint256"}],"name":"addMinutes","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_months","type":"uint256"}],"name":"addMonths","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_seconds","type":"uint256"}],"name":"addSeconds","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_years","type":"uint256"}],"name":"addYears","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"compoundInterest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentMonth","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTimestamp","type":"uint256"},{"internalType":"uint256","name":"toTimestamp","type":"uint256"}],"name":"diffDays","outputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTimestamp","type":"uint256"},{"internalType":"uint256","name":"toTimestamp","type":"uint256"}],"name":"diffHours","outputs":[{"internalType":"uint256","name":"_hours","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTimestamp","type":"uint256"},{"internalType":"uint256","name":"toTimestamp","type":"uint256"}],"name":"diffMinutes","outputs":[{"internalType":"uint256","name":"_minutes","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTimestamp","type":"uint256"},{"internalType":"uint256","name":"toTimestamp","type":"uint256"}],"name":"diffMonths","outputs":[{"internalType":"uint256","name":"_months","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTimestamp","type":"uint256"},{"internalType":"uint256","name":"toTimestamp","type":"uint256"}],"name":"diffSeconds","outputs":[{"internalType":"uint256","name":"_seconds","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTimestamp","type":"uint256"},{"internalType":"uint256","name":"toTimestamp","type":"uint256"}],"name":"diffYears","outputs":[{"internalType":"uint256","name":"_years","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_cpiData","type":"uint256"}],"name":"fulfill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cpiData","type":"uint256"}],"name":"fulfill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentOraclePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getDay","outputs":[{"internalType":"uint256","name":"day","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getDayOfWeek","outputs":[{"internalType":"uint256","name":"dayOfWeek","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getDaysInMonth","outputs":[{"internalType":"uint256","name":"daysInMonth","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getHour","outputs":[{"internalType":"uint256","name":"hour","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getMinute","outputs":[{"internalType":"uint256","name":"minute","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getMonth","outputs":[{"internalType":"uint256","name":"month","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getMonthlyAPR","outputs":[{"internalType":"int256","name":"percentageChange","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getSecond","outputs":[{"internalType":"uint256","name":"second","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getYear","outputs":[{"internalType":"uint256","name":"year","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"isLeapYear","outputs":[{"internalType":"bool","name":"leapYear","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"isTimeEnded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTimeStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"}],"name":"isValidDate","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"},{"internalType":"uint256","name":"hour","type":"uint256"},{"internalType":"uint256","name":"minute","type":"uint256"},{"internalType":"uint256","name":"second","type":"uint256"}],"name":"isValidDateTime","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"isWeekDay","outputs":[{"internalType":"bool","name":"weekDay","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"isWeekEnd","outputs":[{"internalType":"bool","name":"weekEnd","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"jobId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"monthlyChangeRateBasisPoints","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oraclePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousMonth","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requestCPIData","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTimeAndCompoundInterest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_days","type":"uint256"}],"name":"subDays","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_hours","type":"uint256"}],"name":"subHours","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_minutes","type":"uint256"}],"name":"subMinutes","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_months","type":"uint256"}],"name":"subMonths","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_seconds","type":"uint256"}],"name":"subSeconds","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"_years","type":"uint256"}],"name":"subYears","outputs":[{"internalType":"uint256","name":"newTimestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"timeSinceStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"}],"name":"timestampFromDate","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"},{"internalType":"uint256","name":"hour","type":"uint256"},{"internalType":"uint256","name":"minute","type":"uint256"},{"internalType":"uint256","name":"second","type":"uint256"}],"name":"timestampFromDateTime","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"timestampToDate","outputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"timestampToDateTime","outputs":[{"internalType":"uint256","name":"year","type":"uint256"},{"internalType":"uint256","name":"month","type":"uint256"},{"internalType":"uint256","name":"day","type":"uint256"},{"internalType":"uint256","name":"hour","type":"uint256"},{"internalType":"uint256","name":"minute","type":"uint256"},{"internalType":"uint256","name":"second","type":"uint256"}],"stateMutability":"pure","type":"function"}]Contract Creation Code
60e06040526001600655670de0b6b3a76400006009553480156200002257600080fd5b5060405162002b5538038062002b55833981016040819052620000459162000518565b84848484846224ea006200005981620000f2565b504660018114806200006b575080602a145b156200007b576200007b6200018a565b6001600160a01b03861660805260a085905260c08490526001600160801b03828116600160801b0290841617600a55620000b46200022b565b6000620000c062000266565b9050620000cd81620002c8565b5050600b80546001600160a01b03191633179055506200073298505050505050505050565b80620001455760405162461bcd60e51b815260206004820152601460248201527f54696d65643a207a65726f206475726174696f6e00000000000000000000000060448201526064015b60405180910390fd5b600180549082905560408051828152602081018490527f53356ce8408d6a56b0e61bcd41861e12eb5772987856f889e38e4aba4ffa104c910160405180910390a15050565b6200022973c89bd4e1632d3a43cb03aaad5262cbe4038bc5716001600160a01b03166338cc48316040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000207919062000576565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b565b4260008190556040519081527fd1dbb2ce8081405078443ef34dae718285114121a39370b14ef01b9d2b0a20839060200160405180910390a1565b600a5460009081906200028c906001600160801b03600160801b820481169116620005aa565b600a54600f91820b9250600160801b90046001600160801b0316900b620002b66127108362000600565b620002c2919062000691565b91505090565b620002d262000324565b60095560085460408051828152602081018490527f6b0ebc7a6cc69b76f60d94653780dbb1e0747946420566eb5152055bc2307d96910160405180910390a1808214156200031e575050565b50600855565b6000806200033f6009546200040560201b62000f9e1760201c565b905060006200038162000370600054426200035b9190620006d1565b6224ea006200047560201b6200100c1760201c565b6200040560201b62000f9e1760201c565b905060006127106008548462000398919062000600565b620003a4919062000691565b90506000620003c16224ea006200040560201b62000f9e1760201c565b620003cd848462000600565b620003d9919062000691565b9050620003fc620003eb8286620006eb565b6200048f60201b620010221760201c565b94505050505090565b60006001600160ff1b03821115620004715760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b60648201526084016200013c565b5090565b600081831062000486578162000488565b825b9392505050565b600080821215620004715760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f73697469766560448201526064016200013c565b80516001600160a01b0381168114620004fb57600080fd5b919050565b80516001600160801b0381168114620004fb57600080fd5b600080600080600060a086880312156200053157600080fd5b6200053c86620004e3565b945060208601519350604086015192506200055a6060870162000500565b91506200056a6080870162000500565b90509295509295909350565b6000602082840312156200058957600080fd5b6200048882620004e3565b634e487b7160e01b600052601160045260246000fd5b6000600f82810b9084900b828112801560016001607f1b0319830184121615620005d857620005d862000594565b60016001607f1b0382018313811615620005f657620005f662000594565b5090039392505050565b60006001600160ff1b038184138284138082168684048611161562000629576200062962000594565b600160ff1b60008712828116878305891216156200064b576200064b62000594565b600087129250878205871284841616156200066a576200066a62000594565b8785058712818416161562000683576200068362000594565b505050929093029392505050565b600082620006af57634e487b7160e01b600052601260045260246000fd5b600160ff1b821460001984141615620006cc57620006cc62000594565b500590565b600082821015620006e657620006e662000594565b500390565b600080821280156001600160ff1b038490038513161562000710576200071062000594565b600160ff1b83900384128116156200072c576200072c62000594565b50500190565b60805160a05160c0516123de62000777600039600081816109180152610d3101526000818161088d0152610cdb0152600081816106eb0152610d0f01526123de6000f3fe608060405234801561001057600080fd5b50600436106104525760003560e01c8063862a4d4711610241578063b8d16dbc1161013b578063ddca3f43116100c3578063ea1c169011610087578063ea1c169014610966578063f615ed5414610979578063f9fd52501461098c578063fa93f88314610994578063ff2258cb146109a757600080fd5b8063ddca3f4314610913578063de5101af1461093a578063e425e8b51461094d578063e897ca2714610955578063e95564301461095e57600080fd5b8063c9d346221161010a578063c9d34622146108ca578063cea9d26f146108dd578063cfbb9f37146108f0578063d2b50743146108f8578063d6582d0d1461090057600080fd5b8063b8d16dbc14610875578063c2939d9714610888578063c7b6fd6a146108af578063c7edf88c146108c257600080fd5b80639e524caa116101c9578063acc4bd081161018d578063acc4bd0814610839578063ad203bd414610841578063ae951b2e14610854578063b05eb08d1461085c578063b3bb8cd41461086f57600080fd5b80639e524caa146107f7578063a1b58a771461080a578063a324ad2414610812578063a3f144ae14610825578063abb13dfe1461082f57600080fd5b80638d4a2d39116102105780638d4a2d391461076657806390059aed146107795780639220d426146107a757806392d66313146107dc57806397db12f3146107ef57600080fd5b8063862a4d471461072557806389a3a00d146107385780638aa001fc1461074b5780638bbf51b71461075e57600080fd5b80634357855e1161035257806362fb9697116102da57806374f0314f1161029e57806374f0314f146106ad578063753b8807146106b757806378e97925146106ca5780637be34109146106d35780637dc0d1d0146106e657600080fd5b806362fb96971461066357806365c7284014610676578063668aa8241461068957806367fc6dea146106925780637217523c1461069a57600080fd5b8063487589941161032157806348758994146105f95780634b2afe63146106025780634b321502146106345780634df86126146106475780635e05bd6d1461065057600080fd5b80634357855e146105ad5780634371c465146105c0578063442b8c79146105d3578063444fda82146105e657600080fd5b80631f809b78116103e05780633293d007116103a45780633293d0071461054e5780633e0a322d146105615780633e239e1a146105745780633f9e0eb7146105875780634355644d1461059a57600080fd5b80631f809b781461050357806322f8a2b8146105185780632579f45c1461052b57806329441674146105335780632af123b81461053b57600080fd5b806310848ddf1161042757806310848ddf146104af578063126702a0146104c257806314b2d6dc146104ca5780631e0582e9146104dd5780631f4f77b2146104f057600080fd5b806250155314610457578062d89b331461047d57806302e98e0d146104935780630fb5a6b4146104a6575b600080fd5b61046a610465366004611f85565b6109ba565b6040519081526020015b60405180910390f35b60005415155b6040519015158152602001610474565b61046a6104a1366004611f85565b6109cd565b61046a60015481565b61046a6104bd366004611fa7565b6109d9565b61046a600281565b6104836104d8366004611fc0565b6109ea565b61046a6104eb366004611fc0565b6109ff565b61046a6104fe366004611fc0565b610a0c565b610516610511366004611fa7565b610a19565b005b61046a610526366004611fa7565b610a2d565b61046a610a38565b61046a600781565b61046a610549366004611f85565b610a94565b61048361055c366004611fec565b610aa0565b61051661056f366004611fa7565b600055565b61046a610582366004611fa7565b610abb565b61046a610595366004611f85565b610ac6565b61046a6105a8366004611f85565b610ad2565b6105166105bb366004611f85565b610ade565b6104836105ce366004611fa7565b610bad565b61046a6105e1366004611f85565b610bb8565b61046a6105f4366004611f85565b610bc4565b61046a6107d081565b600a5461061c90600160801b90046001600160801b031681565b6040516001600160801b039091168152602001610474565b61046a610642366004611f85565b610bd0565b61046a610e1081565b61046a61065e366004611fec565b610bdc565b61046a610671366004611f85565b610bf6565b61046a610684366004611fa7565b610c02565b61046a60095481565b61046a610c0d565b61046a6106a8366004611f85565b610c44565b61046a6201518081565b6105166106c5366004611fa7565b610c50565b61046a60005481565b61046a6106e1366004611f85565b610c59565b61070d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610474565b600a5461061c906001600160801b031681565b61046a610746366004611f85565b610c65565b61046a610759366004611fa7565b610c71565b61046a600381565b61046a610774366004611f85565b610c7c565b61078c610787366004611fa7565b610c88565b60408051938452602084019290925290820152606001610474565b6107af610ca3565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610474565b61046a6107ea366004611fa7565b610cc8565b61046a610cd3565b61046a610805366004611f85565b610d55565b61046a610d61565b61046a610820366004611fa7565b610df5565b61046a62253d8c81565b61046a6224ea0081565b61046a610e00565b61046a61084f366004611f85565b610e1c565b610483610e28565b61048361086a366004611fa7565b610e38565b4261046a565b610483610883366004611fa7565b610e43565b61046a7f000000000000000000000000000000000000000000000000000000000000000081565b61046a6108bd366004611f85565b610e4e565b61046a600681565b61046a6108d8366004611f85565b610e5a565b6105166108eb366004612044565b610e66565b61046a600481565b61046a600581565b61048361090e366004611fa7565b610f22565b61046a7f000000000000000000000000000000000000000000000000000000000000000081565b61078c610948366004611fa7565b610f2d565b610516610f48565b61046a60085481565b61046a603c81565b6107af610974366004611fa7565b610f55565b61046a610987366004611f85565b610f7b565b61046a600181565b61046a6109a2366004611fa7565b610f87565b61046a6109b5366004611f85565b610f92565b60006109c68383611074565b9392505050565b60006109c6838361109b565b60006109e4826110c0565b92915050565b60006109f78484846110f4565b949350505050565b60006109f784848461114a565b60006109f7848484611287565b610a2281600055565b610a2a610f48565b50565b60006109e4826112a2565b600a546000908190610a5c906001600160801b03600160801b82048116911661209b565b600a54600f91820b9250600160801b90046001600160801b0316900b610a84612710836120eb565b610a8e9190612186565b91505090565b60006109c683836112d6565b6000610ab08787878787876112f2565b979650505050505050565b60006109e482611332565b60006109c68383611350565b60006109c683836113d6565b60008281526007602052604090205482906001600160a01b03163314610b5c5760405162461bcd60e51b815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604482015267081c995c5d595cdd60c21b60648201526084015b60405180910390fd5b60008181526007602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2610ba8826114a8565b505050565b60006109e482611597565b60006109c683836115ac565b60006109c683836115e0565b60006109c68383611661565b6000610ab0878787878787611688565b9695505050505050565b60006109c683836116d9565b60006109e4826116f2565b60008054610c1b5750600090565b60015460008054610c2c90426121b4565b9050818111610c3b5780610c3d565b815b9250505090565b60006109c68383611706565b610a2a816114a8565b60006109c68383611715565b60006109c6838361179c565b60006109e4826117a9565b60006109c683836117b6565b6000806000610c96846117c2565b9250925092509193909250565b600080600080600080610cb542611936565b949b939a50919850965094509092509050565b60006109e4826119a5565b600080610d087f0000000000000000000000000000000000000000000000000000000000000000306321abc2af60e11b6119c4565b9050610a8e7f0000000000000000000000000000000000000000000000000000000000000000827f00000000000000000000000000000000000000000000000000000000000000006119e0565b60006109c68383611a69565b600080610d6f600954610f9e565b90506000610d95610d9060005442610d8791906121b4565b6224ea0061100c565b610f9e565b9050600061271060085484610daa91906120eb565b610db49190612186565b90506000610dc46224ea00610f9e565b610dce84846120eb565b610dd89190612186565b9050610dec610de782866121cb565b611022565b94505050505090565b60006109e482611a76565b6000610e0a610c0d565b600154610e1791906121b4565b905090565b60006109c68383611a94565b6000610e32610e00565b15919050565b60006109e482611b68565b60006109e482611ba4565b60006109c68383611bc9565b60006109c68383611bd8565b600b546001600160a01b03163314610ea95760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b6044820152606401610b53565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610ef8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1c919061220c565b50505050565b60006109e482611bf5565b6000806000610f3b84611c0a565b9196909550909350915050565b610f53600854611c1e565b565b600080600080600080610f6787611936565b949c939b5091995097509550909350915050565b60006109c68383611c77565b60006109e482611c83565b60006109c68383611c9f565b60006001600160ff1b038211156110085760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610b53565b5090565b600081831061101b57816109c6565b5090919050565b6000808212156110085760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f7369746976656044820152606401610b53565b6000611082610e108361222e565b61108c90846121b4565b9050828111156109e457600080fd5b6000818311156110aa57600080fd5b603c6110b684846121b4565b6109c6919061224d565b60008080806110da6110d5620151808761224d565b6117c2565b919450925090506110eb8383611350565b95945050505050565b60006107b284101580156111085750600083115b80156111155750600c8311155b156109c65760006111268585611350565b90506000831180156111385750808311155b1561114257600191505b509392505050565b60006107b284101561115b57600080fd5b838383600062253d8c60046064600c611175600e88612261565b61117f9190612186565b61118b886113246121cb565b61119591906121cb565b61119f9190612186565b6111aa9060036120eb565b6111b49190612186565b600c806111c2600e88612261565b6111cc9190612186565b6111d790600c6120eb565b6111e2600288612261565b6111ec9190612261565b6111f89061016f6120eb565b6112029190612186565b6004600c611211600e89612261565b61121b9190612186565b611227896112c06121cb565b61123191906121cb565b61123d906105b56120eb565b6112479190612186565b611253617d4b87612261565b61125d91906121cb565b61126791906121cb565b6112719190612261565b61127b9190612261565b98975050505050505050565b60006201518061129885858561114a565b6109f7919061222e565b6000806112b2620151808461224d565b905060076112c18260036122a0565b6112cb91906122b8565b6109c69060016122a0565b6000818311156112e557600080fd5b610e106110b684846121b4565b60006112ff8787876110f4565b15610bec576018841080156113145750603c83105b80156113205750603c82105b15610bec575060019695505050505050565b60008061134262015180846122b8565b90506109c6610e108261224d565b600081600114806113615750816003145b8061136c5750816005145b806113775750816007145b806113825750816008145b8061138d575081600a145b80611398575081600c145b156113a55750601f6109e4565b816002146113b55750601e6109e4565b6113be83611b68565b6113c957601c6113cc565b601d5b60ff169392505050565b60008080806113eb6110d5620151808861224d565b919450925090506113fc85836122a0565b9150600c61140b6001846121b4565b611415919061224d565b61141f90846122a0565b9250600c61142e6001846121b4565b61143891906122b8565b6114439060016122a0565b915060006114518484611350565b90508082111561145f578091505b61146c62015180886122b8565b6201518061147b86868661114a565b611485919061222e565b61148f91906122a0565b94508685101561149e57600080fd5b5050505092915050565b600a546114d4906114c1906001600160801b0316610f9e565b6114ca83610f9e565b6107d09190611ced565b6115505760405162461bcd60e51b815260206004820152604160248201527f5363616c696e6750726963654f7261636c653a20436861696e6c696e6b20646160448201527f7461206f757473696465206f6620646576696174696f6e207468726573686f6c6064820152601960fa1b608482015260a401610b53565b600a80546fffffffffffffffffffffffffffffffff196001600160801b03918216600160801b02169083161790556000611588610a38565b905061159381611c1e565b5050565b600060066115a4836112a2565b101592915050565b60008080806115c16110d5620151808861224d565b919450925090506115d285846122a0565b925060006114518484611350565b60008080806115f56110d5620151808861224d565b9194509250905061160685846121b4565b925060006116148484611350565b905080821115611622578091505b61162f62015180886122b8565b6201518061163e86868661114a565b611648919061222e565b61165291906122a0565b94508685111561149e57600080fd5b600061166f610e108361222e565b61167990846122a0565b9050828110156109e457600080fd5b600081611696603c8561222e565b6116a2610e108761222e565b620151806116b18b8b8b61114a565b6116bb919061222e565b6116c591906122a0565b6116cf91906122a0565b610ab091906122a0565b6000818311156116e857600080fd5b6109c683836121b4565b60008080610bec6110d5620151808661224d565b600061166f620151808361222e565b60008183111561172457600080fd5b6000808080808061173b6110d5620151808b61224d565b919750955093506117526110d5620151808a61224d565b919450925090508461176587600c61222e565b8361177186600c61222e565b61177b91906122a0565b61178591906121b4565b61178f91906121b4565b9998505050505050505050565b600061166f603c8361222e565b60006109e4603c836122b8565b600061167982846122a0565b60008080838162253d8c6117d98362010bd96121cb565b6117e391906121cb565b9050600062023ab16117f68360046120eb565b6118009190612186565b905060046118118262023ab16120eb565b61181c9060036121cb565b6118269190612186565b6118309083612261565b9150600062164b096118438460016121cb565b61184f90610fa06120eb565b6118599190612186565b90506004611869826105b56120eb565b6118739190612186565b61187d9084612261565b61188890601f6121cb565b9250600061098f61189a8560506120eb565b6118a49190612186565b9050600060506118b68361098f6120eb565b6118c09190612186565b6118ca9086612261565b90506118d7600b83612186565b94506118e485600c6120eb565b6118ef8360026121cb565b6118f99190612261565b91508483611908603187612261565b6119139060646120eb565b61191d91906121cb565b61192791906121cb565b9a919950975095505050505050565b6000808080808061194d6110d5620151808961224d565b91975095509350600061196362015180896122b8565b9050611971610e108261224d565b935061197f610e10826122b8565b905061198c603c8261224d565b9250611999603c826122b8565b91505091939550919395565b600080806119b96110d5620151808661224d565b509095945050505050565b6119cc611f4a565b6119d4611f4a565b6110eb81868686611d04565b6006546000906119f18160016122a0565b600655835160408086015160808701515191516000936320214ca360e11b93611a299386938493923092918a91600191602401612319565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050610bec86838684611d41565b6000611082603c8361222e565b60008080611a8a6110d5620151808661224d565b5095945050505050565b6000808080611aa96110d5620151808861224d565b91945092509050600085611abe6001856121b4565b611ac986600c61222e565b611ad391906122a0565b611add91906121b4565b9050611aea600c8261224d565b9350611af7600c826122b8565b611b029060016122a0565b92506000611b108585611350565b905080831115611b1e578092505b611b2b62015180896122b8565b62015180611b3a87878761114a565b611b44919061222e565b611b4e91906122a0565b955087861115611b5d57600080fd5b505050505092915050565b6000611b756004836122b8565b158015611b8b5750611b886064836122b8565b15155b806109e45750611b9d610190836122b8565b1592915050565b6000808080611bb96110d5620151808761224d565b919450925090506110eb83611b68565b6000611082620151808361222e565b600081831115611be757600080fd5b620151806110b684846121b4565b60006005611c02836112a2565b111592915050565b60008080610f3b6110d5620151808661224d565b611c26610d61565b60095560085460408051828152602081018490527f6b0ebc7a6cc69b76f60d94653780dbb1e0747946420566eb5152055bc2307d96910160405180910390a180821415611c71575050565b50600855565b600061108c82846121b4565b600080611c92610e10846122b8565b90506109c6603c8261224d565b600081831115611cae57600080fd5b60008080808080611cc56110d5620151808b61224d565b91975095509350611cdc6110d5620151808a61224d565b9194509250905061178f86846121b4565b6000611cf98383611e9e565b909310159392505050565b611d0c611f4a565b611d1c8560800151610100611ee5565b50509183526001600160a01b031660208301526001600160e01b031916604082015290565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152600790925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a260048054604051630200057560e51b81526001600160a01b0390911691634000aea091611e039189918891889101612381565b6020604051808303816000875af1158015611e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e46919061220c565b6109f75760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b6064820152608401610b53565b600080611eab8385612261565b9050600084611ebc612710846120eb565b611ec69190612186565b90506110eb60008212611ed95781611022565b610de7826000196120eb565b604080518082019091526060815260006020820152611f056020836122b8565b15611f2d57611f156020836122b8565b611f209060206121b4565b611f2a90836122a0565b91505b506020828101829052604080518085526000815290920101905290565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b60008060408385031215611f9857600080fd5b50508035926020909101359150565b600060208284031215611fb957600080fd5b5035919050565b600080600060608486031215611fd557600080fd5b505081359360208301359350604090920135919050565b60008060008060008060c0878903121561200557600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b6001600160a01b0381168114610a2a57600080fd5b60008060006060848603121561205957600080fd5b83356120648161202f565b925060208401356120748161202f565b929592945050506040919091013590565b634e487b7160e01b600052601160045260246000fd5b600081600f0b83600f0b600081128160016001607f1b0319018312811516156120c6576120c6612085565b8160016001607f1b030183138116156120e1576120e1612085565b5090039392505050565b60006001600160ff1b038184138284138082168684048611161561211157612111612085565b600160ff1b600087128281168783058912161561213057612130612085565b6000871292508782058712848416161561214c5761214c612085565b8785058712818416161561216257612162612085565b505050929093029392505050565b634e487b7160e01b600052601260045260246000fd5b60008261219557612195612170565b600160ff1b8214600019841416156121af576121af612085565b500590565b6000828210156121c6576121c6612085565b500390565b600080821280156001600160ff1b03849003851316156121ed576121ed612085565b600160ff1b839003841281161561220657612206612085565b50500190565b60006020828403121561221e57600080fd5b815180151581146109c657600080fd5b600081600019048311821515161561224857612248612085565b500290565b60008261225c5761225c612170565b500490565b60008083128015600160ff1b85018412161561227f5761227f612085565b6001600160ff1b038401831381161561229a5761229a612085565b50500390565b600082198211156122b3576122b3612085565b500190565b6000826122c7576122c7612170565b500690565b6000815180845260005b818110156122f2576020818501810151868301820152016122d6565b81811115612304576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090612372838201856122cc565b9b9a5050505050505050505050565b60018060a01b03841681528260208201526060604082015260006110eb60608301846122cc56fea26469706673582212204498dc9b0963c756c54a7907f7525b15753280ae685cec686a4a162bc3f3967364736f6c634300080a0033000000000000000000000000049bd8c3adc3fe7d3fc2a44541d955a537c2a48436663766623461626365646234383561623237656237626233396361663832370000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000000000000044a3c0000000000000000000000000000000000000000000000000000000000044112
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106104525760003560e01c8063862a4d4711610241578063b8d16dbc1161013b578063ddca3f43116100c3578063ea1c169011610087578063ea1c169014610966578063f615ed5414610979578063f9fd52501461098c578063fa93f88314610994578063ff2258cb146109a757600080fd5b8063ddca3f4314610913578063de5101af1461093a578063e425e8b51461094d578063e897ca2714610955578063e95564301461095e57600080fd5b8063c9d346221161010a578063c9d34622146108ca578063cea9d26f146108dd578063cfbb9f37146108f0578063d2b50743146108f8578063d6582d0d1461090057600080fd5b8063b8d16dbc14610875578063c2939d9714610888578063c7b6fd6a146108af578063c7edf88c146108c257600080fd5b80639e524caa116101c9578063acc4bd081161018d578063acc4bd0814610839578063ad203bd414610841578063ae951b2e14610854578063b05eb08d1461085c578063b3bb8cd41461086f57600080fd5b80639e524caa146107f7578063a1b58a771461080a578063a324ad2414610812578063a3f144ae14610825578063abb13dfe1461082f57600080fd5b80638d4a2d39116102105780638d4a2d391461076657806390059aed146107795780639220d426146107a757806392d66313146107dc57806397db12f3146107ef57600080fd5b8063862a4d471461072557806389a3a00d146107385780638aa001fc1461074b5780638bbf51b71461075e57600080fd5b80634357855e1161035257806362fb9697116102da57806374f0314f1161029e57806374f0314f146106ad578063753b8807146106b757806378e97925146106ca5780637be34109146106d35780637dc0d1d0146106e657600080fd5b806362fb96971461066357806365c7284014610676578063668aa8241461068957806367fc6dea146106925780637217523c1461069a57600080fd5b8063487589941161032157806348758994146105f95780634b2afe63146106025780634b321502146106345780634df86126146106475780635e05bd6d1461065057600080fd5b80634357855e146105ad5780634371c465146105c0578063442b8c79146105d3578063444fda82146105e657600080fd5b80631f809b78116103e05780633293d007116103a45780633293d0071461054e5780633e0a322d146105615780633e239e1a146105745780633f9e0eb7146105875780634355644d1461059a57600080fd5b80631f809b781461050357806322f8a2b8146105185780632579f45c1461052b57806329441674146105335780632af123b81461053b57600080fd5b806310848ddf1161042757806310848ddf146104af578063126702a0146104c257806314b2d6dc146104ca5780631e0582e9146104dd5780631f4f77b2146104f057600080fd5b806250155314610457578062d89b331461047d57806302e98e0d146104935780630fb5a6b4146104a6575b600080fd5b61046a610465366004611f85565b6109ba565b6040519081526020015b60405180910390f35b60005415155b6040519015158152602001610474565b61046a6104a1366004611f85565b6109cd565b61046a60015481565b61046a6104bd366004611fa7565b6109d9565b61046a600281565b6104836104d8366004611fc0565b6109ea565b61046a6104eb366004611fc0565b6109ff565b61046a6104fe366004611fc0565b610a0c565b610516610511366004611fa7565b610a19565b005b61046a610526366004611fa7565b610a2d565b61046a610a38565b61046a600781565b61046a610549366004611f85565b610a94565b61048361055c366004611fec565b610aa0565b61051661056f366004611fa7565b600055565b61046a610582366004611fa7565b610abb565b61046a610595366004611f85565b610ac6565b61046a6105a8366004611f85565b610ad2565b6105166105bb366004611f85565b610ade565b6104836105ce366004611fa7565b610bad565b61046a6105e1366004611f85565b610bb8565b61046a6105f4366004611f85565b610bc4565b61046a6107d081565b600a5461061c90600160801b90046001600160801b031681565b6040516001600160801b039091168152602001610474565b61046a610642366004611f85565b610bd0565b61046a610e1081565b61046a61065e366004611fec565b610bdc565b61046a610671366004611f85565b610bf6565b61046a610684366004611fa7565b610c02565b61046a60095481565b61046a610c0d565b61046a6106a8366004611f85565b610c44565b61046a6201518081565b6105166106c5366004611fa7565b610c50565b61046a60005481565b61046a6106e1366004611f85565b610c59565b61070d7f000000000000000000000000049bd8c3adc3fe7d3fc2a44541d955a537c2a48481565b6040516001600160a01b039091168152602001610474565b600a5461061c906001600160801b031681565b61046a610746366004611f85565b610c65565b61046a610759366004611fa7565b610c71565b61046a600381565b61046a610774366004611f85565b610c7c565b61078c610787366004611fa7565b610c88565b60408051938452602084019290925290820152606001610474565b6107af610ca3565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610474565b61046a6107ea366004611fa7565b610cc8565b61046a610cd3565b61046a610805366004611f85565b610d55565b61046a610d61565b61046a610820366004611fa7565b610df5565b61046a62253d8c81565b61046a6224ea0081565b61046a610e00565b61046a61084f366004611f85565b610e1c565b610483610e28565b61048361086a366004611fa7565b610e38565b4261046a565b610483610883366004611fa7565b610e43565b61046a7f366637666234616263656462343835616232376562376262333963616638323781565b61046a6108bd366004611f85565b610e4e565b61046a600681565b61046a6108d8366004611f85565b610e5a565b6105166108eb366004612044565b610e66565b61046a600481565b61046a600581565b61048361090e366004611fa7565b610f22565b61046a7f0000000000000000000000000000000000000000000000008ac7230489e8000081565b61078c610948366004611fa7565b610f2d565b610516610f48565b61046a60085481565b61046a603c81565b6107af610974366004611fa7565b610f55565b61046a610987366004611f85565b610f7b565b61046a600181565b61046a6109a2366004611fa7565b610f87565b61046a6109b5366004611f85565b610f92565b60006109c68383611074565b9392505050565b60006109c6838361109b565b60006109e4826110c0565b92915050565b60006109f78484846110f4565b949350505050565b60006109f784848461114a565b60006109f7848484611287565b610a2281600055565b610a2a610f48565b50565b60006109e4826112a2565b600a546000908190610a5c906001600160801b03600160801b82048116911661209b565b600a54600f91820b9250600160801b90046001600160801b0316900b610a84612710836120eb565b610a8e9190612186565b91505090565b60006109c683836112d6565b6000610ab08787878787876112f2565b979650505050505050565b60006109e482611332565b60006109c68383611350565b60006109c683836113d6565b60008281526007602052604090205482906001600160a01b03163314610b5c5760405162461bcd60e51b815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604482015267081c995c5d595cdd60c21b60648201526084015b60405180910390fd5b60008181526007602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2610ba8826114a8565b505050565b60006109e482611597565b60006109c683836115ac565b60006109c683836115e0565b60006109c68383611661565b6000610ab0878787878787611688565b9695505050505050565b60006109c683836116d9565b60006109e4826116f2565b60008054610c1b5750600090565b60015460008054610c2c90426121b4565b9050818111610c3b5780610c3d565b815b9250505090565b60006109c68383611706565b610a2a816114a8565b60006109c68383611715565b60006109c6838361179c565b60006109e4826117a9565b60006109c683836117b6565b6000806000610c96846117c2565b9250925092509193909250565b600080600080600080610cb542611936565b949b939a50919850965094509092509050565b60006109e4826119a5565b600080610d087f3666376662346162636564623438356162323765623762623339636166383237306321abc2af60e11b6119c4565b9050610a8e7f000000000000000000000000049bd8c3adc3fe7d3fc2a44541d955a537c2a484827f0000000000000000000000000000000000000000000000008ac7230489e800006119e0565b60006109c68383611a69565b600080610d6f600954610f9e565b90506000610d95610d9060005442610d8791906121b4565b6224ea0061100c565b610f9e565b9050600061271060085484610daa91906120eb565b610db49190612186565b90506000610dc46224ea00610f9e565b610dce84846120eb565b610dd89190612186565b9050610dec610de782866121cb565b611022565b94505050505090565b60006109e482611a76565b6000610e0a610c0d565b600154610e1791906121b4565b905090565b60006109c68383611a94565b6000610e32610e00565b15919050565b60006109e482611b68565b60006109e482611ba4565b60006109c68383611bc9565b60006109c68383611bd8565b600b546001600160a01b03163314610ea95760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b6044820152606401610b53565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610ef8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1c919061220c565b50505050565b60006109e482611bf5565b6000806000610f3b84611c0a565b9196909550909350915050565b610f53600854611c1e565b565b600080600080600080610f6787611936565b949c939b5091995097509550909350915050565b60006109c68383611c77565b60006109e482611c83565b60006109c68383611c9f565b60006001600160ff1b038211156110085760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610b53565b5090565b600081831061101b57816109c6565b5090919050565b6000808212156110085760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f7369746976656044820152606401610b53565b6000611082610e108361222e565b61108c90846121b4565b9050828111156109e457600080fd5b6000818311156110aa57600080fd5b603c6110b684846121b4565b6109c6919061224d565b60008080806110da6110d5620151808761224d565b6117c2565b919450925090506110eb8383611350565b95945050505050565b60006107b284101580156111085750600083115b80156111155750600c8311155b156109c65760006111268585611350565b90506000831180156111385750808311155b1561114257600191505b509392505050565b60006107b284101561115b57600080fd5b838383600062253d8c60046064600c611175600e88612261565b61117f9190612186565b61118b886113246121cb565b61119591906121cb565b61119f9190612186565b6111aa9060036120eb565b6111b49190612186565b600c806111c2600e88612261565b6111cc9190612186565b6111d790600c6120eb565b6111e2600288612261565b6111ec9190612261565b6111f89061016f6120eb565b6112029190612186565b6004600c611211600e89612261565b61121b9190612186565b611227896112c06121cb565b61123191906121cb565b61123d906105b56120eb565b6112479190612186565b611253617d4b87612261565b61125d91906121cb565b61126791906121cb565b6112719190612261565b61127b9190612261565b98975050505050505050565b60006201518061129885858561114a565b6109f7919061222e565b6000806112b2620151808461224d565b905060076112c18260036122a0565b6112cb91906122b8565b6109c69060016122a0565b6000818311156112e557600080fd5b610e106110b684846121b4565b60006112ff8787876110f4565b15610bec576018841080156113145750603c83105b80156113205750603c82105b15610bec575060019695505050505050565b60008061134262015180846122b8565b90506109c6610e108261224d565b600081600114806113615750816003145b8061136c5750816005145b806113775750816007145b806113825750816008145b8061138d575081600a145b80611398575081600c145b156113a55750601f6109e4565b816002146113b55750601e6109e4565b6113be83611b68565b6113c957601c6113cc565b601d5b60ff169392505050565b60008080806113eb6110d5620151808861224d565b919450925090506113fc85836122a0565b9150600c61140b6001846121b4565b611415919061224d565b61141f90846122a0565b9250600c61142e6001846121b4565b61143891906122b8565b6114439060016122a0565b915060006114518484611350565b90508082111561145f578091505b61146c62015180886122b8565b6201518061147b86868661114a565b611485919061222e565b61148f91906122a0565b94508685101561149e57600080fd5b5050505092915050565b600a546114d4906114c1906001600160801b0316610f9e565b6114ca83610f9e565b6107d09190611ced565b6115505760405162461bcd60e51b815260206004820152604160248201527f5363616c696e6750726963654f7261636c653a20436861696e6c696e6b20646160448201527f7461206f757473696465206f6620646576696174696f6e207468726573686f6c6064820152601960fa1b608482015260a401610b53565b600a80546fffffffffffffffffffffffffffffffff196001600160801b03918216600160801b02169083161790556000611588610a38565b905061159381611c1e565b5050565b600060066115a4836112a2565b101592915050565b60008080806115c16110d5620151808861224d565b919450925090506115d285846122a0565b925060006114518484611350565b60008080806115f56110d5620151808861224d565b9194509250905061160685846121b4565b925060006116148484611350565b905080821115611622578091505b61162f62015180886122b8565b6201518061163e86868661114a565b611648919061222e565b61165291906122a0565b94508685111561149e57600080fd5b600061166f610e108361222e565b61167990846122a0565b9050828110156109e457600080fd5b600081611696603c8561222e565b6116a2610e108761222e565b620151806116b18b8b8b61114a565b6116bb919061222e565b6116c591906122a0565b6116cf91906122a0565b610ab091906122a0565b6000818311156116e857600080fd5b6109c683836121b4565b60008080610bec6110d5620151808661224d565b600061166f620151808361222e565b60008183111561172457600080fd5b6000808080808061173b6110d5620151808b61224d565b919750955093506117526110d5620151808a61224d565b919450925090508461176587600c61222e565b8361177186600c61222e565b61177b91906122a0565b61178591906121b4565b61178f91906121b4565b9998505050505050505050565b600061166f603c8361222e565b60006109e4603c836122b8565b600061167982846122a0565b60008080838162253d8c6117d98362010bd96121cb565b6117e391906121cb565b9050600062023ab16117f68360046120eb565b6118009190612186565b905060046118118262023ab16120eb565b61181c9060036121cb565b6118269190612186565b6118309083612261565b9150600062164b096118438460016121cb565b61184f90610fa06120eb565b6118599190612186565b90506004611869826105b56120eb565b6118739190612186565b61187d9084612261565b61188890601f6121cb565b9250600061098f61189a8560506120eb565b6118a49190612186565b9050600060506118b68361098f6120eb565b6118c09190612186565b6118ca9086612261565b90506118d7600b83612186565b94506118e485600c6120eb565b6118ef8360026121cb565b6118f99190612261565b91508483611908603187612261565b6119139060646120eb565b61191d91906121cb565b61192791906121cb565b9a919950975095505050505050565b6000808080808061194d6110d5620151808961224d565b91975095509350600061196362015180896122b8565b9050611971610e108261224d565b935061197f610e10826122b8565b905061198c603c8261224d565b9250611999603c826122b8565b91505091939550919395565b600080806119b96110d5620151808661224d565b509095945050505050565b6119cc611f4a565b6119d4611f4a565b6110eb81868686611d04565b6006546000906119f18160016122a0565b600655835160408086015160808701515191516000936320214ca360e11b93611a299386938493923092918a91600191602401612319565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050610bec86838684611d41565b6000611082603c8361222e565b60008080611a8a6110d5620151808661224d565b5095945050505050565b6000808080611aa96110d5620151808861224d565b91945092509050600085611abe6001856121b4565b611ac986600c61222e565b611ad391906122a0565b611add91906121b4565b9050611aea600c8261224d565b9350611af7600c826122b8565b611b029060016122a0565b92506000611b108585611350565b905080831115611b1e578092505b611b2b62015180896122b8565b62015180611b3a87878761114a565b611b44919061222e565b611b4e91906122a0565b955087861115611b5d57600080fd5b505050505092915050565b6000611b756004836122b8565b158015611b8b5750611b886064836122b8565b15155b806109e45750611b9d610190836122b8565b1592915050565b6000808080611bb96110d5620151808761224d565b919450925090506110eb83611b68565b6000611082620151808361222e565b600081831115611be757600080fd5b620151806110b684846121b4565b60006005611c02836112a2565b111592915050565b60008080610f3b6110d5620151808661224d565b611c26610d61565b60095560085460408051828152602081018490527f6b0ebc7a6cc69b76f60d94653780dbb1e0747946420566eb5152055bc2307d96910160405180910390a180821415611c71575050565b50600855565b600061108c82846121b4565b600080611c92610e10846122b8565b90506109c6603c8261224d565b600081831115611cae57600080fd5b60008080808080611cc56110d5620151808b61224d565b91975095509350611cdc6110d5620151808a61224d565b9194509250905061178f86846121b4565b6000611cf98383611e9e565b909310159392505050565b611d0c611f4a565b611d1c8560800151610100611ee5565b50509183526001600160a01b031660208301526001600160e01b031916604082015290565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152600790925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a260048054604051630200057560e51b81526001600160a01b0390911691634000aea091611e039189918891889101612381565b6020604051808303816000875af1158015611e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e46919061220c565b6109f75760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b6064820152608401610b53565b600080611eab8385612261565b9050600084611ebc612710846120eb565b611ec69190612186565b90506110eb60008212611ed95781611022565b610de7826000196120eb565b604080518082019091526060815260006020820152611f056020836122b8565b15611f2d57611f156020836122b8565b611f209060206121b4565b611f2a90836122a0565b91505b506020828101829052604080518085526000815290920101905290565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b60008060408385031215611f9857600080fd5b50508035926020909101359150565b600060208284031215611fb957600080fd5b5035919050565b600080600060608486031215611fd557600080fd5b505081359360208301359350604090920135919050565b60008060008060008060c0878903121561200557600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b6001600160a01b0381168114610a2a57600080fd5b60008060006060848603121561205957600080fd5b83356120648161202f565b925060208401356120748161202f565b929592945050506040919091013590565b634e487b7160e01b600052601160045260246000fd5b600081600f0b83600f0b600081128160016001607f1b0319018312811516156120c6576120c6612085565b8160016001607f1b030183138116156120e1576120e1612085565b5090039392505050565b60006001600160ff1b038184138284138082168684048611161561211157612111612085565b600160ff1b600087128281168783058912161561213057612130612085565b6000871292508782058712848416161561214c5761214c612085565b8785058712818416161561216257612162612085565b505050929093029392505050565b634e487b7160e01b600052601260045260246000fd5b60008261219557612195612170565b600160ff1b8214600019841416156121af576121af612085565b500590565b6000828210156121c6576121c6612085565b500390565b600080821280156001600160ff1b03849003851316156121ed576121ed612085565b600160ff1b839003841281161561220657612206612085565b50500190565b60006020828403121561221e57600080fd5b815180151581146109c657600080fd5b600081600019048311821515161561224857612248612085565b500290565b60008261225c5761225c612170565b500490565b60008083128015600160ff1b85018412161561227f5761227f612085565b6001600160ff1b038401831381161561229a5761229a612085565b50500390565b600082198211156122b3576122b3612085565b500190565b6000826122c7576122c7612170565b500690565b6000815180845260005b818110156122f2576020818501810151868301820152016122d6565b81811115612304576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090612372838201856122cc565b9b9a5050505050505050505050565b60018060a01b03841681528260208201526060604082015260006110eb60608301846122cc56fea26469706673582212204498dc9b0963c756c54a7907f7525b15753280ae685cec686a4a162bc3f3967364736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000049bd8c3adc3fe7d3fc2a44541d955a537c2a48436663766623461626365646234383561623237656237626233396361663832370000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000000000000044a3c0000000000000000000000000000000000000000000000000000000000044112
-----Decoded View---------------
Arg [0] : _oracle (address): 0x049Bd8C3adC3fE7d3Fc2a44541d955A537c2A484
Arg [1] : _jobid (bytes32): 0x3666376662346162636564623438356162323765623762623339636166383237
Arg [2] : _fee (uint256): 10000000000000000000
Arg [3] : _currentMonth (uint128): 281148
Arg [4] : _previousMonth (uint128): 278802
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000049bd8c3adc3fe7d3fc2a44541d955a537c2a484
Arg [1] : 3666376662346162636564623438356162323765623762623339636166383237
Arg [2] : 0000000000000000000000000000000000000000000000008ac7230489e80000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000044a3c
Arg [4] : 0000000000000000000000000000000000000000000000000000000000044112
Deployed Bytecode Sourcemap
145503:1752:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;85731:217;;;;;;:::i;:::-;;:::i;:::-;;;413:25:1;;;401:2;386:18;85731:217:0;;;;;;;;34213:92;34259:4;34283:9;:14;;34213:92;;;614:14:1;;607:22;589:41;;577:2;562:18;34213:92:0;449:187:1;87576:270:0;;;;;;:::i;:::-;;:::i;32649:23::-;;;;;;81981:203;;;;;;:::i;:::-;;:::i;78010:35::-;;78044:1;78010:35;;80713:214;;;;;;:::i;:::-;;:::i;78776:220::-;;;;;;:::i;:::-;;:::i;79265:232::-;;;;;;:::i;:::-;;:::i;146234:144::-;;;;;;:::i;:::-;;:::i;:::-;;82417:195;;;;;;:::i;:::-;;:::i;141386:229::-;;;:::i;78220:35::-;;78254:1;78220:35;;87306:262;;;;;;:::i;:::-;;:::i;80935:406::-;;;;;;:::i;:::-;;:::i;146132:94::-;;;;;;:::i;:::-;146194:9;:24;146132:94;83073:143;;;;;;:::i;:::-;;:::i;82192:217::-;;;;;;:::i;:::-;;:::i;83767:258::-;;;;;;:::i;:::-;;:::i;142855:169::-;;;;;;:::i;:::-;;:::i;81823:150::-;;;;;;:::i;:::-;;:::i;83542:217::-;;;;;;:::i;:::-;;:::i;85019:::-;;;;;;:::i;:::-;;:::i;138933:59::-;;138987:5;138933:59;;138404:28;;;;;-1:-1:-1;;;138404:28:0;;-1:-1:-1;;;;;138404:28:0;;;;;;-1:-1:-1;;;;;2272:47:1;;;2254:66;;2242:2;2227:18;138404:28:0;2108:218:1;84254:217:0;;;;;;:::i;:::-;;:::i;77801:50::-;;77844:7;77801:50;;79505:465;;;;;;:::i;:::-;;:::i;87854:270::-;;;;;;:::i;:::-;;:::i;82926:139::-;;;;;;:::i;:::-;;:::i;138111:42::-;;;;;;33855:350;;;:::i;84033:213::-;;;;;;:::i;:::-;;:::i;77740:54::-;;77782:12;77740:54;;145922:87;;;;;;:::i;:::-;;:::i;32566:24::-;;;;;;86766:266;;;;;;:::i;:::-;;:::i;139062:31::-;;;;;;;;-1:-1:-1;;;;;2495:32:1;;;2477:51;;2465:2;2450:18;139062:31:0;2331:203:1;138321:27:0;;;;;-1:-1:-1;;;;;138321:27:0;;;84479:262;;;;;;:::i;:::-;;:::i;83383:151::-;;;;;;:::i;:::-;;:::i;78052:35::-;;78086:1;78052:35;;84749:262;;;;;;:::i;:::-;;:::i;79004:253::-;;;;;;:::i;:::-;;:::i;:::-;;;;2741:25:1;;;2797:2;2782:18;;2775:34;;;;2825:18;;;2818:34;2729:2;2714:18;79004:253:0;2539:319:1;78374:394:0;;;:::i;:::-;;;;3150:25:1;;;3206:2;3191:18;;3184:34;;;;3234:18;;;3227:34;;;;3292:2;3277:18;;3270:34;3335:3;3320:19;;3313:35;3379:3;3364:19;;3357:35;3137:3;3122:19;78374:394:0;2863:535:1;82620:143:0;;;;;;:::i;:::-;;:::i;146900:352::-;;;:::i;85956:262::-;;;;;;:::i;:::-;;:::i;140704:482::-;;;:::i;82771:147::-;;;;;;:::i;:::-;;:::i;77912:47::-;;77952:7;77912:47;;138643:52;;138688:7;138643:52;;33538:163;;;:::i;85244:258::-;;;;;;:::i;:::-;;:::i;33345:96::-;;;:::i;81511:146::-;;;;;;:::i;:::-;;:::i;78264:102::-;78343:15;78264:102;;81349:154;;;;;;:::i;:::-;;:::i;139161:30::-;;;;;85510:213;;;;;;:::i;:::-;;:::i;78178:35::-;;78212:1;78178:35;;87040:258;;;;;;:::i;:::-;;:::i;146386:169::-;;;;;;:::i;:::-;;:::i;78094:35::-;;78128:1;78094:35;;78136;;78170:1;78136:35;;81665:150;;;;;;:::i;:::-;;:::i;139271:28::-;;;;;79978:307;;;;;;:::i;:::-;;:::i;146017:107::-;;;:::i;137979:51::-;;;;;;77858:47;;77903:2;77858:47;;80293:412;;;;;;:::i;:::-;;:::i;86226:262::-;;;;;;:::i;:::-;;:::i;77968:35::-;;78002:1;77968:35;;83224:151;;;;;;:::i;:::-;;:::i;86496:262::-;;;;;;:::i;:::-;;:::i;85731:217::-;85832:20;85885:55;85922:9;85933:6;85885:36;:55::i;:::-;85870:70;85731:217;-1:-1:-1;;;85731:217:0:o;87576:270::-;87689:16;87734:104;87788:13;87816:11;87734:39;:104::i;81981:203::-;82072:19;82123:53;82166:9;82123:42;:53::i;:::-;82109:67;81981:203;-1:-1:-1;;81981:203:0:o;80713:214::-;80831:10;80862:57;80902:4;80908:5;80915:3;80862:39;:57::i;:::-;80854:65;80713:214;-1:-1:-1;;;;80713:214:0:o;78776:220::-;78896:13;78929:59;78971:4;78977:5;78984:3;78929:41;:59::i;79265:232::-;79389:17;79426:63;79472:4;79478:5;79485:3;79426:45;:63::i;146234:144::-;146315:26;146328:12;146194:9;:24;146132:94;146315:26;146352:18;:16;:18::i;:::-;146234:144;:::o;82417:195::-;82506:17;82553:51;82594:9;82553:40;:51::i;141386:229::-;141513:13;;141432:23;;;;141483:44;;-1:-1:-1;;;;;;;;141513:13:0;;;;;141490:12;141483:44;:::i;:::-;141593:13;;141468:59;;;;;-1:-1:-1;;;;141593:13:0;;-1:-1:-1;;;;;141593:13:0;141557:50;;141558:24;47845:6;141468:59;141558:24;:::i;:::-;141557:50;;;;:::i;:::-;141538:69;;141457:158;141386:229;:::o;87306:262::-;87417:14;87458:102;87510:13;87538:11;87458:37;:102::i;80935:406::-;81130:10;81161:172;81219:4;81238:5;81258:3;81276:4;81295:6;81316;81161:43;:172::i;:::-;81153:180;80935:406;-1:-1:-1;;;;;;;80935:406:0:o;83073:143::-;83130:12;83162:46;83198:9;83162:35;:46::i;82192:217::-;82294:19;82345:56;82389:4;82395:5;82345:43;:56::i;83767:258::-;83870:20;83923:94;83975:9;83999:7;83923:37;:94::i;142855:169::-;136745:28;;;;:17;:28;;;;;;;;-1:-1:-1;;;;;136745:28:0;136731:10;:42;136723:95;;;;-1:-1:-1;;;136723:95:0;;5845:2:1;136723:95:0;;;5827:21:1;5884:2;5864:18;;;5857:30;5923:34;5903:18;;;5896:62;-1:-1:-1;;;5974:18:1;;;5967:38;6022:19;;136723:95:0;;;;;;;;;136832:28;;;;:17;:28;;;;;;136825:35;;-1:-1:-1;;;;;;136825:35:0;;;136872:29;136850:9;;136872:29;;;142992:24:::1;143007:8;142992:14;:24::i;:::-;142855:169:::0;;;:::o;81823:150::-;81882:12;81917:48;81955:9;81917:37;:48::i;83542:217::-;83643:20;83696:55;83733:9;83744:6;83696:36;:55::i;85019:217::-;85120:20;85173:55;85210:9;85221:6;85173:36;:55::i;84254:217::-;84355:20;84408:55;84445:9;84456:6;84408:36;:55::i;79505:465::-;79706:17;79756:206;79824:4;79847:5;79871:3;79893:4;79916:6;79941;79756:49;:206::i;79505:465::-;;;;;;;;;:::o;87854:270::-;87967:16;88012:104;88066:13;88094:11;88012:39;:104::i;82926:139::-;82982:11;83012:45;83047:9;83012:34;:45::i;33855:350::-;33902:7;34283:9;;33922:74;;-1:-1:-1;33966:1:0;;33855:350::o;33922:74::-;34026:8;;34006:17;34084:9;;34066:27;;:15;:27;:::i;:::-;34045:48;;34163:9;34150:10;:22;:47;;34187:10;34150:47;;;34175:9;34150:47;34143:54;;;;33855:350;:::o;84033:213::-;84132:20;84185:53;84221:9;84232:5;84185:35;:53::i;145922:87::-;145977:24;145992:8;145977:14;:24::i;86766:266::-;86878:15;86921:103;86974:13;87002:11;86921:38;:103::i;84479:262::-;84584:20;84637:96;84690:9;84714:8;84637:38;:96::i;83383:151::-;83442:14;83478:48;83516:9;83478:37;:48::i;84749:262::-;84854:20;84907:96;84960:9;84984:8;84907:38;:96::i;79004:253::-;79102:12;79129:13;79157:11;79203:46;79243:5;79203:39;:46::i;:::-;79196:53;;;;;;79004:253;;;;;:::o;78374:394::-;78460:12;78487:13;78515:11;78541:12;78568:14;78597;78682:78;78744:15;78682:61;:78::i;:::-;78639:121;;;;-1:-1:-1;78639:121:0;;-1:-1:-1;78639:121:0;-1:-1:-1;78639:121:0;-1:-1:-1;78639:121:0;;-1:-1:-1;78374:394:0;-1:-1:-1;78374:394:0:o;82620:143::-;82677:12;82709:46;82745:9;82709:35;:46::i;146900:352::-;146980:17;;147050:130;147086:5;147114:4;-1:-1:-1;;;147050:21:0;:130::i;:::-;147015:165;;147200:44;147223:6;147231:7;147240:3;147200:22;:44::i;85956:262::-;86061:20;86114:96;86167:9;86191:8;86114:38;:96::i;140704:482::-;140767:7;140787:21;140811:22;:11;;:20;:22::i;:::-;140787:46;;140846:16;140865:59;:48;140892:9;;140874:15;:27;;;;:::i;:::-;138688:7;140865:8;:48::i;:::-;:57;:59::i;:::-;140846:78;;140935:28;47845:6;140983:28;;140966:14;:45;;;;:::i;:::-;:64;;;;:::i;:::-;140935:95;;141041:17;141097:20;138688:7;141097:18;:20::i;:::-;141061:33;141085:9;141061:21;:33;:::i;:::-;:56;;;;:::i;:::-;141041:76;-1:-1:-1;141137:41:0;141138:27;141041:76;141138:14;:27;:::i;:::-;141137:39;:41::i;:::-;141130:48;;;;;;140704:482;:::o;82771:147::-;82829:13;82863:47;82900:9;82863:36;:47::i;33538:163::-;33584:7;33622:16;:14;:16::i;:::-;33611:8;;:27;;;;:::i;:::-;33604:34;;33538:163;:::o;85244:258::-;85347:20;85400:94;85452:9;85476:7;85400:37;:94::i;33345:96::-;33389:4;33413:15;:13;:15::i;:::-;:20;;33345:96;-1:-1:-1;33345:96:0:o;81511:146::-;81567:13;81604:45;81644:4;81604:39;:45::i;81349:154::-;81409:13;81446:49;81485:9;81446:38;:49::i;85510:213::-;85609:20;85662:53;85698:9;85709:5;85662:35;:53::i;87040:258::-;87150:13;87189:101;87240:13;87268:11;87189:36;:101::i;146386:169::-;146492:5;;-1:-1:-1;;;;;146492:5:0;146478:10;:19;146470:38;;;;-1:-1:-1;;;146470:38:0;;6654:2:1;146470:38:0;;;6636:21:1;6693:1;6673:18;;;6666:29;-1:-1:-1;;;6711:18:1;;;6704:36;6757:18;;146470:38:0;6452:329:1;146470:38:0;146521:26;;-1:-1:-1;;;146521:26:0;;-1:-1:-1;;;;;6978:32:1;;;146521:26:0;;;6960:51:1;7027:18;;;7020:34;;;146521:14:0;;;;;6933:18:1;;146521:26:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;146386:169;;;:::o;81665:150::-;81724:12;81759:48;81797:9;81759:37;:48::i;79978:307::-;80084:12;80111:13;80139:11;80199:78;80257:9;80199:43;:78::i;:::-;80178:99;;;;-1:-1:-1;80178:99:0;;-1:-1:-1;79978:307:0;-1:-1:-1;;79978:307:0:o;146017:107::-;146063:53;146087:28;;146063:23;:53::i;:::-;146017:107::o;80293:412::-;80403:12;80430:13;80458:11;80484:12;80511:14;80540;80625:72;80687:9;80625:61;:72::i;:::-;80582:115;;;;-1:-1:-1;80582:115:0;;-1:-1:-1;80582:115:0;-1:-1:-1;80582:115:0;-1:-1:-1;80582:115:0;;-1:-1:-1;80293:412:0;-1:-1:-1;;80293:412:0:o;86226:262::-;86331:20;86384:96;86437:9;86461:8;86384:38;:96::i;83224:151::-;83283:14;83319:48;83357:9;83319:37;:48::i;86496:262::-;86607:14;86648:102;86700:13;86728:11;86648:37;:102::i;56388:301::-;56444:6;-1:-1:-1;;;;;56571:5:0;:34;;56563:87;;;;-1:-1:-1;;;56563:87:0;;7549:2:1;56563:87:0;;;7531:21:1;7588:2;7568:18;;;7561:30;7627:34;7607:18;;;7600:62;-1:-1:-1;;;7678:18:1;;;7671:38;7726:19;;56563:87:0;7347:404:1;56563:87:0;-1:-1:-1;56675:5:0;56388:301::o;88636:106::-;88694:7;88725:1;88721;:5;:13;;88733:1;88721:13;;;-1:-1:-1;88729:1:0;;88636:106;-1:-1:-1;88636:106:0:o;53111:171::-;53167:7;53204:1;53195:5;:10;;53187:55;;;;-1:-1:-1;;;53187:55:0;;7958:2:1;53187:55:0;;;7940:21:1;;;7977:18;;;7970:30;8036:34;8016:18;;;8009:62;8088:18;;53187:55:0;7756:356:1;73536:246:0;73639:20;73704:25;60872:7;73704:6;:25;:::i;:::-;73692:37;;:9;:37;:::i;:::-;73677:52;;73764:9;73748:12;:25;;73740:34;;;;;76022:266;76137:16;76196:11;76179:13;:28;;76171:37;;;;;;60924:2;76231:27;76245:13;76231:11;:27;:::i;:::-;76230:50;;;;:::i;67189:321::-;67282:19;;;;67409:40;67421:27;60817:12;67421:9;:27;:::i;:::-;67409:11;:40::i;:::-;67388:61;;-1:-1:-1;67388:61:0;-1:-1:-1;67388:61:0;-1:-1:-1;67474:28:0;67388:61;;67474:15;:28::i;:::-;67460:42;67189:321;-1:-1:-1;;;;;67189:321:0:o;65657:369::-;65777:10;65812:4;65804;:12;;:25;;;;;65828:1;65820:5;:9;65804:25;:40;;;;;65842:2;65833:5;:11;;65804:40;65800:219;;;65861:19;65883:28;65899:4;65905:5;65883:15;:28::i;:::-;65861:50;;65936:1;65930:3;:7;:29;;;;;65948:11;65941:3;:18;;65930:29;65926:82;;;65988:4;65980:12;;65926:82;65846:173;65657:369;;;;;:::o;61898:652::-;62020:13;62062:4;62054;:12;;62046:21;;;;;;62100:4;62139:5;62177:3;62078:12;60966:7;62475:1;62454:3;62448:2;62433:11;62442:2;62139:5;62433:11;:::i;:::-;62432:18;;;;:::i;:::-;62417:12;:5;62425:4;62417:12;:::i;:::-;:33;;;;:::i;:::-;62416:41;;;;:::i;:::-;62411:47;;:1;:47;:::i;:::-;62410:66;;;;:::i;:::-;62392:2;;62351:11;62360:2;62351:6;:11;:::i;:::-;62350:18;;;;:::i;:::-;62349:25;;62372:2;62349:25;:::i;:::-;62336:10;62345:1;62336:6;:10;:::i;:::-;:38;;;;:::i;:::-;62329:46;;:3;:46;:::i;:::-;62328:66;;;;:::i;:::-;62311:1;62291:2;62276:11;62285:2;62276:6;:11;:::i;:::-;62275:18;;;;:::i;:::-;62260:12;:5;62268:4;62260:12;:::i;:::-;:33;;;;:::i;:::-;62252:42;;:4;:42;:::i;:::-;62251:61;;;;:::i;:::-;62210:25;62230:5;62210:4;:25;:::i;:::-;:102;;;;:::i;:::-;:184;;;;:::i;:::-;:266;;;;:::i;:::-;:296;;;;:::i;:::-;62194:312;61898:652;-1:-1:-1;;;;;;;;61898:652:0:o;64086:225::-;64212:17;60817:12;64254:31;64268:4;64274:5;64281:3;64254:13;:31::i;:::-;:49;;;;:::i;68091:221::-;68182:17;;68233:27;60817:12;68233:9;:27;:::i;:::-;68217:43;-1:-1:-1;68298:1:0;68285:9;68217:43;68293:1;68285:9;:::i;:::-;68284:15;;;;:::i;:::-;68283:21;;68303:1;68283:21;:::i;75756:258::-;75869:14;75926:11;75909:13;:28;;75901:37;;;;;;60872:7;75959:27;75973:13;75959:11;:27;:::i;66034:380::-;66231:10;66258:29;66270:4;66276:5;66283:3;66258:11;:29::i;:::-;66254:153;;;66315:2;66308:4;:9;:24;;;;;66330:2;66321:6;:11;66308:24;:39;;;;;66345:2;66336:6;:11;66308:39;66304:92;;;-1:-1:-1;66376:4:0;66034:380;;;;;;;;:::o;68941:175::-;69000:12;;69040:27;60817:12;69040:9;:27;:::i;:::-;69025:42;-1:-1:-1;69085:23:0;60872:7;69025:42;69085:23;:::i;67518:534::-;67622:19;67677:5;67686:1;67677:10;:37;;;;67704:5;67713:1;67704:10;67677:37;:64;;;;67731:5;67740:1;67731:10;67677:64;:91;;;;67758:5;67767:1;67758:10;67677:91;:118;;;;67785:5;67794:1;67785:10;67677:118;:146;;;;67812:5;67821:2;67812:11;67677:146;:174;;;;67840:5;67849:2;67840:11;67677:174;67659:386;;;-1:-1:-1;67892:2:0;67659:386;;;67916:5;67925:1;67916:10;67912:133;;-1:-1:-1;67957:2:0;67912:133;;;68006:17;68018:4;68006:11;:17::i;:::-;:27;;68031:2;68006:27;;;68026:2;68006:27;67992:41;;;67518:534;-1:-1:-1;;;67518:534:0:o;70164:713::-;70269:20;;;;70397:40;70409:27;60817:12;70409:9;:27;:::i;70397:40::-;70376:61;;-1:-1:-1;70376:61:0;-1:-1:-1;70376:61:0;-1:-1:-1;70448:16:0;70457:7;70376:61;70448:16;:::i;:::-;;-1:-1:-1;70497:2:0;70484:9;70492:1;70448:16;70484:9;:::i;:::-;70483:16;;;;:::i;:::-;70475:24;;;;:::i;:::-;;-1:-1:-1;70533:2:0;70520:9;70528:1;70520:5;:9;:::i;:::-;70519:16;;;;:::i;:::-;70518:22;;70539:1;70518:22;:::i;:::-;70510:30;;70551:19;70573:28;70589:4;70595:5;70573:15;:28::i;:::-;70551:50;;70622:11;70616:3;:17;70612:67;;;70656:11;70650:17;;70612:67;70796:27;60817:12;70796:9;:27;:::i;:::-;60817:12;70717:31;70731:4;70737:5;70744:3;70717:13;:31::i;:::-;:62;;;;:::i;:::-;:107;;;;:::i;:::-;70689:135;;70859:9;70843:12;:25;;70835:34;;;;;;70296:581;;;;70164:713;;;;:::o;143300:627::-;143448:12;;143384:140;;143448:23;;-1:-1:-1;;;;;143448:12:0;:21;:23::i;:::-;143490:19;:8;:17;:19::i;:::-;138987:5;;143384:140;:45;:140::i;:::-;143362:255;;;;-1:-1:-1;;;143362:255:0;;9139:2:1;143362:255:0;;;9121:21:1;9178:2;9158:18;;;9151:30;9217:34;9197:18;;;9190:62;9288:34;9268:18;;;9261:62;-1:-1:-1;;;9339:19:1;;;9332:32;9381:19;;143362:255:0;8937:469:1;143362:255:0;145246:12;;;-1:-1:-1;;;;;;;145246:12:0;;;-1:-1:-1;;;145230:28:0;145271:23;;;;;;;143784:21;143808:15;:13;:15::i;:::-;143784:39;;143880;143904:14;143880:23;:39::i;:::-;143351:576;143300:627;:::o;67043:138::-;67104:12;61184:1;67139:23;67152:9;67139:12;:23::i;:::-;:34;;;67043:138;-1:-1:-1;;67043:138:0:o;69523:633::-;69626:20;;;;69754:40;69766:27;60817:12;69766:9;:27;:::i;69754:40::-;69733:61;;-1:-1:-1;69733:61:0;-1:-1:-1;69733:61:0;-1:-1:-1;69805:14:0;69813:6;69733:61;69805:14;:::i;:::-;;;69830:19;69852:28;69868:4;69874:5;69852:15;:28::i;71892:633::-;71995:20;;;;72123:40;72135:27;60817:12;72135:9;:27;:::i;72123:40::-;72102:61;;-1:-1:-1;72102:61:0;-1:-1:-1;72102:61:0;-1:-1:-1;72174:14:0;72182:6;72102:61;72174:14;:::i;:::-;;;72199:19;72221:28;72237:4;72243:5;72221:15;:28::i;:::-;72199:50;;72270:11;72264:3;:17;72260:67;;;72304:11;72298:17;;72260:67;72444:27;60817:12;72444:9;:27;:::i;:::-;60817:12;72365:31;72379:4;72385:5;72392:3;72365:13;:31::i;:::-;:62;;;;:::i;:::-;:107;;;;:::i;:::-;72337:135;;72507:9;72491:12;:25;;72483:34;;;;;71135:246;71238:20;71303:25;60872:7;71303:6;:25;:::i;:::-;71291:37;;:9;:37;:::i;:::-;71276:52;;71363:9;71347:12;:25;;71339:34;;;;;64319:458;64522:17;64763:6;64707:40;60924:2;64707:6;:40;:::i;:::-;64655:36;60872:7;64655:4;:36;:::i;:::-;60817:12;64577:31;64591:4;64597:5;64604:3;64577:13;:31::i;:::-;:62;;;;:::i;:::-;:114;;;;:::i;:::-;:170;;;;:::i;:::-;:192;;;;:::i;76296:243::-;76411:16;76470:11;76453:13;:28;;76445:37;;;;;;76504:27;76518:13;76504:11;:27;:::i;68735:198::-;68793:11;;;68885:40;68897:27;60817:12;68897:9;:27;:::i;70885:242::-;70986:20;71051:23;60817:12;71051:5;:23;:::i;74876:610::-;74990:15;75048:11;75031:13;:28;;75023:37;;;;;;75071:16;;;;;;75260:68;75286:31;60817:12;75286:13;:31;:::i;75260:68::-;75227:101;;-1:-1:-1;75227:101:0;-1:-1:-1;75227:101:0;-1:-1:-1;75366:42:0;75378:29;60817:12;75378:11;:29;:::i;75366:42::-;75339:69;;-1:-1:-1;75339:69:0;-1:-1:-1;75339:69:0;-1:-1:-1;75469:9:0;75453:13;:8;75464:2;75453:13;:::i;:::-;75443:7;75429:11;:6;75438:2;75429:11;:::i;:::-;:21;;;;:::i;:::-;:37;;;;:::i;:::-;:49;;;;:::i;:::-;75419:59;74876:610;-1:-1:-1;;;;;;;;;74876:610:0:o;71389:254::-;71496:20;71561:29;60924:2;71561:8;:29;:::i;69348:167::-;69436:14;69477:30;60924:2;69477:9;:30;:::i;71651:233::-;71758:20;71811;71823:8;71811:9;:20;:::i;63322:756::-;63422:12;;;63539:5;63422:12;60966:7;63569:14;63539:5;63578;63569:14;:::i;:::-;:31;;;;:::i;:::-;63558:42;-1:-1:-1;63611:8:0;63632:6;63623:5;63558:42;63623:1;:5;:::i;:::-;63622:16;;;;:::i;:::-;63611:27;-1:-1:-1;63676:1:0;63658:10;63611:27;63658:6;:10;:::i;:::-;:14;;63671:1;63658:14;:::i;:::-;63657:20;;;;:::i;:::-;63653:24;;:1;:24;:::i;:::-;63649:28;-1:-1:-1;63688:12:0;63722:7;63712:5;63649:28;63716:1;63712:5;:::i;:::-;63704:14;;:4;:14;:::i;:::-;63703:26;;;;:::i;:::-;63688:41;-1:-1:-1;63765:1:0;63749:12;63688:41;63749:4;:12;:::i;:::-;63748:18;;;;:::i;:::-;63744:22;;:1;:22;:::i;:::-;:27;;63769:2;63744:27;:::i;:::-;63740:31;-1:-1:-1;63782:13:0;63809:4;63799:6;63740:31;63799:2;:6;:::i;:::-;63798:15;;;;:::i;:::-;63782:31;-1:-1:-1;63824:11:0;63860:2;63843:13;63782:31;63843:4;:13;:::i;:::-;63842:20;;;;:::i;:::-;63838:24;;:1;:24;:::i;:::-;63824:38;-1:-1:-1;63877:11:0;63886:2;63877:6;:11;:::i;:::-;63873:15;-1:-1:-1;63921:6:0;63873:15;63921:2;:6;:::i;:::-;63908:10;:6;63917:1;63908:10;:::i;:::-;:19;;;;:::i;:::-;63899:28;-1:-1:-1;63971:1:0;63963:5;63953:6;63957:2;63953:1;:6;:::i;:::-;63946:14;;:3;:14;:::i;:::-;:22;;;;:::i;:::-;:26;;;;:::i;:::-;63938:34;64033:6;;-1:-1:-1;64065:4:0;-1:-1:-1;63322:756:0;-1:-1:-1;;;;;;63322:756:0:o;65064:585::-;65176:12;;;;;;65376:40;65388:27;60817:12;65388:9;:27;:::i;65376:40::-;65355:61;;-1:-1:-1;65355:61:0;-1:-1:-1;65355:61:0;-1:-1:-1;65427:12:0;65442:27;60817:12;65442:9;:27;:::i;:::-;65427:42;-1:-1:-1;65487:23:0;60872:7;65427:42;65487:23;:::i;:::-;65480:30;-1:-1:-1;65528:23:0;60872:7;65528:4;:23;:::i;:::-;65521:30;-1:-1:-1;65571:25:0;60924:2;65521:30;65571:25;:::i;:::-;65562:34;-1:-1:-1;65616:25:0;60924:2;65616:4;:25;:::i;:::-;65607:34;;65344:305;65064:585;;;;;;;:::o;68320:199::-;68379:12;;;68471:40;68483:27;60817:12;68483:9;:27;:::i;68471:40::-;-1:-1:-1;68450:61:0;;68320:199;-1:-1:-1;;;;;68320:199:0:o;126718:290::-;126864:24;;:::i;:::-;126897:28;;:::i;:::-;126939:63;:3;126954:6;126962:12;126976:25;126939:14;:63::i;128600:775::-;128782:14;;128740:17;;128820:9;128782:14;128828:1;128820:9;:::i;:::-;128803:14;:26;129169:6;;129206:22;;;;;129279:7;;;;:11;128866:431;;128836:27;;-1:-1:-1;;;128897:48:0;128866:431;;128836:27;;;;129169:6;129192:4;;129206:22;129237:5;;125681:1;;128866:431;;;:::i;:::-;;;;-1:-1:-1;;128866:431:0;;;;;;;;;;;;;;-1:-1:-1;;;;;128866:431:0;-1:-1:-1;;;;;;128866:431:0;;;;;;;;;;;-1:-1:-1;129311:58:0;129323:13;129338:5;129345:7;128866:431;129311:11;:58::i;73790:254::-;73897:20;73962:29;60924:2;73962:8;:29;:::i;68527:200::-;68587:13;;;68679:40;68691:27;60817:12;68691:9;:27;:::i;68679:40::-;-1:-1:-1;68658:61:0;68527:200;-1:-1:-1;;;;;68527:200:0:o;72533:745::-;72638:20;;;;72766:40;72778:27;60817:12;72778:9;:27;:::i;72766:40::-;72745:61;;-1:-1:-1;72745:61:0;-1:-1:-1;72745:61:0;-1:-1:-1;72817:17:0;72863:7;72850:9;72858:1;72745:61;72850:9;:::i;:::-;72837;:4;72844:2;72837:9;:::i;:::-;:23;;;;:::i;:::-;:33;;;;:::i;:::-;72817:53;-1:-1:-1;72888:14:0;72900:2;72817:53;72888:14;:::i;:::-;72881:21;-1:-1:-1;72922:14:0;72934:2;72922:9;:14;:::i;:::-;72921:20;;72940:1;72921:20;:::i;:::-;72913:28;;72952:19;72974:28;72990:4;72996:5;72974:15;:28::i;:::-;72952:50;;73023:11;73017:3;:17;73013:67;;;73057:11;73051:17;;73013:67;73197:27;60817:12;73197:9;:27;:::i;:::-;60817:12;73118:31;73132:4;73138:5;73145:3;73118:13;:31::i;:::-;:62;;;;:::i;:::-;:107;;;;:::i;:::-;73090:135;;73260:9;73244:12;:25;;73236:34;;;;;;72665:613;;;;;72533:745;;;;:::o;66727:162::-;66785:13;66824:8;66831:1;66824:4;:8;:::i;:::-;:13;66823:36;;;;-1:-1:-1;66843:10:0;66850:3;66843:4;:10;:::i;:::-;:15;;66823:36;66822:59;;;-1:-1:-1;66865:10:0;66872:3;66865:4;:10;:::i;:::-;:15;66811:70;66727:162;-1:-1:-1;;66727:162:0:o;66422:297::-;66511:13;;;;66632:40;66644:27;60817:12;66644:9;:27;:::i;66632:40::-;66611:61;;-1:-1:-1;66611:61:0;-1:-1:-1;66611:61:0;-1:-1:-1;66694:17:0;66611:61;66694:11;:17::i;73286:242::-;73387:20;73452:23;60817:12;73452:5;:23;:::i;75494:254::-;75606:13;75662:11;75645:13;:28;;75637:37;;;;;;60817:12;75694:27;75708:13;75694:11;:27;:::i;66897:138::-;66958:12;61149:1;66993:23;67006:9;66993:12;:23::i;:::-;:34;;;66897:138;-1:-1:-1;;66897:138:0:o;64785:271::-;64893:12;;;65008:40;65020:27;60817:12;65020:9;:27;:::i;144286:725::-;144443:23;:21;:23::i;:::-;144429:11;:37;144517:28;;144629:119;;;10883:25:1;;;10939:2;10924:18;;10917:34;;;144629:119:0;;10856:18:1;144629:119:0;;;;;;;144873:28;144845:24;:56;144841:95;;;144918:7;144286:725;:::o;144841:95::-;-1:-1:-1;144948:28:0;:55;144286:725::o;74052:233::-;74159:20;74212;74224:8;74212:9;:20;:::i;69124:216::-;69212:14;;69259:28;60872:7;69259:9;:28;:::i;:::-;69244:43;-1:-1:-1;69307:25:0;60924:2;69244:43;69307:25;:::i;74293:575::-;74406:14;74463:11;74446:13;:28;;74438:37;;;;;;74486:16;;;;;;74675:68;74701:31;60817:12;74701:13;:31;:::i;74675:68::-;74642:101;;-1:-1:-1;74642:101:0;-1:-1:-1;74642:101:0;-1:-1:-1;74781:42:0;74793:29;60817:12;74793:11;:29;:::i;74781:42::-;74754:69;;-1:-1:-1;74754:69:0;-1:-1:-1;74754:69:0;-1:-1:-1;74843:17:0;74852:8;74754:69;74843:17;:::i;57678:321::-;57847:4;57933:58;57972:8;57982;57933:38;:58::i;:::-;57884:107;;;;;57678:321;-1:-1:-1;;;57678:321:0:o;117160:362::-;117307:24;;:::i;:::-;117340:49;117361:4;:8;;;116513:3;117340:20;:49::i;:::-;-1:-1:-1;;117396:15:0;;;-1:-1:-1;;;;;117418:35:0;:20;;;:35;-1:-1:-1;;;;;;117460:38:0;:23;;;:38;117396:15;117160:362::o;131614:440::-;131809:29;;-1:-1:-1;;131826:4:0;11163:2:1;11159:15;11155:53;131809:29:0;;;11143:66:1;11225:12;;;11218:28;;;131761:17:0;;11262:12:1;;131809:29:0;;;;;;-1:-1:-1;;131809:29:0;;;;;;131799:40;;131809:29;131799:40;;;;131846:28;;;;:17;:28;;;;;;:44;;-1:-1:-1;;;;;;131846:44:0;-1:-1:-1;;;;;131846:44:0;;;;;131799:40;;-1:-1:-1;131799:40:0;;131902:29;;131846:28;131902:29;131946:6;;;:62;;-1:-1:-1;;;131946:62:0;;-1:-1:-1;;;;;131946:6:0;;;;:22;;:62;;131969:13;;131984:7;;131993:14;;131946:62;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;131938:110;;;;-1:-1:-1;;;131938:110:0;;11877:2:1;131938:110:0;;;11859:21:1;11916:2;11896:18;;;11889:30;11955:34;11935:18;;;11928:62;-1:-1:-1;;;12006:18:1;;;11999:33;12049:19;;131938:110:0;11675:399:1;57236:315:0;57354:7;;57394:5;57398:1;57394;:5;:::i;:::-;57379:20;-1:-1:-1;57410:18:0;57460:1;57432:24;47845:6;57379:20;57432:24;:::i;:::-;57431:30;;;;:::i;:::-;57410:51;;57481:62;57496:1;57482:11;:15;:48;;57519:11;141137:39;:41::i;57482:48::-;57500:16;:11;-1:-1:-1;;57500:16:0;:::i;103363:412::-;-1:-1:-1;;;;;;;;;;;;;;;;;103463:13:0;103474:2;103463:8;:13;:::i;:::-;:18;103459:73;;103510:13;103521:2;103510:8;:13;:::i;:::-;103504:20;;:2;:20;:::i;:::-;103492:32;;;;:::i;:::-;;;103459:73;-1:-1:-1;103581:12:0;;;;:23;;;103646:4;103640:11;;103659:16;;;-1:-1:-1;103683:14:0;;103726:18;;;103718:27;103705:41;;103581:12;103363:412::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;14:248:1:-;82:6;90;143:2;131:9;122:7;118:23;114:32;111:52;;;159:1;156;149:12;111:52;-1:-1:-1;;182:23:1;;;252:2;237:18;;;224:32;;-1:-1:-1;14:248:1:o;641:180::-;700:6;753:2;741:9;732:7;728:23;724:32;721:52;;;769:1;766;759:12;721:52;-1:-1:-1;792:23:1;;641:180;-1:-1:-1;641:180:1:o;826:316::-;903:6;911;919;972:2;960:9;951:7;947:23;943:32;940:52;;;988:1;985;978:12;940:52;-1:-1:-1;;1011:23:1;;;1081:2;1066:18;;1053:32;;-1:-1:-1;1132:2:1;1117:18;;;1104:32;;826:316;-1:-1:-1;826:316:1:o;1327:523::-;1431:6;1439;1447;1455;1463;1471;1524:3;1512:9;1503:7;1499:23;1495:33;1492:53;;;1541:1;1538;1531:12;1492:53;-1:-1:-1;;1564:23:1;;;1634:2;1619:18;;1606:32;;-1:-1:-1;1685:2:1;1670:18;;1657:32;;1736:2;1721:18;;1708:32;;-1:-1:-1;1787:3:1;1772:19;;1759:33;;-1:-1:-1;1839:3:1;1824:19;1811:33;;-1:-1:-1;1327:523:1;-1:-1:-1;1327:523:1:o;3585:139::-;-1:-1:-1;;;;;3668:31:1;;3658:42;;3648:70;;3714:1;3711;3704:12;3729:486;3820:6;3828;3836;3889:2;3877:9;3868:7;3864:23;3860:32;3857:52;;;3905:1;3902;3895:12;3857:52;3944:9;3931:23;3963:39;3996:5;3963:39;:::i;:::-;4021:5;-1:-1:-1;4078:2:1;4063:18;;4050:32;4091:41;4050:32;4091:41;:::i;:::-;3729:486;;4151:7;;-1:-1:-1;;;4205:2:1;4190:18;;;;4177:32;;3729:486::o;4220:127::-;4281:10;4276:3;4272:20;4269:1;4262:31;4312:4;4309:1;4302:15;4336:4;4333:1;4326:15;4352:398;4391:4;4436:1;4432:2;4421:17;4473:1;4469:2;4458:17;4503:1;4498:3;4494:11;4587:3;-1:-1:-1;;;;;4546:39:1;4542:49;4537:3;4533:59;4528:2;4521:10;4517:76;4514:102;;;4596:18;;:::i;:::-;4685:3;-1:-1:-1;;;;;4645:44:1;4640:3;4636:54;4632:2;4628:63;4625:89;;;4694:18;;:::i;:::-;-1:-1:-1;4731:13:1;;;4352:398;-1:-1:-1;;;4352:398:1:o;4755:553::-;4794:7;-1:-1:-1;;;;;4864:9:1;;;4892;;;4917:11;;;4936:10;;;4930:17;;4913:35;4910:61;;;4951:18;;:::i;:::-;-1:-1:-1;;;5027:1:1;5020:9;;5045:11;;;5065;;;5058:19;;5041:37;5038:63;;;5081:18;;:::i;:::-;5127:1;5124;5120:9;5110:19;;5174:1;5170:2;5165:11;5162:1;5158:19;5153:2;5149;5145:11;5141:37;5138:63;;;5181:18;;:::i;:::-;5246:1;5242:2;5237:11;5234:1;5230:19;5225:2;5221;5217:11;5213:37;5210:63;;;5253:18;;:::i;:::-;-1:-1:-1;;;5293:9:1;;;;;4755:553;-1:-1:-1;;;4755:553:1:o;5313:127::-;5374:10;5369:3;5365:20;5362:1;5355:31;5405:4;5402:1;5395:15;5429:4;5426:1;5419:15;5445:193;5484:1;5510;5500:35;;5515:18;;:::i;:::-;-1:-1:-1;;;5551:18:1;;-1:-1:-1;;5571:13:1;;5547:38;5544:64;;;5588:18;;:::i;:::-;-1:-1:-1;5622:10:1;;5445:193::o;6052:125::-;6092:4;6120:1;6117;6114:8;6111:34;;;6125:18;;:::i;:::-;-1:-1:-1;6162:9:1;;6052:125::o;6182:265::-;6221:3;6249:9;;;6274:10;;-1:-1:-1;;;;;6293:27:1;;;6286:35;;6270:52;6267:78;;;6325:18;;:::i;:::-;-1:-1:-1;;;6372:19:1;;;6365:27;;6357:36;;6354:62;;;6396:18;;:::i;:::-;-1:-1:-1;;6432:9:1;;6182:265::o;7065:277::-;7132:6;7185:2;7173:9;7164:7;7160:23;7156:32;7153:52;;;7201:1;7198;7191:12;7153:52;7233:9;7227:16;7286:5;7279:13;7272:21;7265:5;7262:32;7252:60;;7308:1;7305;7298:12;8117:168;8157:7;8223:1;8219;8215:6;8211:14;8208:1;8205:21;8200:1;8193:9;8186:17;8182:45;8179:71;;;8230:18;;:::i;:::-;-1:-1:-1;8270:9:1;;8117:168::o;8290:120::-;8330:1;8356;8346:35;;8361:18;;:::i;:::-;-1:-1:-1;8395:9:1;;8290:120::o;8415:267::-;8454:4;8483:9;;;8508:10;;-1:-1:-1;;;8527:19:1;;8520:27;;8504:44;8501:70;;;8551:18;;:::i;:::-;-1:-1:-1;;;;;8598:27:1;;8591:35;;8583:44;;8580:70;;;8630:18;;:::i;:::-;-1:-1:-1;;8667:9:1;;8415:267::o;8687:128::-;8727:3;8758:1;8754:6;8751:1;8748:13;8745:39;;;8764:18;;:::i;:::-;-1:-1:-1;8800:9:1;;8687:128::o;8820:112::-;8852:1;8878;8868:35;;8883:18;;:::i;:::-;-1:-1:-1;8917:9:1;;8820:112::o;9411:471::-;9452:3;9490:5;9484:12;9517:6;9512:3;9505:19;9542:1;9552:162;9566:6;9563:1;9560:13;9552:162;;;9628:4;9684:13;;;9680:22;;9674:29;9656:11;;;9652:20;;9645:59;9581:12;9552:162;;;9732:6;9729:1;9726:13;9723:87;;;9798:1;9791:4;9782:6;9777:3;9773:16;9769:27;9762:38;9723:87;-1:-1:-1;9864:2:1;9843:15;-1:-1:-1;;9839:29:1;9830:39;;;;9871:4;9826:50;;9411:471;-1:-1:-1;;9411:471:1:o;9887:821::-;-1:-1:-1;;;;;10288:15:1;;;10270:34;;10335:2;10320:18;;10313:34;;;10378:2;10363:18;;10356:34;;;10426:15;;10421:2;10406:18;;10399:43;-1:-1:-1;;;;;;10479:33:1;;10473:3;10458:19;;10451:62;10250:3;10529:19;;10522:35;;;10588:3;10573:19;;10566:35;;;10220:3;10495;10617:19;;10610:31;;;10191:4;;10658:44;10683:18;;;10675:6;10658:44;:::i;:::-;10650:52;9887:821;-1:-1:-1;;;;;;;;;;;9887:821:1:o;11285:385::-;11517:1;11513;11508:3;11504:11;11500:19;11492:6;11488:32;11477:9;11470:51;11557:6;11552:2;11541:9;11537:18;11530:34;11600:2;11595;11584:9;11580:18;11573:30;11451:4;11620:44;11660:2;11649:9;11645:18;11637:6;11620:44;:::i
Swarm Source
ipfs://4498dc9b0963c756c54a7907f7525b15753280ae685cec686a4a162bc3f39673
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.