Overview
MNT Balance
More Info
ContractCreator
Multichain Info
Latest 17 from a total of 17 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Check In | 15192921 | 437 days ago | IN | 0 MNT | 0.02296172 | ||||
| Check In | 15066723 | 440 days ago | IN | 0 MNT | 0.01749065 | ||||
| Check In | 15065511 | 440 days ago | IN | 0 MNT | 0.02299131 | ||||
| Grant Role | 15065454 | 440 days ago | IN | 0 MNT | 0.00455492 | ||||
| Check In | 15065030 | 440 days ago | IN | 0 MNT | 0.01731866 | ||||
| Check In | 15065023 | 440 days ago | IN | 0 MNT | 0.01731933 | ||||
| Grant Role | 15059767 | 440 days ago | IN | 0 MNT | 0.00475799 | ||||
| Check In | 14972257 | 442 days ago | IN | 0 MNT | 0.02404677 | ||||
| Check In | 14972252 | 442 days ago | IN | 0 MNT | 0.02403165 | ||||
| Check In | 14972244 | 442 days ago | IN | 0 MNT | 0.02404059 | ||||
| Check In | 14972238 | 442 days ago | IN | 0 MNT | 0.02403385 | ||||
| Check In | 14972230 | 442 days ago | IN | 0 MNT | 0.02404754 | ||||
| Check In | 14972225 | 442 days ago | IN | 0 MNT | 0.02403637 | ||||
| Check In | 14972219 | 442 days ago | IN | 0 MNT | 0.02404614 | ||||
| Check In | 14972214 | 442 days ago | IN | 0 MNT | 0.02404216 | ||||
| Check In | 14972206 | 442 days ago | IN | 0 MNT | 0.02405612 | ||||
| Check In | 14972200 | 442 days ago | IN | 0 MNT | 0.02562219 |
View more zero value Internal Transactions in Advanced View mode
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
contract SignatureCheckIn is AccessControl {
using ECDSA for bytes32;
using EnumerableSet for EnumerableSet.AddressSet;
bytes32 public constant SIGNGER_ROLE = keccak256("SIGNGER_ROLE");
string public constant CHECK_IN_PREFIX = "CHECK_IN";
struct CheckinRecord {
address user;
uint256 timestamp;
bytes signature;
}
EnumerableSet.AddressSet private _users;
mapping(address => CheckinRecord[]) private _checkinRecords;
mapping(bytes32 => bool) private _isSignatureUsed;
event Checkin(address indexed user, uint256 timestamp, bytes signature);
constructor() {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(SIGNGER_ROLE, _msgSender());
}
function checkIn(
address _user,
uint256 _nonce,
bytes memory _signature
) public {
bytes32 messageHash = keccak256(
abi.encodePacked(
block.chainid,
address(this),
CHECK_IN_PREFIX,
_user,
_nonce
)
);
require(
!_isSignatureUsed[messageHash],
"SignatureCheckin: signature already used"
);
address signer = messageHash.toEthSignedMessageHash().recover(
_signature
);
require(
hasRole(SIGNGER_ROLE, signer),
"SignatureCheckin: invalid signature"
);
_isSignatureUsed[messageHash] = true;
_users.add(_user);
_checkinRecords[_user].push(
CheckinRecord(_user, block.timestamp, _signature)
);
emit Checkin(_user, block.timestamp, _signature);
}
function getUsersCount() external view returns (uint256) {
return _users.length();
}
function getCheckInRecordsCount(
address _user
) external view returns (uint256) {
return _checkinRecords[_user].length;
}
function getCheckInRecords(
address _user,
uint256 _offset,
uint256 _limit
) external view returns (CheckinRecord[] memory) {
if (!_users.contains(_user)) {
return new CheckinRecord[](0);
}
if (_offset >= _checkinRecords[_user].length) {
return new CheckinRecord[](0);
}
if (_offset + _limit > _checkinRecords[_user].length) {
_limit = _checkinRecords[_user].length - _offset;
}
CheckinRecord[] memory records = new CheckinRecord[](_limit);
for (uint256 i = 0; i < _limit; i++) {
records[i] = _checkinRecords[_user][_offset + i];
}
return records;
}
function getUsers(
uint256 _offset,
uint256 _limit
) external view returns (address[] memory) {
if (_offset >= _users.length()) {
return new address[](0);
}
if (_offset + _limit > _users.length()) {
_limit = _users.length() - _offset;
}
address[] memory users = new address[](_limit);
for (uint256 i = 0; i < _limit; i++) {
users[i] = _users.at(_offset + i);
}
return users;
}
}// 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;
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 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: 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);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"}],"name":"Checkin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"CHECK_IN_PREFIX","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"checkIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getCheckInRecords","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SignatureCheckIn.CheckinRecord[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getCheckInRecordsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getUsers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUsersCount","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":"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"}]Contract Creation Code
608060405234801561001057600080fd5b5061001c60003361004b565b6100467f71030834d9e42aff06f810d87dabf826d419f50e4022e5cbf505979c6e4a050d3361004b565b6100f7565b6100558282610059565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610055576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556100b33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61176a80620001076000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806391d148541161008c578063a4a1e26311610066578063a4a1e2631461020e578063af7d667314610216578063d547741f1461024a578063e749f4e91461025d57600080fd5b806391d14854146101ca5780639e016b86146101dd578063a217fddf1461020657600080fd5b80632f2ff15d116100c85780632f2ff15d1461016f57806336568abe1461018457806345982a6614610197578063759dc60c146101b757600080fd5b806301ffc9a7146100ef57806307c7c90f14610117578063248a9ca31461014c575b600080fd5b6101026100fd36600461113c565b61027d565b60405190151581526020015b60405180910390f35b61013e7f71030834d9e42aff06f810d87dabf826d419f50e4022e5cbf505979c6e4a050d81565b60405190815260200161010e565b61013e61015a366004611166565b60009081526020819052604090206001015490565b61018261017d36600461119b565b6102b4565b005b61018261019236600461119b565b6102df565b6101aa6101a53660046111c7565b610362565b60405161010e91906111e9565b6101826101c536600461124c565b610466565b6101026101d836600461119b565b610700565b61013e6101eb366004611317565b6001600160a01b031660009081526003602052604090205490565b61013e600081565b61013e610729565b61023d6040518060400160405280600881526020016721a422a1a5afa4a760c11b81525081565b60405161010e9190611382565b61018261025836600461119b565b61073a565b61027061026b366004611395565b610760565b60405161010e91906113c8565b60006001600160e01b03198216637965db0b60e01b14806102ae57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102d08133610a04565b6102da8383610a68565b505050565b6001600160a01b03811633146103545760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61035e8282610aec565b5050565b606061036e6001610b51565b831061038957506040805160008152602081019091526102ae565b6103936001610b51565b61039d8385611466565b11156103bb57826103ae6001610b51565b6103b89190611479565b91505b60008267ffffffffffffffff8111156103d6576103d6611236565b6040519080825280602002602001820160405280156103ff578160200160208202803683370190505b50905060005b8381101561045e5761042261041a8287611466565b600190610b5b565b8282815181106104345761043461148c565b6001600160a01b039092166020928302919091019091015280610456816114a2565b915050610405565b509392505050565b600046306040518060400160405280600881526020016721a422a1a5afa4a760c11b81525086866040516020016104a19594939291906114bb565b60408051601f1981840301815291815281516020928301206000818152600490935291205490915060ff161561052a5760405162461bcd60e51b815260206004820152602860248201527f5369676e6174757265436865636b696e3a207369676e617475726520616c726560448201526718591e481d5cd95960c21b606482015260840161034b565b600061058d83610587846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610b67565b90506105b97f71030834d9e42aff06f810d87dabf826d419f50e4022e5cbf505979c6e4a050d82610700565b6106115760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b696e3a20696e76616c6964207369676e617460448201526275726560e81b606482015260840161034b565b6000828152600460205260409020805460ff191660019081179091556106379086610b83565b506001600160a01b0385811660008181526003602081815260408084208151606081018352958652428684019081529186018a81528154600180820184559287529390952086519390940290930180546001600160a01b0319169290961691909117855551908401555190919060028201906106b3908261159a565b505050846001600160a01b03167f47923b1e63f425e22e97ebb68602690dc51ae2dc9984f25d550e543206e448a642856040516106f192919061165a565b60405180910390a25050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006107356001610b51565b905090565b6000828152602081905260409020600101546107568133610a04565b6102da8383610aec565b606061076d600185610b98565b6107aa5760408051600080825260208201909252906107a2565b61078f611112565b8152602001906001900390816107875790505b5090506109fd565b6001600160a01b03841660009081526003602052604090205483106108015760408051600080825260208201909252906107a2565b6107e7611112565b8152602001906001900390816107df5790505090506109fd565b6001600160a01b0384166000908152600360205260409020546108248385611466565b1115610851576001600160a01b03841660009081526003602052604090205461084e908490611479565b91505b60008267ffffffffffffffff81111561086c5761086c611236565b6040519080825280602002602001820160405280156108a557816020015b610892611112565b81526020019060019003908161088a5790505b50905060005b838110156109f9576001600160a01b03861660009081526003602052604090206108d58287611466565b815481106108e5576108e561148c565b90600052602060002090600302016040518060600160405290816000820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020016001820154815260200160028201805461094790611512565b80601f016020809104026020016040519081016040528092919081815260200182805461097390611512565b80156109c05780601f10610995576101008083540402835291602001916109c0565b820191906000526020600020905b8154815290600101906020018083116109a357829003601f168201915b5050505050815250508282815181106109db576109db61148c565b602002602001018190525080806109f1906114a2565b9150506108ab565b5090505b9392505050565b610a0e8282610700565b61035e57610a26816001600160a01b03166014610bba565b610a31836020610bba565b604051602001610a4292919061167b565b60408051601f198184030181529082905262461bcd60e51b825261034b91600401611382565b610a728282610700565b61035e576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610aa83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610af68282610700565b1561035e576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006102ae825490565b60006109fd8383610d56565b6000806000610b768585610d80565b9150915061045e81610dee565b60006109fd836001600160a01b038416610fa7565b6001600160a01b038116600090815260018301602052604081205415156109fd565b60606000610bc98360026116f0565b610bd4906002611466565b67ffffffffffffffff811115610bec57610bec611236565b6040519080825280601f01601f191660200182016040528015610c16576020820181803683370190505b509050600360fc1b81600081518110610c3157610c3161148c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610c6057610c6061148c565b60200101906001600160f81b031916908160001a9053506000610c848460026116f0565b610c8f906001611466565b90505b6001811115610d07576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610cc357610cc361148c565b1a60f81b828281518110610cd957610cd961148c565b60200101906001600160f81b031916908160001a90535060049490941c93610d0081611707565b9050610c92565b5083156109fd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034b565b6000826000018281548110610d6d57610d6d61148c565b9060005260206000200154905092915050565b6000808251604103610db65760208301516040840151606085015160001a610daa87828585610ff6565b94509450505050610de7565b8251604003610ddf5760208301516040840151610dd48683836110e3565b935093505050610de7565b506000905060025b9250929050565b6000816004811115610e0257610e0261171e565b03610e0a5750565b6001816004811115610e1e57610e1e61171e565b03610e6b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161034b565b6002816004811115610e7f57610e7f61171e565b03610ecc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161034b565b6003816004811115610ee057610ee061171e565b03610f385760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161034b565b6004816004811115610f4c57610f4c61171e565b03610fa45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161034b565b50565b6000818152600183016020526040812054610fee575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102ae565b5060006102ae565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561102d57506000905060036110da565b8460ff16601b1415801561104557508460ff16601c14155b1561105657506000905060046110da565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156110aa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110d3576000600192509250506110da565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161110487828885610ff6565b935093505050935093915050565b604051806060016040528060006001600160a01b0316815260200160008152602001606081525090565b60006020828403121561114e57600080fd5b81356001600160e01b0319811681146109fd57600080fd5b60006020828403121561117857600080fd5b5035919050565b80356001600160a01b038116811461119657600080fd5b919050565b600080604083850312156111ae57600080fd5b823591506111be6020840161117f565b90509250929050565b600080604083850312156111da57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b8181101561122a5783516001600160a01b031683529284019291840191600101611205565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561126157600080fd5b61126a8461117f565b925060208401359150604084013567ffffffffffffffff8082111561128e57600080fd5b818601915086601f8301126112a257600080fd5b8135818111156112b4576112b4611236565b604051601f8201601f19908116603f011681019083821181831017156112dc576112dc611236565b816040528281528960208487010111156112f557600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561132957600080fd5b6109fd8261117f565b60005b8381101561134d578181015183820152602001611335565b50506000910152565b6000815180845261136e816020860160208601611332565b601f01601f19169290920160200192915050565b6020815260006109fd6020830184611356565b6000806000606084860312156113aa57600080fd5b6113b38461117f565b95602085013595506040909401359392505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561144257888303603f19018552815180516001600160a01b031684528781015188850152860151606087850181905261142e81860183611356565b9689019694505050908601906001016113ef565b509098975050505050505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102ae576102ae611450565b818103818111156102ae576102ae611450565b634e487b7160e01b600052603260045260246000fd5b6000600182016114b4576114b4611450565b5060010190565b85815260006bffffffffffffffffffffffff19808760601b16602084015285516114ec816034860160208a01611332565b60609590951b169190930160348101919091526048810191909152606801949350505050565b600181811c9082168061152657607f821691505b60208210810361154657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102da57600081815260208120601f850160051c810160208610156115735750805b601f850160051c820191505b818110156115925782815560010161157f565b505050505050565b815167ffffffffffffffff8111156115b4576115b4611236565b6115c8816115c28454611512565b8461154c565b602080601f8311600181146115fd57600084156115e55750858301515b600019600386901b1c1916600185901b178555611592565b600085815260208120601f198616915b8281101561162c5788860151825594840194600190910190840161160d565b508582101561164a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8281526040602082015260006116736040830184611356565b949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516116b3816017850160208801611332565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516116e4816028840160208801611332565b01602801949350505050565b80820281158282048414176102ae576102ae611450565b60008161171657611716611450565b506000190190565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220e3ca76b27ce0b9487dab141e9eebc85d75f1b7af7ba6e58e3f1b590e6f361b7a64736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806391d148541161008c578063a4a1e26311610066578063a4a1e2631461020e578063af7d667314610216578063d547741f1461024a578063e749f4e91461025d57600080fd5b806391d14854146101ca5780639e016b86146101dd578063a217fddf1461020657600080fd5b80632f2ff15d116100c85780632f2ff15d1461016f57806336568abe1461018457806345982a6614610197578063759dc60c146101b757600080fd5b806301ffc9a7146100ef57806307c7c90f14610117578063248a9ca31461014c575b600080fd5b6101026100fd36600461113c565b61027d565b60405190151581526020015b60405180910390f35b61013e7f71030834d9e42aff06f810d87dabf826d419f50e4022e5cbf505979c6e4a050d81565b60405190815260200161010e565b61013e61015a366004611166565b60009081526020819052604090206001015490565b61018261017d36600461119b565b6102b4565b005b61018261019236600461119b565b6102df565b6101aa6101a53660046111c7565b610362565b60405161010e91906111e9565b6101826101c536600461124c565b610466565b6101026101d836600461119b565b610700565b61013e6101eb366004611317565b6001600160a01b031660009081526003602052604090205490565b61013e600081565b61013e610729565b61023d6040518060400160405280600881526020016721a422a1a5afa4a760c11b81525081565b60405161010e9190611382565b61018261025836600461119b565b61073a565b61027061026b366004611395565b610760565b60405161010e91906113c8565b60006001600160e01b03198216637965db0b60e01b14806102ae57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102d08133610a04565b6102da8383610a68565b505050565b6001600160a01b03811633146103545760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61035e8282610aec565b5050565b606061036e6001610b51565b831061038957506040805160008152602081019091526102ae565b6103936001610b51565b61039d8385611466565b11156103bb57826103ae6001610b51565b6103b89190611479565b91505b60008267ffffffffffffffff8111156103d6576103d6611236565b6040519080825280602002602001820160405280156103ff578160200160208202803683370190505b50905060005b8381101561045e5761042261041a8287611466565b600190610b5b565b8282815181106104345761043461148c565b6001600160a01b039092166020928302919091019091015280610456816114a2565b915050610405565b509392505050565b600046306040518060400160405280600881526020016721a422a1a5afa4a760c11b81525086866040516020016104a19594939291906114bb565b60408051601f1981840301815291815281516020928301206000818152600490935291205490915060ff161561052a5760405162461bcd60e51b815260206004820152602860248201527f5369676e6174757265436865636b696e3a207369676e617475726520616c726560448201526718591e481d5cd95960c21b606482015260840161034b565b600061058d83610587846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610b67565b90506105b97f71030834d9e42aff06f810d87dabf826d419f50e4022e5cbf505979c6e4a050d82610700565b6106115760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b696e3a20696e76616c6964207369676e617460448201526275726560e81b606482015260840161034b565b6000828152600460205260409020805460ff191660019081179091556106379086610b83565b506001600160a01b0385811660008181526003602081815260408084208151606081018352958652428684019081529186018a81528154600180820184559287529390952086519390940290930180546001600160a01b0319169290961691909117855551908401555190919060028201906106b3908261159a565b505050846001600160a01b03167f47923b1e63f425e22e97ebb68602690dc51ae2dc9984f25d550e543206e448a642856040516106f192919061165a565b60405180910390a25050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006107356001610b51565b905090565b6000828152602081905260409020600101546107568133610a04565b6102da8383610aec565b606061076d600185610b98565b6107aa5760408051600080825260208201909252906107a2565b61078f611112565b8152602001906001900390816107875790505b5090506109fd565b6001600160a01b03841660009081526003602052604090205483106108015760408051600080825260208201909252906107a2565b6107e7611112565b8152602001906001900390816107df5790505090506109fd565b6001600160a01b0384166000908152600360205260409020546108248385611466565b1115610851576001600160a01b03841660009081526003602052604090205461084e908490611479565b91505b60008267ffffffffffffffff81111561086c5761086c611236565b6040519080825280602002602001820160405280156108a557816020015b610892611112565b81526020019060019003908161088a5790505b50905060005b838110156109f9576001600160a01b03861660009081526003602052604090206108d58287611466565b815481106108e5576108e561148c565b90600052602060002090600302016040518060600160405290816000820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020016001820154815260200160028201805461094790611512565b80601f016020809104026020016040519081016040528092919081815260200182805461097390611512565b80156109c05780601f10610995576101008083540402835291602001916109c0565b820191906000526020600020905b8154815290600101906020018083116109a357829003601f168201915b5050505050815250508282815181106109db576109db61148c565b602002602001018190525080806109f1906114a2565b9150506108ab565b5090505b9392505050565b610a0e8282610700565b61035e57610a26816001600160a01b03166014610bba565b610a31836020610bba565b604051602001610a4292919061167b565b60408051601f198184030181529082905262461bcd60e51b825261034b91600401611382565b610a728282610700565b61035e576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610aa83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610af68282610700565b1561035e576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006102ae825490565b60006109fd8383610d56565b6000806000610b768585610d80565b9150915061045e81610dee565b60006109fd836001600160a01b038416610fa7565b6001600160a01b038116600090815260018301602052604081205415156109fd565b60606000610bc98360026116f0565b610bd4906002611466565b67ffffffffffffffff811115610bec57610bec611236565b6040519080825280601f01601f191660200182016040528015610c16576020820181803683370190505b509050600360fc1b81600081518110610c3157610c3161148c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610c6057610c6061148c565b60200101906001600160f81b031916908160001a9053506000610c848460026116f0565b610c8f906001611466565b90505b6001811115610d07576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610cc357610cc361148c565b1a60f81b828281518110610cd957610cd961148c565b60200101906001600160f81b031916908160001a90535060049490941c93610d0081611707565b9050610c92565b5083156109fd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034b565b6000826000018281548110610d6d57610d6d61148c565b9060005260206000200154905092915050565b6000808251604103610db65760208301516040840151606085015160001a610daa87828585610ff6565b94509450505050610de7565b8251604003610ddf5760208301516040840151610dd48683836110e3565b935093505050610de7565b506000905060025b9250929050565b6000816004811115610e0257610e0261171e565b03610e0a5750565b6001816004811115610e1e57610e1e61171e565b03610e6b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161034b565b6002816004811115610e7f57610e7f61171e565b03610ecc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161034b565b6003816004811115610ee057610ee061171e565b03610f385760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161034b565b6004816004811115610f4c57610f4c61171e565b03610fa45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161034b565b50565b6000818152600183016020526040812054610fee575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102ae565b5060006102ae565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561102d57506000905060036110da565b8460ff16601b1415801561104557508460ff16601c14155b1561105657506000905060046110da565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156110aa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110d3576000600192509250506110da565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161110487828885610ff6565b935093505050935093915050565b604051806060016040528060006001600160a01b0316815260200160008152602001606081525090565b60006020828403121561114e57600080fd5b81356001600160e01b0319811681146109fd57600080fd5b60006020828403121561117857600080fd5b5035919050565b80356001600160a01b038116811461119657600080fd5b919050565b600080604083850312156111ae57600080fd5b823591506111be6020840161117f565b90509250929050565b600080604083850312156111da57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b8181101561122a5783516001600160a01b031683529284019291840191600101611205565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561126157600080fd5b61126a8461117f565b925060208401359150604084013567ffffffffffffffff8082111561128e57600080fd5b818601915086601f8301126112a257600080fd5b8135818111156112b4576112b4611236565b604051601f8201601f19908116603f011681019083821181831017156112dc576112dc611236565b816040528281528960208487010111156112f557600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561132957600080fd5b6109fd8261117f565b60005b8381101561134d578181015183820152602001611335565b50506000910152565b6000815180845261136e816020860160208601611332565b601f01601f19169290920160200192915050565b6020815260006109fd6020830184611356565b6000806000606084860312156113aa57600080fd5b6113b38461117f565b95602085013595506040909401359392505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561144257888303603f19018552815180516001600160a01b031684528781015188850152860151606087850181905261142e81860183611356565b9689019694505050908601906001016113ef565b509098975050505050505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102ae576102ae611450565b818103818111156102ae576102ae611450565b634e487b7160e01b600052603260045260246000fd5b6000600182016114b4576114b4611450565b5060010190565b85815260006bffffffffffffffffffffffff19808760601b16602084015285516114ec816034860160208a01611332565b60609590951b169190930160348101919091526048810191909152606801949350505050565b600181811c9082168061152657607f821691505b60208210810361154657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102da57600081815260208120601f850160051c810160208610156115735750805b601f850160051c820191505b818110156115925782815560010161157f565b505050505050565b815167ffffffffffffffff8111156115b4576115b4611236565b6115c8816115c28454611512565b8461154c565b602080601f8311600181146115fd57600084156115e55750858301515b600019600386901b1c1916600185901b178555611592565b600085815260208120601f198616915b8281101561162c5788860151825594840194600190910190840161160d565b508582101561164a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8281526040602082015260006116736040830184611356565b949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516116b3816017850160208801611332565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516116e4816028840160208801611332565b01602801949350505050565b80820281158282048414176102ae576102ae611450565b60008161171657611716611450565b506000190190565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220e3ca76b27ce0b9487dab141e9eebc85d75f1b7af7ba6e58e3f1b590e6f361b7a64736f6c63430008110033
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.