Overview
Max Total Supply
4,840.083727130880975973 jEUR
Holders
324 (0.00%)
Total Transfers
-
Market
Price
$0.00 @ 0.000000 ETH
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
MintableBurnableSyntheticTokenPermit
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import { MintableBurnableSyntheticToken } from './MintableBurnableSyntheticToken.sol'; import { ERC20Permit } from '../../@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol'; import {ERC20} from '../../@openzeppelin/contracts/token/ERC20/ERC20.sol'; import {MintableBurnableERC20} from './MintableBurnableERC20.sol'; import { BaseControlledMintableBurnableERC20 } from './BaseControlledMintableBurnableERC20.sol'; /** * @title Synthetic token contract * Inherits from ERC20Permit and MintableBurnableSyntheticToken */ contract MintableBurnableSyntheticTokenPermit is ERC20Permit, MintableBurnableSyntheticToken { constructor( string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals ) MintableBurnableSyntheticToken(tokenName, tokenSymbol, tokenDecimals) ERC20Permit(tokenName) {} /** * @notice Returns the number of decimals used */ function decimals() public view virtual override(ERC20, BaseControlledMintableBurnableERC20) returns (uint8) { return BaseControlledMintableBurnableERC20.decimals(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * 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 granted `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}. * ==== */ 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); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT 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; }
// SPDX-License-Identifier: MIT 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; } }
// SPDX-License-Identifier: MIT 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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * 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; } }
// SPDX-License-Identifier: MIT 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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {grantRole} to track enumerable memberships */ function grantRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {revokeRole} to track enumerable memberships */ function revokeRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {renounceRole} to track enumerable memberships */ function renounceRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.renounceRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {_setupRole} to track enumerable memberships */ function _setupRole(bytes32 role, address account) internal virtual override { super._setupRole(role, account); _roleMembers[role].add(account); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import { BaseControlledMintableBurnableERC20 } from './BaseControlledMintableBurnableERC20.sol'; import { AccessControlEnumerable } from '../../@openzeppelin/contracts/access/AccessControlEnumerable.sol'; /** * @title ERC20 token contract */ contract MintableBurnableERC20 is AccessControlEnumerable, BaseControlledMintableBurnableERC20 { bytes32 public constant MINTER_ROLE = keccak256('Minter'); bytes32 public constant BURNER_ROLE = keccak256('Burner'); //---------------------------------------- // Modifiers //---------------------------------------- modifier onlyMinter() { require(hasRole(MINTER_ROLE, msg.sender), 'Sender must be the minter'); _; } modifier onlyBurner() { require(hasRole(BURNER_ROLE, msg.sender), 'Sender must be the burner'); _; } //---------------------------------------- // Constructors //---------------------------------------- /** * @notice Constructs the ERC20 token contract * @param _tokenName Name of the token * @param _tokenSymbol Token symbol * @param _tokenDecimals Number of decimals for token */ constructor( string memory _tokenName, string memory _tokenSymbol, uint8 _tokenDecimals ) BaseControlledMintableBurnableERC20( _tokenName, _tokenSymbol, _tokenDecimals ) { _setupDecimals(_tokenDecimals); _setRoleAdmin(DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(MINTER_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(BURNER_ROLE, DEFAULT_ADMIN_ROLE); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } //---------------------------------------- // External functions //---------------------------------------- /** * @notice Mint new ERC20 tokens * @param recipient Recipient of the minted tokens * @param value Amount of tokens to be minted */ function mint(address recipient, uint256 value) external override onlyMinter returns (bool) { _mint(recipient, value); return true; } /** * @notice Burn ERC20 tokens * @param value Amount of ERC20 tokens to be burned */ function burn(uint256 value) external override onlyBurner { _burn(msg.sender, value); } /** * @notice Assign a new minting role * @param account Address of the new minter */ function addMinter(address account) public virtual override { grantRole(MINTER_ROLE, account); } /** * @notice Assign a new burning role * @param account Address of the new burner */ function addBurner(address account) public virtual override { grantRole(BURNER_ROLE, account); } /** * @notice Assign new admin role * @param account Address of the new admin */ function addAdmin(address account) public virtual override { grantRole(DEFAULT_ADMIN_ROLE, account); } /** * @notice Assign admin, minting and burning priviliges to an address * @param account Address to which roles are assigned */ function addAdminAndMinterAndBurner(address account) public virtual override { grantRole(DEFAULT_ADMIN_ROLE, account); grantRole(MINTER_ROLE, account); grantRole(BURNER_ROLE, account); } /** * @notice Self renounce the address calling the function from minter role */ function renounceMinter() public virtual override { renounceRole(MINTER_ROLE, msg.sender); } /** * @notice Self renounce the address calling the function from burner role */ function renounceBurner() public virtual override { renounceRole(BURNER_ROLE, msg.sender); } /** * @notice Self renounce the address calling the function from admin role */ function renounceAdmin() public virtual override { renounceRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** * @notice Self renounce the address calling the function from admin, minter and burner role */ function renounceAdminAndMinterAndBurner() public virtual override { renounceRole(DEFAULT_ADMIN_ROLE, msg.sender); renounceRole(MINTER_ROLE, msg.sender); renounceRole(BURNER_ROLE, msg.sender); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from '../../@openzeppelin/contracts/token/ERC20/ERC20.sol'; import {IMintableBurnableERC20} from './interfaces/IMintableBurnableERC20.sol'; /** * @title ERC20 interface that includes burn mint and roles methods. */ abstract contract BaseControlledMintableBurnableERC20 is IMintableBurnableERC20, ERC20 { uint8 private _decimals; /** * @notice Constructs the ERC20 token contract * @param _tokenName Name of the token * @param _tokenSymbol Token symbol * @param _tokenDecimals Number of decimals for token */ constructor( string memory _tokenName, string memory _tokenSymbol, uint8 _tokenDecimals ) ERC20(_tokenName, _tokenSymbol) { _setupDecimals(_tokenDecimals); } /** * @notice Add Minter role to an account * @param account Address to which Minter role will be added */ function addMinter(address account) external virtual; /** * @notice Add Burner role to an account * @param account Address to which Burner role will be added */ function addBurner(address account) external virtual; /** * @notice Add Admin role to an account * @param account Address to which Admin role will be added */ function addAdmin(address account) external virtual; /** * @notice Add Admin, Minter and Burner roles to an account * @param account Address to which Admin, Minter and Burner roles will be added */ function addAdminAndMinterAndBurner(address account) external virtual; /** * @notice Add Admin, Minter and Burner roles to an account * @param account Address to which Admin, Minter and Burner roles will be added */ /** * @notice Self renounce the address calling the function from minter role */ function renounceMinter() external virtual; /** * @notice Self renounce the address calling the function from burner role */ function renounceBurner() external virtual; /** * @notice Self renounce the address calling the function from admin role */ function renounceAdmin() external virtual; /** * @notice Self renounce the address calling the function from admin, minter and burner role */ function renounceAdminAndMinterAndBurner() external virtual; /** * @notice Returns the number of decimals used to get its user representation. */ function decimals() public view virtual override(ERC20, IMintableBurnableERC20) returns (uint8) { return _decimals; } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @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 {} }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {IERC20} from '../../../@openzeppelin/contracts/token/ERC20/IERC20.sol'; /** * @title ERC20 interface that includes burn mint and roles methods. */ interface IMintableBurnableERC20 is IERC20 { /** * @notice Burns a specific amount of the caller's tokens. * @dev This method should be permissioned to only allow designated parties to burn tokens. */ function burn(uint256 value) external; /** * @notice Mints tokens and adds them to the balance of the `to` address. * @dev This method should be permissioned to only allow designated parties to mint tokens. */ function mint(address to, uint256 value) external returns (bool); /** * @notice Returns the number of decimals used to get its user representation. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT 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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @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); }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import {MintableBurnableERC20} from './MintableBurnableERC20.sol'; /** * @title Synthetic token contract * Inherits from MintableBurnableERC20 */ contract MintableBurnableSyntheticToken is MintableBurnableERC20 { constructor( string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals ) MintableBurnableERC20(tokenName, tokenSymbol, tokenDecimals) {} /** * @notice Add minter role to account * @dev The caller must have the admin role * @param account The address on which minter role is added */ function addMinter(address account) public override { super.addMinter(account); } /** * @notice Add burner role to account * @dev The caller must have the admin role * @param account The address to which burner role is added */ function addBurner(address account) public override { super.addBurner(account); } /** * @notice Add admin role to account. * @dev The caller must have the admin role. * @param account The address to which the admin role is added. */ function addAdmin(address account) public override { super.addAdmin(account); } /** * @notice Add admin, minter and burner roles to account. * @dev The caller must have the admin role. * @param account The address to which the admin, minter and burner roles are added. */ function addAdminAndMinterAndBurner(address account) public override { super.addAdminAndMinterAndBurner(account); } /** * @notice Minter renounce to minter role */ function renounceMinter() public override { super.renounceMinter(); } /** * @notice Burner renounce to burner role */ function renounceBurner() public override { super.renounceBurner(); } /** * @notice Admin renounce to admin role */ function renounceAdmin() public override { super.renounceAdmin(); } /** * @notice Admin, minter and murner renounce to admin, minter and burner roles */ function renounceAdminAndMinterAndBurner() public override { super.renounceAdminAndMinterAndBurner(); } /** * @notice Checks if a given account holds the minter role. * @param account The address which is checked for the minter role. * @return bool True if the provided account is a minter. */ function isMinter(address account) public view returns (bool) { return hasRole(MINTER_ROLE, account); } /** * @notice Checks if a given account holds the burner role. * @param account The address which is checked for the burner role. * @return bool True if the provided account is a burner. */ function isBurner(address account) public view returns (bool) { return hasRole(BURNER_ROLE, account); } /** * @notice Checks if a given account holds the admin role. * @param account The address which is checked for the admin role. * @return bool True if the provided account is an admin. */ function isAdmin(address account) public view returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, account); } /** * @notice Accessor method for the list of member with admin role * @return array of address with admin role */ function getAdminMembers() external view returns (address[] memory) { uint256 numberOfMembers = getRoleMemberCount(DEFAULT_ADMIN_ROLE); address[] memory members = new address[](numberOfMembers); for (uint256 j = 0; j < numberOfMembers; j++) { address newMember = getRoleMember(DEFAULT_ADMIN_ROLE, j); members[j] = newMember; } return members; } /** * @notice Accessor method for the list of member with minter role * @return array of address with minter role */ function getMinterMembers() external view returns (address[] memory) { uint256 numberOfMembers = getRoleMemberCount(MINTER_ROLE); address[] memory members = new address[](numberOfMembers); for (uint256 j = 0; j < numberOfMembers; j++) { address newMember = getRoleMember(MINTER_ROLE, j); members[j] = newMember; } return members; } /** * @notice Accessor method for the list of member with burner role * @return array of address with burner role */ function getBurnerMembers() external view returns (address[] memory) { uint256 numberOfMembers = getRoleMemberCount(BURNER_ROLE); address[] memory members = new address[](numberOfMembers); for (uint256 j = 0; j < numberOfMembers; j++) { address newMember = getRoleMember(BURNER_ROLE, j); members[j] = newMember; } return members; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./draft-IERC20Permit.sol"; import "../ERC20.sol"; import "../../../utils/cryptography/draft-EIP712.sol"; import "../../../utils/cryptography/ECDSA.sol"; import "../../../utils/Counters.sol"; /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ */ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @dev See {IERC20Permit-permit}. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import { BaseControlledMintableBurnableERC20 } from '../BaseControlledMintableBurnableERC20.sol'; import {MintableBurnableTokenFactory} from './MintableBurnableTokenFactory.sol'; import { MintableBurnableSyntheticTokenPermit } from '../MintableBurnableSyntheticTokenPermit.sol'; import { ReentrancyGuard } from '../../../@openzeppelin/contracts/security/ReentrancyGuard.sol'; contract SynthereumSyntheticTokenPermitFactory is ReentrancyGuard, MintableBurnableTokenFactory { //---------------------------------------- // Constructor //---------------------------------------- /** * @notice Constructs SynthereumSyntheticTokenPermitFactory contract * @param _synthereumFinder Synthereum finder contract */ constructor(address _synthereumFinder) MintableBurnableTokenFactory(_synthereumFinder) {} /** * @notice Create a new synthetic token with permit function and return it to the caller. * @dev The caller will become the only minter and burner and the new owner capable of assigning the roles. * @param tokenName used to describe the new token. * @param tokenSymbol short ticker abbreviation of the name. Ideally < 5 chars. * @param tokenDecimals used to define the precision used in the token's numerical representation. * @return newToken an instance of the newly created token */ function createToken( string calldata tokenName, string calldata tokenSymbol, uint8 tokenDecimals ) public override onlyPoolFactoryOrFixedRateFactory nonReentrant returns (BaseControlledMintableBurnableERC20 newToken) { MintableBurnableSyntheticTokenPermit mintableToken = new MintableBurnableSyntheticTokenPermit( tokenName, tokenSymbol, tokenDecimals ); newToken = BaseControlledMintableBurnableERC20(address(mintableToken)); _setAdminRole(newToken); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import {ISynthereumFinder} from '../../core/interfaces/IFinder.sol'; import { ISynthereumFactoryVersioning } from '../../core/interfaces/IFactoryVersioning.sol'; import { SynthereumInterfaces, FactoryInterfaces } from '../../core/Constants.sol'; import {SynthereumFactoryAccess} from '../../common/libs/FactoryAccess.sol'; import { BaseControlledMintableBurnableERC20 } from '../BaseControlledMintableBurnableERC20.sol'; /** * @title Factory for creating new mintable and burnable tokens. */ abstract contract MintableBurnableTokenFactory { //---------------------------------------- // Storage //---------------------------------------- ISynthereumFinder public synthereumFinder; //---------------------------------------- // Modifiers //---------------------------------------- modifier onlyPoolFactoryOrFixedRateFactory() { SynthereumFactoryAccess._onlyPoolFactoryOrFixedRateFactory( synthereumFinder ); _; } //---------------------------------------- // Constructor //---------------------------------------- /** * @notice Constructs SynthereumSyntheticTokenFactory contract * @param _synthereumFinder Synthereum finder contract */ constructor(address _synthereumFinder) { synthereumFinder = ISynthereumFinder(_synthereumFinder); } /** * @notice Create a new token and return it to the caller. * @param tokenName used to describe the new token. * @param tokenSymbol short ticker abbreviation of the name. Ideally < 5 chars. * @param tokenDecimals used to define the precision used in the token's numerical representation. * @return newToken an instance of the newly created token interface. */ function createToken( string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals ) public virtual returns (BaseControlledMintableBurnableERC20 newToken); /** * @notice Set admin rol to the token * @param token Token on which the adim role is set */ function _setAdminRole(BaseControlledMintableBurnableERC20 token) internal { token.addAdmin(msg.sender); token.renounceAdmin(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /** * @title Provides addresses of the contracts implementing certain interfaces. */ interface ISynthereumFinder { /** * @notice Updates the address of the contract that implements `interfaceName`. * @param interfaceName bytes32 encoding of the interface name that is either changed or registered. * @param implementationAddress address of the deployed contract that implements the interface. */ function changeImplementationAddress( bytes32 interfaceName, address implementationAddress ) external; /** * @notice Gets the address of the contract that implements the given `interfaceName`. * @param interfaceName queried interface. * @return implementationAddress Address of the deployed contract that implements the interface. */ function getImplementationAddress(bytes32 interfaceName) external view returns (address); }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /** * @title Provides addresses of different versions of pools factory and derivative factory */ interface ISynthereumFactoryVersioning { /** @notice Sets a Factory * @param factoryType Type of factory * @param version Version of the factory to be set * @param factory The pool factory address to be set */ function setFactory( bytes32 factoryType, uint8 version, address factory ) external; /** @notice Removes a factory * @param factoryType The type of factory to be removed * @param version Version of the factory to be removed */ function removeFactory(bytes32 factoryType, uint8 version) external; /** @notice Gets a factory contract address * @param factoryType The type of factory to be checked * @param version Version of the factory to be checked * @return factory Address of the factory contract */ function getFactoryVersion(bytes32 factoryType, uint8 version) external view returns (address factory); /** @notice Gets the number of factory versions for a specific type * @param factoryType The type of factory to be checked * @return numberOfVersions Total number of versions for a specific factory */ function numberOfFactoryVersions(bytes32 factoryType) external view returns (uint8 numberOfVersions); }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; /** * @title Stores common interface names used throughout Synthereum. */ library SynthereumInterfaces { bytes32 public constant Deployer = 'Deployer'; bytes32 public constant FactoryVersioning = 'FactoryVersioning'; bytes32 public constant TokenFactory = 'TokenFactory'; bytes32 public constant PoolRegistry = 'PoolRegistry'; bytes32 public constant SelfMintingRegistry = 'SelfMintingRegistry'; bytes32 public constant FixedRateRegistry = 'FixedRateRegistry'; bytes32 public constant PriceFeed = 'PriceFeed'; bytes32 public constant Manager = 'Manager'; bytes32 public constant CreditLineController = 'CreditLineController'; bytes32 public constant CollateralWhitelist = 'CollateralWhitelist'; bytes32 public constant IdentifierWhitelist = 'IdentifierWhitelist'; bytes32 public constant TrustedForwarder = 'TrustedForwarder'; bytes32 public constant MoneyMarketManager = 'MoneyMarketManager'; bytes32 public constant JarvisBrrrrr = 'JarvisBrrrrr'; bytes32 public constant LendingManager = 'LendingManager'; bytes32 public constant LendingStorageManager = 'LendingStorageManager'; bytes32 public constant CommissionReceiver = 'CommissionReceiver'; bytes32 public constant BuybackProgramReceiver = 'BuybackProgramReceiver'; bytes32 public constant LendingRewardsReceiver = 'LendingRewardsReceiver'; bytes32 public constant JarvisToken = 'JarvisToken'; bytes32 public constant DebtTokenFactory = 'DebtTokenFactory'; } library FactoryInterfaces { bytes32 public constant PoolFactory = 'PoolFactory'; bytes32 public constant SelfMintingFactory = 'SelfMintingFactory'; bytes32 public constant FixedRateFactory = 'FixedRateFactory'; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import {ISynthereumFinder} from '../../core/interfaces/IFinder.sol'; import { ISynthereumFactoryVersioning } from '../../core/interfaces/IFactoryVersioning.sol'; import { SynthereumInterfaces, FactoryInterfaces } from '../../core/Constants.sol'; /** @title Library to use for controlling the access of a functions from the factories */ library SynthereumFactoryAccess { /** *@notice Revert if caller is not a Pool factory * @param _finder Synthereum finder */ function _onlyPoolFactory(ISynthereumFinder _finder) internal view { ISynthereumFactoryVersioning factoryVersioning = ISynthereumFactoryVersioning( _finder.getImplementationAddress(SynthereumInterfaces.FactoryVersioning) ); uint8 numberOfPoolFactories = factoryVersioning.numberOfFactoryVersions(FactoryInterfaces.PoolFactory); require( _checkSenderIsFactory( factoryVersioning, numberOfPoolFactories, FactoryInterfaces.PoolFactory ), 'Not allowed' ); } /** * @notice Revert if caller is not a Pool factory or a Fixed rate factory * @param _finder Synthereum finder */ function _onlyPoolFactoryOrFixedRateFactory(ISynthereumFinder _finder) internal view { ISynthereumFactoryVersioning factoryVersioning = ISynthereumFactoryVersioning( _finder.getImplementationAddress(SynthereumInterfaces.FactoryVersioning) ); uint8 numberOfPoolFactories = factoryVersioning.numberOfFactoryVersions(FactoryInterfaces.PoolFactory); uint8 numberOfFixedRateFactories = factoryVersioning.numberOfFactoryVersions( FactoryInterfaces.FixedRateFactory ); bool isPoolFactory = _checkSenderIsFactory( factoryVersioning, numberOfPoolFactories, FactoryInterfaces.PoolFactory ); if (isPoolFactory) { return; } bool isFixedRateFactory = _checkSenderIsFactory( factoryVersioning, numberOfFixedRateFactories, FactoryInterfaces.FixedRateFactory ); if (isFixedRateFactory) { return; } revert('Sender must be a Pool or FixedRate factory'); } /** * @notice Check if sender is a factory * @param _factoryVersioning SynthereumFactoryVersioning contract * @param _numberOfFactories Total number of versions of a factory type * @param _factoryKind Type of the factory * @return isFactory True if sender is a factory, otherwise false */ function _checkSenderIsFactory( ISynthereumFactoryVersioning _factoryVersioning, uint8 _numberOfFactories, bytes32 _factoryKind ) private view returns (bool isFactory) { uint8 counterFactory; for (uint8 i = 0; counterFactory < _numberOfFactories; i++) { try _factoryVersioning.getFactoryVersion(_factoryKind, i) returns ( address factory ) { if (msg.sender == factory) { isFactory = true; break; } else { counterFactory++; if (counterFactory == _numberOfFactories) { isFactory = false; } } } catch {} } } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import { BaseControlledMintableBurnableERC20 } from '../BaseControlledMintableBurnableERC20.sol'; import {MintableBurnableTokenFactory} from './MintableBurnableTokenFactory.sol'; import { MintableBurnableSyntheticToken } from '../MintableBurnableSyntheticToken.sol'; import { ReentrancyGuard } from '../../../@openzeppelin/contracts/security/ReentrancyGuard.sol'; contract SynthereumSyntheticTokenFactory is ReentrancyGuard, MintableBurnableTokenFactory { //---------------------------------------- // Constructor //---------------------------------------- /** * @notice Constructs SynthereumSyntheticTokenFactory contract * @param _synthereumFinder Synthereum finder contract */ constructor(address _synthereumFinder) MintableBurnableTokenFactory(_synthereumFinder) {} /** * @notice Create a new synthetic token and return it to the caller. * @dev The caller will become the only minter and burner and the new owner capable of assigning the roles. * @param tokenName used to describe the new token. * @param tokenSymbol short ticker abbreviation of the name. Ideally < 5 chars. * @param tokenDecimals used to define the precision used in the token's numerical representation. * @return newToken an instance of the newly created token */ function createToken( string calldata tokenName, string calldata tokenSymbol, uint8 tokenDecimals ) public override onlyPoolFactoryOrFixedRateFactory nonReentrant returns (BaseControlledMintableBurnableERC20 newToken) { MintableBurnableSyntheticToken mintableToken = new MintableBurnableSyntheticToken(tokenName, tokenSymbol, tokenDecimals); newToken = BaseControlledMintableBurnableERC20(address(mintableToken)); _setAdminRole(newToken); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.9; import {ISynthereumFinder} from './interfaces/IFinder.sol'; import { AccessControlEnumerable } from '../../@openzeppelin/contracts/access/AccessControlEnumerable.sol'; /** * @title Provides addresses of contracts implementing certain interfaces. */ contract SynthereumFinder is ISynthereumFinder, AccessControlEnumerable { bytes32 public constant MAINTAINER_ROLE = keccak256('Maintainer'); //Describe role structure struct Roles { address admin; address maintainer; } //---------------------------------------- // Storage //---------------------------------------- mapping(bytes32 => address) public interfacesImplemented; //---------------------------------------- // Events //---------------------------------------- event InterfaceImplementationChanged( bytes32 indexed interfaceName, address indexed newImplementationAddress ); //---------------------------------------- // Modifiers //---------------------------------------- modifier onlyMaintainer() { require( hasRole(MAINTAINER_ROLE, msg.sender), 'Sender must be the maintainer' ); _; } //---------------------------------------- // Constructors //---------------------------------------- constructor(Roles memory roles) { _setRoleAdmin(DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(MAINTAINER_ROLE, DEFAULT_ADMIN_ROLE); _setupRole(DEFAULT_ADMIN_ROLE, roles.admin); _setupRole(MAINTAINER_ROLE, roles.maintainer); } //---------------------------------------- // External view //---------------------------------------- /** * @notice Updates the address of the contract that implements `interfaceName`. * @param interfaceName bytes32 of the interface name that is either changed or registered. * @param implementationAddress address of the implementation contract. */ function changeImplementationAddress( bytes32 interfaceName, address implementationAddress ) external override onlyMaintainer { interfacesImplemented[interfaceName] = implementationAddress; emit InterfaceImplementationChanged(interfaceName, implementationAddress); } /** * @notice Gets the address of the contract that implements the given `interfaceName`. * @param interfaceName queried interface. * @return implementationAddress Address of the defined interface. */ function getImplementationAddress(bytes32 interfaceName) external view override returns (address) { address implementationAddress = interfacesImplemented[interfaceName]; require(implementationAddress != address(0x0), 'Implementation not found'); return implementationAddress; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"tokenName","type":"string"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint8","name":"tokenDecimals","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addAdminAndMinterAndBurner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addBurner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdminMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBurnerMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinterMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isBurner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceAdminAndMinterAndBurner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceBurner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101406040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610120523480156200003757600080fd5b5060405162002860380380620028608339810160408190526200005a916200051b565b8282828282828282828b80604051806040016040528060018152602001603160f81b8152508585816005908051906020019062000099929190620003a8565b508051620000af906006906020840190620003a8565b5050825160209384012082519284019290922060c083815260e08290524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818a018190528183019890985260608101959095526080808601939093523085830152805180860390920182529390920190925280519401939093209092526101005250506008805460ff191660ff83161790555050506200015f81620001e260201b60201c565b6200016c600080620001f8565b620001997f6e58ad548d72b425ea94c15f453bf26caddb061d82b2551db7fdd3cefe0e99406000620001f8565b620001c67fe4b2a1ba12b0ae46fe120e095faea153cf269e4b012b647a52a09f4e0e45f1796000620001f8565b620001d360003362000243565b505050505050505050620005dd565b6008805460ff191660ff92909216919091179055565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6200025a82826200028660201b62000dfa1760201c565b60008281526001602090815260409091206200028191839062000e0862000296821b17901c565b505050565b620002928282620002b6565b5050565b6000620002ad836001600160a01b03841662000356565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000292576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003123390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546200039f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620002b0565b506000620002b0565b828054620003b690620005a0565b90600052602060002090601f016020900481019282620003da576000855562000425565b82601f10620003f557805160ff191683800117855562000425565b8280016001018555821562000425579182015b828111156200042557825182559160200191906001019062000408565b506200043392915062000437565b5090565b5b8082111562000433576000815560010162000438565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200047657600080fd5b81516001600160401b03808211156200049357620004936200044e565b604051601f8301601f19908116603f01168101908282118183101715620004be57620004be6200044e565b81604052838152602092508683858801011115620004db57600080fd5b600091505b83821015620004ff5785820183015181830184015290820190620004e0565b83821115620005115760008385830101525b9695505050505050565b6000806000606084860312156200053157600080fd5b83516001600160401b03808211156200054957600080fd5b620005578783880162000464565b945060208601519150808211156200056e57600080fd5b506200057d8682870162000464565b925050604084015160ff811681146200059557600080fd5b809150509250925092565b600181811c90821680620005b557607f821691505b60208210811415620005d757634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516122336200062d6000396000610c06015260006111c201526000611211015260006111ec015260006111700152600061119901526122336000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c806370a0823111610146578063a457c2d7116100c3578063d539139311610087578063d539139314610505578063d547741f1461051a578063dd62ed3e1461052d578063e9ec9e8b14610566578063ea889a891461056e578063f44637ba1461057657600080fd5b8063a457c2d7146104a6578063a9059cbb146104b9578063aa271e1a146104cc578063ca15c873146104df578063d505accf146104f257600080fd5b806391d148541161010a57806391d148541461046857806395d89b411461047b578063983b2d56146104835780639865027514610496578063a217fddf1461049e57600080fd5b806370a08231146103f15780637ecebe001461041a5780638169d68e1461042d5780638bad0c0a146104355780639010d07c1461043d57600080fd5b8063313ce567116101d457806342966c681161019857806342966c681461039d5780634334614a146103b057806355783c8f146103c357806355aa8127146103d657806370480275146103de57600080fd5b8063313ce567146103425780633644e5151461035c57806336568abe14610364578063395093511461037757806340c10f191461038a57600080fd5b8063248a9ca31161021b578063248a9ca3146102cd57806324d7806c146102f0578063282c51f3146103035780632bb77846146103185780632f2ff15d1461032d57600080fd5b806301ffc9a71461025857806306fdde0314610280578063095ea7b31461029557806318160ddd146102a857806323b872dd146102ba575b600080fd5b61026b610266366004611dae565b610589565b60405190151581526020015b60405180910390f35b6102886105b4565b6040516102779190611e04565b61026b6102a3366004611e53565b610646565b6004545b604051908152602001610277565b61026b6102c8366004611e7d565b61065c565b6102ac6102db366004611eb9565b60009081526020819052604090206001015490565b61026b6102fe366004611ed2565b61070b565b6102ac6000805160206121be83398151915281565b610320610717565b6040516102779190611eed565b61034061033b366004611f3a565b6107cb565b005b61034a6107f2565b60405160ff9091168152602001610277565b6102ac610805565b610340610372366004611f3a565b61080f565b61026b610385366004611e53565b610831565b61026b610398366004611e53565b61086d565b6103406103ab366004611eb9565b6108dd565b61026b6103be366004611ed2565b61094e565b6103406103d1366004611ed2565b610968565b610340610971565b6103406103ec366004611ed2565b61097b565b6102ac6103ff366004611ed2565b6001600160a01b031660009081526002602052604090205490565b6102ac610428366004611ed2565b610984565b6103206109a2565b610340610a6b565b61045061044b366004611f66565b610a73565b6040516001600160a01b039091168152602001610277565b61026b610476366004611f3a565b610a92565b610288610abb565b610340610491366004611ed2565b610aca565b610340610ad3565b6102ac600081565b61026b6104b4366004611e53565b610adb565b61026b6104c7366004611e53565b610b74565b61026b6104da366004611ed2565b610b81565b6102ac6104ed366004611eb9565b610b9b565b610340610500366004611f88565b610bb2565b6102ac6000805160206121de83398151915281565b610340610528366004611f3a565b610d16565b6102ac61053b366004611ffb565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b610340610d20565b610320610d28565b610340610584366004611ed2565b610df1565b60006001600160e01b03198216635a05180f60e01b14806105ae57506105ae82610e1d565b92915050565b6060600580546105c390612025565b80601f01602080910402602001604051908101604052809291908181526020018280546105ef90612025565b801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b6000610653338484610e52565b50600192915050565b6000610669848484610f76565b6001600160a01b0384166000908152600360209081526040808320338452909152902054828110156106f35760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6107008533858403610e52565b506001949350505050565b60006105ae8183610a92565b6060600061072481610b9b565b905060008167ffffffffffffffff8111156107415761074161205a565b60405190808252806020026020018201604052801561076a578160200160208202803683370190505b50905060005b828110156107c45760006107848183610a73565b90508083838151811061079957610799612070565b6001600160a01b039092166020928302919091019091015250806107bc8161209c565b915050610770565b5092915050565b6107d58282611146565b60008281526001602052604090206107ed9082610e08565b505050565b600061080060085460ff1690565b905090565b600061080061116c565b610819828261125f565b60008281526001602052604090206107ed90826112d9565b3360008181526003602090815260408083206001600160a01b038716845290915281205490916106539185906108689086906120b7565b610e52565b60006108876000805160206121de83398151915233610a92565b6108d35760405162461bcd60e51b815260206004820152601960248201527f53656e646572206d75737420626520746865206d696e7465720000000000000060448201526064016106ea565b61065383836112ee565b6108f56000805160206121be83398151915233610a92565b6109415760405162461bcd60e51b815260206004820152601960248201527f53656e646572206d75737420626520746865206275726e65720000000000000060448201526064016106ea565b61094b33826113cd565b50565b60006105ae6000805160206121be83398151915283610a92565b61094b8161151b565b610979611556565b565b61094b81611591565b6001600160a01b0381166000908152600760205260408120546105ae565b606060006109bd6000805160206121be833981519152610b9b565b905060008167ffffffffffffffff8111156109da576109da61205a565b604051908082528060200260200182016040528015610a03578160200160208202803683370190505b50905060005b828110156107c4576000610a2b6000805160206121be83398151915283610a73565b905080838381518110610a4057610a40612070565b6001600160a01b03909216602092830291909101909101525080610a638161209c565b915050610a09565b61097961159c565b6000828152600160205260408120610a8b90836115a7565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600680546105c390612025565b61094b816115b3565b6109796115cb565b3360009081526003602090815260408083206001600160a01b038616845290915281205482811015610b5d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106ea565b610b6a3385858403610e52565b5060019392505050565b6000610653338484610f76565b60006105ae6000805160206121de83398151915283610a92565b60008181526001602052604081206105ae906115e3565b83421115610c025760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016106ea565b60007f0000000000000000000000000000000000000000000000000000000000000000888888610c318c6115ed565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610c8c82611615565b90506000610c9c82878787611663565b9050896001600160a01b0316816001600160a01b031614610cff5760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016106ea565b610d0a8a8a8a610e52565b50505050505050505050565b610819828261168b565b610979611579565b60606000610d436000805160206121de833981519152610b9b565b905060008167ffffffffffffffff811115610d6057610d6061205a565b604051908082528060200260200182016040528015610d89578160200160208202803683370190505b50905060005b828110156107c4576000610db16000805160206121de83398151915283610a73565b905080838381518110610dc657610dc6612070565b6001600160a01b03909216602092830291909101909101525080610de98161209c565b915050610d8f565b61094b8161153e565b610e0482826116b1565b5050565b6000610a8b836001600160a01b038416611735565b60006001600160e01b03198216637965db0b60e01b14806105ae57506301ffc9a760e01b6001600160e01b03198316146105ae565b6001600160a01b038316610eb45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106ea565b6001600160a01b038216610f155760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106ea565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fda5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106ea565b6001600160a01b03821661103c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106ea565b6001600160a01b038316600090815260026020526040902054818110156110b45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016106ea565b6001600160a01b038085166000908152600260205260408082208585039055918516815290812080548492906110eb9084906120b7565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161113791815260200190565b60405180910390a35b50505050565b6000828152602081905260409020600101546111628133611784565b6107ed83836116b1565b60007f00000000000000000000000000000000000000000000000000000000000000004614156111bb57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b03811633146112cf5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106ea565b610e0482826117e8565b6000610a8b836001600160a01b03841661184d565b6001600160a01b0382166113445760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106ea565b806004600082825461135691906120b7565b90915550506001600160a01b038216600090815260026020526040812080548392906113839084906120b7565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b03821661142d5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016106ea565b6001600160a01b038216600090815260026020526040902054818110156114a15760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016106ea565b6001600160a01b03831660009081526002602052604081208383039055600480548492906114d09084906120cf565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6115266000826107cb565b61153e6000805160206121de833981519152826107cb565b61094b6000805160206121be833981519152826107cb565b61156160003361080f565b6115796000805160206121de8339815191523361080f565b6109796000805160206121be8339815191523361080f565b61094b6000826107cb565b61097960003361080f565b6000610a8b8383611940565b61094b6000805160206121de833981519152826107cb565b6109796000805160206121de8339815191523361080f565b60006105ae825490565b6001600160a01b03811660009081526007602052604090208054600181018255905b50919050565b60006105ae61162261116c565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006116748787878761196a565b9150915061168181611a57565b5095945050505050565b6000828152602081905260409020600101546116a78133611784565b6107ed83836117e8565b6116bb8282610a92565b610e04576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116f13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205461177c575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105ae565b5060006105ae565b61178e8282610a92565b610e04576117a6816001600160a01b03166014611c12565b6117b1836020611c12565b6040516020016117c29291906120e6565b60408051601f198184030181529082905262461bcd60e51b82526106ea91600401611e04565b6117f28282610a92565b15610e04576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815260018301602052604081205480156119365760006118716001836120cf565b8554909150600090611885906001906120cf565b90508181146118ea5760008660000182815481106118a5576118a5612070565b90600052602060002001549050808760000184815481106118c8576118c8612070565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806118fb576118fb61215b565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105ae565b60009150506105ae565b600082600001828154811061195757611957612070565b9060005260206000200154905092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156119a15750600090506003611a4e565b8460ff16601b141580156119b957508460ff16601c14155b156119ca5750600090506004611a4e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611a1e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611a4757600060019250925050611a4e565b9150600090505b94509492505050565b6000816004811115611a6b57611a6b612171565b1415611a745750565b6001816004811115611a8857611a88612171565b1415611ad65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106ea565b6002816004811115611aea57611aea612171565b1415611b385760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106ea565b6003816004811115611b4c57611b4c612171565b1415611ba55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016106ea565b6004816004811115611bb957611bb9612171565b141561094b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016106ea565b60606000611c21836002612187565b611c2c9060026120b7565b67ffffffffffffffff811115611c4457611c4461205a565b6040519080825280601f01601f191660200182016040528015611c6e576020820181803683370190505b509050600360fc1b81600081518110611c8957611c89612070565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cb857611cb8612070565b60200101906001600160f81b031916908160001a9053506000611cdc846002612187565b611ce79060016120b7565b90505b6001811115611d5f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d1b57611d1b612070565b1a60f81b828281518110611d3157611d31612070565b60200101906001600160f81b031916908160001a90535060049490941c93611d58816121a6565b9050611cea565b508315610a8b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106ea565b600060208284031215611dc057600080fd5b81356001600160e01b031981168114610a8b57600080fd5b60005b83811015611df3578181015183820152602001611ddb565b838111156111405750506000910152565b6020815260008251806020840152611e23816040850160208701611dd8565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611e4e57600080fd5b919050565b60008060408385031215611e6657600080fd5b611e6f83611e37565b946020939093013593505050565b600080600060608486031215611e9257600080fd5b611e9b84611e37565b9250611ea960208501611e37565b9150604084013590509250925092565b600060208284031215611ecb57600080fd5b5035919050565b600060208284031215611ee457600080fd5b610a8b82611e37565b6020808252825182820181905260009190848201906040850190845b81811015611f2e5783516001600160a01b031683529284019291840191600101611f09565b50909695505050505050565b60008060408385031215611f4d57600080fd5b82359150611f5d60208401611e37565b90509250929050565b60008060408385031215611f7957600080fd5b50508035926020909101359150565b600080600080600080600060e0888a031215611fa357600080fd5b611fac88611e37565b9650611fba60208901611e37565b95506040880135945060608801359350608088013560ff81168114611fde57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561200e57600080fd5b61201783611e37565b9150611f5d60208401611e37565b600181811c9082168061203957607f821691505b6020821081141561160f57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156120b0576120b0612086565b5060010190565b600082198211156120ca576120ca612086565b500190565b6000828210156120e1576120e1612086565b500390565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161211e816017850160208801611dd8565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161214f816028840160208801611dd8565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60008160001904831182151516156121a1576121a1612086565b500290565b6000816121b5576121b5612086565b50600019019056fee4b2a1ba12b0ae46fe120e095faea153cf269e4b012b647a52a09f4e0e45f1796e58ad548d72b425ea94c15f453bf26caddb061d82b2551db7fdd3cefe0e9940a26469706673582212205bd92ebc3aa0caf3ec46fefda0772d3f51e41baa88ec198f67059a6ecc7a54c464736f6c63430008090033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000154a61727669732053796e746865746963204575726f000000000000000000000000000000000000000000000000000000000000000000000000000000000000046a45555200000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102535760003560e01c806370a0823111610146578063a457c2d7116100c3578063d539139311610087578063d539139314610505578063d547741f1461051a578063dd62ed3e1461052d578063e9ec9e8b14610566578063ea889a891461056e578063f44637ba1461057657600080fd5b8063a457c2d7146104a6578063a9059cbb146104b9578063aa271e1a146104cc578063ca15c873146104df578063d505accf146104f257600080fd5b806391d148541161010a57806391d148541461046857806395d89b411461047b578063983b2d56146104835780639865027514610496578063a217fddf1461049e57600080fd5b806370a08231146103f15780637ecebe001461041a5780638169d68e1461042d5780638bad0c0a146104355780639010d07c1461043d57600080fd5b8063313ce567116101d457806342966c681161019857806342966c681461039d5780634334614a146103b057806355783c8f146103c357806355aa8127146103d657806370480275146103de57600080fd5b8063313ce567146103425780633644e5151461035c57806336568abe14610364578063395093511461037757806340c10f191461038a57600080fd5b8063248a9ca31161021b578063248a9ca3146102cd57806324d7806c146102f0578063282c51f3146103035780632bb77846146103185780632f2ff15d1461032d57600080fd5b806301ffc9a71461025857806306fdde0314610280578063095ea7b31461029557806318160ddd146102a857806323b872dd146102ba575b600080fd5b61026b610266366004611dae565b610589565b60405190151581526020015b60405180910390f35b6102886105b4565b6040516102779190611e04565b61026b6102a3366004611e53565b610646565b6004545b604051908152602001610277565b61026b6102c8366004611e7d565b61065c565b6102ac6102db366004611eb9565b60009081526020819052604090206001015490565b61026b6102fe366004611ed2565b61070b565b6102ac6000805160206121be83398151915281565b610320610717565b6040516102779190611eed565b61034061033b366004611f3a565b6107cb565b005b61034a6107f2565b60405160ff9091168152602001610277565b6102ac610805565b610340610372366004611f3a565b61080f565b61026b610385366004611e53565b610831565b61026b610398366004611e53565b61086d565b6103406103ab366004611eb9565b6108dd565b61026b6103be366004611ed2565b61094e565b6103406103d1366004611ed2565b610968565b610340610971565b6103406103ec366004611ed2565b61097b565b6102ac6103ff366004611ed2565b6001600160a01b031660009081526002602052604090205490565b6102ac610428366004611ed2565b610984565b6103206109a2565b610340610a6b565b61045061044b366004611f66565b610a73565b6040516001600160a01b039091168152602001610277565b61026b610476366004611f3a565b610a92565b610288610abb565b610340610491366004611ed2565b610aca565b610340610ad3565b6102ac600081565b61026b6104b4366004611e53565b610adb565b61026b6104c7366004611e53565b610b74565b61026b6104da366004611ed2565b610b81565b6102ac6104ed366004611eb9565b610b9b565b610340610500366004611f88565b610bb2565b6102ac6000805160206121de83398151915281565b610340610528366004611f3a565b610d16565b6102ac61053b366004611ffb565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b610340610d20565b610320610d28565b610340610584366004611ed2565b610df1565b60006001600160e01b03198216635a05180f60e01b14806105ae57506105ae82610e1d565b92915050565b6060600580546105c390612025565b80601f01602080910402602001604051908101604052809291908181526020018280546105ef90612025565b801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b6000610653338484610e52565b50600192915050565b6000610669848484610f76565b6001600160a01b0384166000908152600360209081526040808320338452909152902054828110156106f35760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6107008533858403610e52565b506001949350505050565b60006105ae8183610a92565b6060600061072481610b9b565b905060008167ffffffffffffffff8111156107415761074161205a565b60405190808252806020026020018201604052801561076a578160200160208202803683370190505b50905060005b828110156107c45760006107848183610a73565b90508083838151811061079957610799612070565b6001600160a01b039092166020928302919091019091015250806107bc8161209c565b915050610770565b5092915050565b6107d58282611146565b60008281526001602052604090206107ed9082610e08565b505050565b600061080060085460ff1690565b905090565b600061080061116c565b610819828261125f565b60008281526001602052604090206107ed90826112d9565b3360008181526003602090815260408083206001600160a01b038716845290915281205490916106539185906108689086906120b7565b610e52565b60006108876000805160206121de83398151915233610a92565b6108d35760405162461bcd60e51b815260206004820152601960248201527f53656e646572206d75737420626520746865206d696e7465720000000000000060448201526064016106ea565b61065383836112ee565b6108f56000805160206121be83398151915233610a92565b6109415760405162461bcd60e51b815260206004820152601960248201527f53656e646572206d75737420626520746865206275726e65720000000000000060448201526064016106ea565b61094b33826113cd565b50565b60006105ae6000805160206121be83398151915283610a92565b61094b8161151b565b610979611556565b565b61094b81611591565b6001600160a01b0381166000908152600760205260408120546105ae565b606060006109bd6000805160206121be833981519152610b9b565b905060008167ffffffffffffffff8111156109da576109da61205a565b604051908082528060200260200182016040528015610a03578160200160208202803683370190505b50905060005b828110156107c4576000610a2b6000805160206121be83398151915283610a73565b905080838381518110610a4057610a40612070565b6001600160a01b03909216602092830291909101909101525080610a638161209c565b915050610a09565b61097961159c565b6000828152600160205260408120610a8b90836115a7565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600680546105c390612025565b61094b816115b3565b6109796115cb565b3360009081526003602090815260408083206001600160a01b038616845290915281205482811015610b5d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106ea565b610b6a3385858403610e52565b5060019392505050565b6000610653338484610f76565b60006105ae6000805160206121de83398151915283610a92565b60008181526001602052604081206105ae906115e3565b83421115610c025760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016106ea565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610c318c6115ed565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610c8c82611615565b90506000610c9c82878787611663565b9050896001600160a01b0316816001600160a01b031614610cff5760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016106ea565b610d0a8a8a8a610e52565b50505050505050505050565b610819828261168b565b610979611579565b60606000610d436000805160206121de833981519152610b9b565b905060008167ffffffffffffffff811115610d6057610d6061205a565b604051908082528060200260200182016040528015610d89578160200160208202803683370190505b50905060005b828110156107c4576000610db16000805160206121de83398151915283610a73565b905080838381518110610dc657610dc6612070565b6001600160a01b03909216602092830291909101909101525080610de98161209c565b915050610d8f565b61094b8161153e565b610e0482826116b1565b5050565b6000610a8b836001600160a01b038416611735565b60006001600160e01b03198216637965db0b60e01b14806105ae57506301ffc9a760e01b6001600160e01b03198316146105ae565b6001600160a01b038316610eb45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106ea565b6001600160a01b038216610f155760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106ea565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fda5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106ea565b6001600160a01b03821661103c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106ea565b6001600160a01b038316600090815260026020526040902054818110156110b45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016106ea565b6001600160a01b038085166000908152600260205260408082208585039055918516815290812080548492906110eb9084906120b7565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161113791815260200190565b60405180910390a35b50505050565b6000828152602081905260409020600101546111628133611784565b6107ed83836116b1565b60007f000000000000000000000000000000000000000000000000000000000000a4b14614156111bb57507f5f99cb34dc3b93c6106f3e8b69516f699a50a01b40a434ee7d86c66d4095343e90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f79e81012ce520b674e1e65c76fbcf2f46a0b96fbf1aaa17c9ef3c5f07b75456e828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b03811633146112cf5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106ea565b610e0482826117e8565b6000610a8b836001600160a01b03841661184d565b6001600160a01b0382166113445760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106ea565b806004600082825461135691906120b7565b90915550506001600160a01b038216600090815260026020526040812080548392906113839084906120b7565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b03821661142d5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016106ea565b6001600160a01b038216600090815260026020526040902054818110156114a15760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016106ea565b6001600160a01b03831660009081526002602052604081208383039055600480548492906114d09084906120cf565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6115266000826107cb565b61153e6000805160206121de833981519152826107cb565b61094b6000805160206121be833981519152826107cb565b61156160003361080f565b6115796000805160206121de8339815191523361080f565b6109796000805160206121be8339815191523361080f565b61094b6000826107cb565b61097960003361080f565b6000610a8b8383611940565b61094b6000805160206121de833981519152826107cb565b6109796000805160206121de8339815191523361080f565b60006105ae825490565b6001600160a01b03811660009081526007602052604090208054600181018255905b50919050565b60006105ae61162261116c565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006116748787878761196a565b9150915061168181611a57565b5095945050505050565b6000828152602081905260409020600101546116a78133611784565b6107ed83836117e8565b6116bb8282610a92565b610e04576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116f13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600081815260018301602052604081205461177c575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105ae565b5060006105ae565b61178e8282610a92565b610e04576117a6816001600160a01b03166014611c12565b6117b1836020611c12565b6040516020016117c29291906120e6565b60408051601f198184030181529082905262461bcd60e51b82526106ea91600401611e04565b6117f28282610a92565b15610e04576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815260018301602052604081205480156119365760006118716001836120cf565b8554909150600090611885906001906120cf565b90508181146118ea5760008660000182815481106118a5576118a5612070565b90600052602060002001549050808760000184815481106118c8576118c8612070565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806118fb576118fb61215b565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105ae565b60009150506105ae565b600082600001828154811061195757611957612070565b9060005260206000200154905092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156119a15750600090506003611a4e565b8460ff16601b141580156119b957508460ff16601c14155b156119ca5750600090506004611a4e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611a1e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611a4757600060019250925050611a4e565b9150600090505b94509492505050565b6000816004811115611a6b57611a6b612171565b1415611a745750565b6001816004811115611a8857611a88612171565b1415611ad65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106ea565b6002816004811115611aea57611aea612171565b1415611b385760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106ea565b6003816004811115611b4c57611b4c612171565b1415611ba55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016106ea565b6004816004811115611bb957611bb9612171565b141561094b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016106ea565b60606000611c21836002612187565b611c2c9060026120b7565b67ffffffffffffffff811115611c4457611c4461205a565b6040519080825280601f01601f191660200182016040528015611c6e576020820181803683370190505b509050600360fc1b81600081518110611c8957611c89612070565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611cb857611cb8612070565b60200101906001600160f81b031916908160001a9053506000611cdc846002612187565b611ce79060016120b7565b90505b6001811115611d5f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611d1b57611d1b612070565b1a60f81b828281518110611d3157611d31612070565b60200101906001600160f81b031916908160001a90535060049490941c93611d58816121a6565b9050611cea565b508315610a8b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106ea565b600060208284031215611dc057600080fd5b81356001600160e01b031981168114610a8b57600080fd5b60005b83811015611df3578181015183820152602001611ddb565b838111156111405750506000910152565b6020815260008251806020840152611e23816040850160208701611dd8565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611e4e57600080fd5b919050565b60008060408385031215611e6657600080fd5b611e6f83611e37565b946020939093013593505050565b600080600060608486031215611e9257600080fd5b611e9b84611e37565b9250611ea960208501611e37565b9150604084013590509250925092565b600060208284031215611ecb57600080fd5b5035919050565b600060208284031215611ee457600080fd5b610a8b82611e37565b6020808252825182820181905260009190848201906040850190845b81811015611f2e5783516001600160a01b031683529284019291840191600101611f09565b50909695505050505050565b60008060408385031215611f4d57600080fd5b82359150611f5d60208401611e37565b90509250929050565b60008060408385031215611f7957600080fd5b50508035926020909101359150565b600080600080600080600060e0888a031215611fa357600080fd5b611fac88611e37565b9650611fba60208901611e37565b95506040880135945060608801359350608088013560ff81168114611fde57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561200e57600080fd5b61201783611e37565b9150611f5d60208401611e37565b600181811c9082168061203957607f821691505b6020821081141561160f57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156120b0576120b0612086565b5060010190565b600082198211156120ca576120ca612086565b500190565b6000828210156120e1576120e1612086565b500390565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161211e816017850160208801611dd8565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161214f816028840160208801611dd8565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60008160001904831182151516156121a1576121a1612086565b500290565b6000816121b5576121b5612086565b50600019019056fee4b2a1ba12b0ae46fe120e095faea153cf269e4b012b647a52a09f4e0e45f1796e58ad548d72b425ea94c15f453bf26caddb061d82b2551db7fdd3cefe0e9940a26469706673582212205bd92ebc3aa0caf3ec46fefda0772d3f51e41baa88ec198f67059a6ecc7a54c464736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000154a61727669732053796e746865746963204575726f000000000000000000000000000000000000000000000000000000000000000000000000000000000000046a45555200000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : tokenName (string): Jarvis Synthetic Euro
Arg [1] : tokenSymbol (string): jEUR
Arg [2] : tokenDecimals (uint8): 18
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000015
Arg [4] : 4a61727669732053796e746865746963204575726f0000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [6] : 6a45555200000000000000000000000000000000000000000000000000000000
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.