Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- DuelRecords
- Optimization enabled
- false
- Compiler version
- v0.8.28+commit.7893614a
- EVM Version
- Verified at
- 2026-09-18T22:50:30.883239Z
Constructor Arguments
DuelRecords.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
/// @title DuelRecords ā a ranked duel's result, once both sides have agreed to it, or witnesses have.
/// @notice A town keeps its duel results itself. Putting one here is optional, and it takes
/// both sides: somebody from one team sends the transaction and pays for it, and it
/// carries a signature from somebody on the OTHER team saying the result is right.
/// Nobody can write down a win the losers did not sign for, and nobody can write down
/// a loss the winners did not sign for.
///
/// That is consensus between the players, not proof. The chain cannot see a fight --
/// whether a blow landed is decided by two players' positions at one instant, which
/// only the server holding both can judge -- so what this records is that both sides
/// agreed on what happened. Nothing of value rides on it, and that is why agreement
/// is enough.
///
/// @dev The signature is EIP-712 over `Result`, so a wallet shows the signer every field
/// before they sign, and a signature for this contract on this chain cannot be
/// replayed against any other.
///
/// Each id is recorded once. `kills` counts every recorded kill per address, which is
/// what a leaderboard ranks by: a win in a match to one and a win in a match to
/// twenty-five are not the same thing, and a kill is a kill. `wins` and `losses` are
/// kept beside it for anyone who wants them.
///
/// WITNESSED is the other way in, and it is kept apart on purpose. When one side will not
/// agree, the town asks the bystanders who were there, and a result they signed can be
/// recorded with their signatures instead. The chain cannot tell a bystander from a
/// spare wallet of the winner's -- only the town that asked them can -- so a witnessed
/// result never touches `kills`, `wins` or `losses`. It lands in `witnessedOf` and its own
/// `witnessed*` counts, and anybody reading them can decide what a witness is worth. The
/// agreed ledger stays one that nobody can write alone.
///
/// Ownerless: no admin, no pause, no upgrade, no privileged address.
contract DuelRecords is EIP712 {
bytes32 public constant RESULT_TYPEHASH = keccak256(
"Result(bytes32 id,address[] teamA,address[] teamB,uint16[] killsA,uint16[] killsB,uint16 limit,uint8 winner,uint64 endedAt)"
);
/// @notice The EIP-712 struct hash of what was recorded under an id; zero if nothing was.
mapping(bytes32 => bytes32) public recordOf;
mapping(address => uint32) public kills;
mapping(address => uint32) public wins;
mapping(address => uint32) public losses;
/// @notice Results recorded on witnesses' signatures instead of the other side's, kept apart.
mapping(bytes32 => bytes32) public witnessedOf;
mapping(address => uint32) public witnessedKills;
mapping(address => uint32) public witnessedWins;
mapping(address => uint32) public witnessedLosses;
uint256 public constant MAX_TEAM = 4;
uint256 public constant MAX_WITNESSES = 16;
event Recorded(
bytes32 indexed id,
address[] teamA,
address[] teamB,
uint16[] killsA,
uint16[] killsB,
uint16 limit,
uint8 winner,
uint64 endedAt,
address submittedBy,
address signedBy
);
event Witnessed(
bytes32 indexed id,
address[] teamA,
address[] teamB,
uint16[] killsA,
uint16[] killsB,
uint16 limit,
uint8 winner,
uint64 endedAt,
address submittedBy,
address[] witnesses
);
// The name below is not this project's name: an EIP-712 domain is part of the digest, so it
// is part of the deployed interface. This contract is on chain with that string inside it and
// every signature already made was made against it. It changes on a redeploy and not before.
constructor() EIP712("PulseBlockz Duels", "1") {}
/// @notice Whether an id has been recorded.
function recorded(bytes32 id) external view returns (bool) {
return recordOf[id] != bytes32(0);
}
/// @notice The digest the other side signs, for anyone checking a signature off chain.
function digest(
bytes32 id,
address[] memory teamA,
address[] memory teamB,
uint16[] memory killsA,
uint16[] memory killsB,
uint16 limit,
uint8 winner,
uint64 endedAt
) public view returns (bytes32) {
return _hashTypedDataV4(_structHash(id, teamA, teamB, killsA, killsB, limit, winner, endedAt));
}
/// @notice Who signed a result -- zero for a signature that is not one. For a town checking a
/// signature it was handed before keeping it, with a read and no key.
function signerOf(
bytes32 id,
address[] memory teamA,
address[] memory teamB,
uint16[] memory killsA,
uint16[] memory killsB,
uint16 limit,
uint8 winner,
uint64 endedAt,
bytes memory signature
) external view returns (address) {
(address who, ECDSA.RecoverError err, ) =
ECDSA.tryRecover(digest(id, teamA, teamB, killsA, killsB, limit, winner, endedAt), signature);
return err == ECDSA.RecoverError.NoError ? who : address(0);
}
/// @notice Record a result. Sent by somebody on one team, signed by somebody on the other.
/// @param killsA each of team A's kills, in the same order as teamA; a team's frags are the sum.
/// @param winner 1 for team A, 2 for team B. Said outright rather than worked out from the
/// kills, because a duel somebody walked out of is won short of the limit.
function record(
bytes32 id,
address[] memory teamA,
address[] memory teamB,
uint16[] memory killsA,
uint16[] memory killsB,
uint16 limit,
uint8 winner,
uint64 endedAt,
bytes memory signature
) external {
require(recordOf[id] == bytes32(0), "already recorded");
_valid(id, teamA, teamB, killsA, killsB, limit, winner);
bytes32 structHash = _structHash(id, teamA, teamB, killsA, killsB, limit, winner, endedAt);
address signer = _agreed(teamA, teamB, structHash, signature);
recordOf[id] = structHash;
_tally(teamA, killsA, winner == 1, false);
_tally(teamB, killsB, winner == 2, false);
emit Recorded(id, teamA, teamB, killsA, killsB, limit, winner, endedAt, msg.sender, signer);
}
/// @notice Record a result on witnesses' signatures, when one side would not agree. Sent by
/// somebody in the duel; every signature from somebody in neither team, each once.
/// Counted apart from agreed results -- see the contract's notes.
function recordWitnessed(
bytes32 id,
address[] memory teamA,
address[] memory teamB,
uint16[] memory killsA,
uint16[] memory killsB,
uint16 limit,
uint8 winner,
uint64 endedAt,
bytes[] memory signatures
) external {
require(recordOf[id] == bytes32(0), "already agreed and recorded");
require(witnessedOf[id] == bytes32(0), "already witnessed");
_valid(id, teamA, teamB, killsA, killsB, limit, winner);
require(_has(teamA, msg.sender) || _has(teamB, msg.sender), "sender is not in this duel");
bytes32 structHash = _structHash(id, teamA, teamB, killsA, killsB, limit, winner, endedAt);
address[] memory witnesses = _witnesses(teamA, teamB, structHash, signatures);
witnessedOf[id] = structHash;
_tally(teamA, killsA, winner == 1, true);
_tally(teamB, killsB, winner == 2, true);
emit Witnessed(id, teamA, teamB, killsA, killsB, limit, winner, endedAt, msg.sender, witnesses);
}
function _valid(
bytes32 id,
address[] memory teamA,
address[] memory teamB,
uint16[] memory killsA,
uint16[] memory killsB,
uint16 limit,
uint8 winner
) internal pure {
require(id != bytes32(0), "no id");
require(teamA.length > 0 && teamA.length <= MAX_TEAM, "team A size");
require(teamB.length > 0 && teamB.length <= MAX_TEAM, "team B size");
require(killsA.length == teamA.length && killsB.length == teamB.length, "a kill count for each player");
require(winner == 1 || winner == 2, "winner is 1 or 2");
require(limit > 0 && _sum(killsA) <= limit && _sum(killsB) <= limit, "frags past the limit");
_distinct(teamA, teamB);
}
/// @dev Every signature recovers to somebody in neither team, and nobody signs twice.
function _witnesses(address[] memory teamA, address[] memory teamB, bytes32 structHash, bytes[] memory signatures)
internal
view
returns (address[] memory out)
{
require(signatures.length > 0 && signatures.length <= MAX_WITNESSES, "witness count");
bytes32 digestHash = _hashTypedDataV4(structHash);
out = new address[](signatures.length);
for (uint256 i = 0; i < signatures.length; i++) {
address who = ECDSA.recover(digestHash, signatures[i]);
require(!_has(teamA, who) && !_has(teamB, who), "a witness was in the duel");
for (uint256 j = 0; j < i; j++) require(out[j] != who, "a witness signed twice");
out[i] = who;
}
}
/// @dev The sender is on one team and the signature is from somebody on the other.
function _agreed(address[] memory teamA, address[] memory teamB, bytes32 structHash, bytes memory signature)
internal
view
returns (address signer)
{
signer = ECDSA.recover(_hashTypedDataV4(structHash), signature);
bool senderA = _has(teamA, msg.sender);
require(senderA || _has(teamB, msg.sender), "sender is not in this duel");
require(senderA ? _has(teamB, signer) : _has(teamA, signer), "needs a signature from the other team");
}
function _tally(address[] memory team, uint16[] memory teamKills, bool won, bool witnessed) internal {
for (uint256 i = 0; i < team.length; i++) {
if (witnessed) {
witnessedKills[team[i]] += teamKills[i];
if (won) witnessedWins[team[i]] += 1;
else witnessedLosses[team[i]] += 1;
} else {
kills[team[i]] += teamKills[i];
if (won) wins[team[i]] += 1;
else losses[team[i]] += 1;
}
}
}
function _sum(uint16[] memory list) internal pure returns (uint256 total) {
for (uint256 i = 0; i < list.length; i++) total += list[i];
}
function _structHash(
bytes32 id,
address[] memory teamA,
address[] memory teamB,
uint16[] memory killsA,
uint16[] memory killsB,
uint16 limit,
uint8 winner,
uint64 endedAt
) internal pure returns (bytes32) {
// EIP-712 encodes an array as the hash of its elements' 32-byte encodings, which is
// exactly what encodePacked does with an address[] or a uint16[].
return keccak256(
abi.encode(
RESULT_TYPEHASH,
id,
keccak256(abi.encodePacked(teamA)),
keccak256(abi.encodePacked(teamB)),
keccak256(abi.encodePacked(killsA)),
keccak256(abi.encodePacked(killsB)),
limit,
winner,
endedAt
)
);
}
function _has(address[] memory list, address who) internal pure returns (bool) {
for (uint256 i = 0; i < list.length; i++) if (list[i] == who) return true;
return false;
}
/// @dev Nobody on both sides, and nobody twice: a player cannot sign for the team they
/// are sending from by also being listed on the other one.
function _distinct(address[] memory a, address[] memory b) internal pure {
for (uint256 i = 0; i < a.length; i++) {
require(a[i] != address(0), "zero address");
for (uint256 j = i + 1; j < a.length; j++) require(a[i] != a[j], "listed twice");
for (uint256 j = 0; j < b.length; j++) require(a[i] != b[j], "on both teams");
}
for (uint256 i = 0; i < b.length; i++) {
require(b[i] != address(0), "zero address");
for (uint256 j = i + 1; j < b.length; j++) require(b[i] != b[j], "listed twice");
}
}
}
@openzeppelin/contracts/interfaces/IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)
pragma solidity ^0.8.20;
interface IERC5267 {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}
@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)
pragma solidity ^0.8.20;
import {Strings} from "../Strings.sol";
/**
* @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
*
* The library provides methods for generating a hash of a message that conforms to the
* https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing a bytes32 `messageHash` with
* `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
* keccak256, although any bytes32 value can be safely used because the final digest will
* be re-hashed.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing an arbitrary `message` with
* `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x00` (data with intended validator).
*
* The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
* `validator` address. Then hashing the result.
*
* See {ECDSA-recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(hex"19_00", validator, data));
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
*
* The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
* `\x19\x01` and hashing the result. It corresponds to the hash signed by the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
*
* See {ECDSA-recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, hex"19_01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
digest := keccak256(ptr, 0x42)
}
}
}
@openzeppelin/contracts/utils/ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
// | length | 0x BB |
type ShortString is bytes32;
/**
* @dev This library provides functions to convert short memory strings
* into a `ShortString` type that can be used as an immutable variable.
*
* Strings of arbitrary length can be optimized using this library if
* they are short enough (up to 31 bytes) by packing them with their
* length (1 byte) in a single EVM word (32 bytes). Additionally, a
* fallback mechanism can be used for every other case.
*
* Usage example:
*
* ```solidity
* contract Named {
* using ShortStrings for *;
*
* ShortString private immutable _name;
* string private _nameFallback;
*
* constructor(string memory contractName) {
* _name = contractName.toShortStringWithFallback(_nameFallback);
* }
*
* function name() external view returns (string memory) {
* return _name.toStringWithFallback(_nameFallback);
* }
* }
* ```
*/
library ShortStrings {
// Used as an identifier for strings longer than 31 bytes.
bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;
error StringTooLong(string str);
error InvalidShortString();
/**
* @dev Encode a string of at most 31 chars into a `ShortString`.
*
* This will trigger a `StringTooLong` error is the input string is too long.
*/
function toShortString(string memory str) internal pure returns (ShortString) {
bytes memory bstr = bytes(str);
if (bstr.length > 31) {
revert StringTooLong(str);
}
return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
}
/**
* @dev Decode a `ShortString` back to a "normal" string.
*/
function toString(ShortString sstr) internal pure returns (string memory) {
uint256 len = byteLength(sstr);
// using `new string(len)` would work locally but is not memory safe.
string memory str = new string(32);
/// @solidity memory-safe-assembly
assembly {
mstore(str, len)
mstore(add(str, 0x20), sstr)
}
return str;
}
/**
* @dev Return the length of a `ShortString`.
*/
function byteLength(ShortString sstr) internal pure returns (uint256) {
uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
if (result > 31) {
revert InvalidShortString();
}
return result;
}
/**
* @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
*/
function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
if (bytes(value).length < 32) {
return toShortString(value);
} else {
StorageSlot.getStringSlot(store).value = value;
return ShortString.wrap(FALLBACK_SENTINEL);
}
}
/**
* @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
*/
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return toString(value);
} else {
return store;
}
}
/**
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using
* {setWithFallback}.
*
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
*/
function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return byteLength(value);
} else {
return bytes(store).length;
}
}
}
@openzeppelin/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
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_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}
@openzeppelin/contracts/utils/math/SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
@openzeppelin/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// ā `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// ā `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}
@openzeppelin/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}
@openzeppelin/contracts/utils/cryptography/ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @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
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-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]
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
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.
/// @solidity memory-safe-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 {
return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
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]
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
// 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, s);
}
// 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, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @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, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}
@openzeppelin/contracts/utils/cryptography/EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.20;
import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
* encoding is very generic and therefore its 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 order to
* produce the hash of their typed data 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].
*
* NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
* separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
* separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
*
* @custom:oz-upgrades-unsafe-allow state-variable-immutable
*/
abstract contract EIP712 is IERC5267 {
using ShortStrings for *;
bytes32 private constant TYPE_HASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
// 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 _cachedDomainSeparator;
uint256 private immutable _cachedChainId;
address private immutable _cachedThis;
bytes32 private immutable _hashedName;
bytes32 private immutable _hashedVersion;
ShortString private immutable _name;
ShortString private immutable _version;
string private _nameFallback;
string private _versionFallback;
/**
* @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) {
_name = name.toShortStringWithFallback(_nameFallback);
_version = version.toShortStringWithFallback(_versionFallback);
_hashedName = keccak256(bytes(name));
_hashedVersion = keccak256(bytes(version));
_cachedChainId = block.chainid;
_cachedDomainSeparator = _buildDomainSeparator();
_cachedThis = address(this);
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
return _cachedDomainSeparator;
} else {
return _buildDomainSeparator();
}
}
function _buildDomainSeparator() private view returns (bytes32) {
return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, 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 MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev See {IERC-5267}.
*/
function eip712Domain()
public
view
virtual
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
)
{
return (
hex"0f", // 01111
_EIP712Name(),
_EIP712Version(),
block.chainid,
address(this),
bytes32(0),
new uint256[](0)
);
}
/**
* @dev The name parameter for the EIP712 domain.
*
* NOTE: By default this function reads _name which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Name() internal view returns (string memory) {
return _name.toStringWithFallback(_nameFallback);
}
/**
* @dev The version parameter for the EIP712 domain.
*
* NOTE: By default this function reads _version which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Version() internal view returns (string memory) {
return _version.toStringWithFallback(_versionFallback);
}
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","metadata"]}},"optimizer":{"runs":200,"enabled":true},"evmVersion":"shanghai"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"ECDSAInvalidSignature","inputs":[]},{"type":"error","name":"ECDSAInvalidSignatureLength","inputs":[{"type":"uint256","name":"length","internalType":"uint256"}]},{"type":"error","name":"ECDSAInvalidSignatureS","inputs":[{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"error","name":"InvalidShortString","inputs":[]},{"type":"error","name":"StringTooLong","inputs":[{"type":"string","name":"str","internalType":"string"}]},{"type":"event","name":"EIP712DomainChanged","inputs":[],"anonymous":false},{"type":"event","name":"Recorded","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32","indexed":true},{"type":"address[]","name":"teamA","internalType":"address[]","indexed":false},{"type":"address[]","name":"teamB","internalType":"address[]","indexed":false},{"type":"uint16[]","name":"killsA","internalType":"uint16[]","indexed":false},{"type":"uint16[]","name":"killsB","internalType":"uint16[]","indexed":false},{"type":"uint16","name":"limit","internalType":"uint16","indexed":false},{"type":"uint8","name":"winner","internalType":"uint8","indexed":false},{"type":"uint64","name":"endedAt","internalType":"uint64","indexed":false},{"type":"address","name":"submittedBy","internalType":"address","indexed":false},{"type":"address","name":"signedBy","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Witnessed","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32","indexed":true},{"type":"address[]","name":"teamA","internalType":"address[]","indexed":false},{"type":"address[]","name":"teamB","internalType":"address[]","indexed":false},{"type":"uint16[]","name":"killsA","internalType":"uint16[]","indexed":false},{"type":"uint16[]","name":"killsB","internalType":"uint16[]","indexed":false},{"type":"uint16","name":"limit","internalType":"uint16","indexed":false},{"type":"uint8","name":"winner","internalType":"uint8","indexed":false},{"type":"uint64","name":"endedAt","internalType":"uint64","indexed":false},{"type":"address","name":"submittedBy","internalType":"address","indexed":false},{"type":"address[]","name":"witnesses","internalType":"address[]","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_TEAM","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_WITNESSES","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"RESULT_TYPEHASH","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"digest","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32"},{"type":"address[]","name":"teamA","internalType":"address[]"},{"type":"address[]","name":"teamB","internalType":"address[]"},{"type":"uint16[]","name":"killsA","internalType":"uint16[]"},{"type":"uint16[]","name":"killsB","internalType":"uint16[]"},{"type":"uint16","name":"limit","internalType":"uint16"},{"type":"uint8","name":"winner","internalType":"uint8"},{"type":"uint64","name":"endedAt","internalType":"uint64"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes1","name":"fields","internalType":"bytes1"},{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"version","internalType":"string"},{"type":"uint256","name":"chainId","internalType":"uint256"},{"type":"address","name":"verifyingContract","internalType":"address"},{"type":"bytes32","name":"salt","internalType":"bytes32"},{"type":"uint256[]","name":"extensions","internalType":"uint256[]"}],"name":"eip712Domain","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"kills","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"losses","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"record","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32"},{"type":"address[]","name":"teamA","internalType":"address[]"},{"type":"address[]","name":"teamB","internalType":"address[]"},{"type":"uint16[]","name":"killsA","internalType":"uint16[]"},{"type":"uint16[]","name":"killsB","internalType":"uint16[]"},{"type":"uint16","name":"limit","internalType":"uint16"},{"type":"uint8","name":"winner","internalType":"uint8"},{"type":"uint64","name":"endedAt","internalType":"uint64"},{"type":"bytes","name":"signature","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"recordOf","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recordWitnessed","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32"},{"type":"address[]","name":"teamA","internalType":"address[]"},{"type":"address[]","name":"teamB","internalType":"address[]"},{"type":"uint16[]","name":"killsA","internalType":"uint16[]"},{"type":"uint16[]","name":"killsB","internalType":"uint16[]"},{"type":"uint16","name":"limit","internalType":"uint16"},{"type":"uint8","name":"winner","internalType":"uint8"},{"type":"uint64","name":"endedAt","internalType":"uint64"},{"type":"bytes[]","name":"signatures","internalType":"bytes[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"recorded","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"signerOf","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32"},{"type":"address[]","name":"teamA","internalType":"address[]"},{"type":"address[]","name":"teamB","internalType":"address[]"},{"type":"uint16[]","name":"killsA","internalType":"uint16[]"},{"type":"uint16[]","name":"killsB","internalType":"uint16[]"},{"type":"uint16","name":"limit","internalType":"uint16"},{"type":"uint8","name":"winner","internalType":"uint8"},{"type":"uint64","name":"endedAt","internalType":"uint64"},{"type":"bytes","name":"signature","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"wins","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"witnessedKills","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"witnessedLosses","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"witnessedOf","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"witnessedWins","inputs":[{"type":"address","name":"","internalType":"address"}]}]
Contract Creation Code
0x610160604052348015610010575f5ffd5b50604080518082018252601181527050756c7365426c6f636b7a204475656c7360781b602080830191909152825180840190935260018352603160f81b908301529061005c825f610105565b6101205261006b816001610105565b61014052815160208084019190912060e052815190820120610100524660a0526100f760e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a08201525f9060c00160405160208183030381529060405280519060200120905090565b60805250503060c05261033d565b5f6020835110156101205761011983610137565b9050610131565b8161012b8482610215565b5060ff90505b92915050565b5f5f829050601f8151111561016a578260405163305a27a960e01b815260040161016191906102cf565b60405180910390fd5b80516101758261031a565b179392505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806101a557607f821691505b6020821081036101c357634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561021057805f5260205f20601f840160051c810160208510156101ee5750805b601f840160051c820191505b8181101561020d575f81556001016101fa565b50505b505050565b81516001600160401b0381111561022e5761022e61017d565b6102428161023c8454610191565b846101c9565b6020601f821160018114610274575f831561025d5750848201515b5f19600385901b1c1916600184901b17845561020d565b5f84815260208120601f198516915b828110156102a35787850151825560209485019460019092019101610283565b50848210156102c057868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b602081525f82518060208401525f5b818110156102fb57602081860181015160408684010152016102de565b505f604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156101c3575f1960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161211e61038e5f395f61108101525f61105001525f61118001525f61115801525f6110b301525f6110dd01525f611107015261211e5ff3fe608060405234801561000f575f5ffd5b5060043610610106575f3560e01c80638047a97a1161009e578063adacbcd71161006e578063adacbcd714610278578063c903c2331461029d578063d1c60a3a146102c2578063d6399790146102e1578063fe8e693514610312575f5ffd5b80638047a97a146101d957806384b0196e1461021357806386a60c561461022e57806389c3c62c14610253575f5ffd5b806326ec3af0116100d957806326ec3af01461017e57806332c7189e146101a9578063406a2527146101b15780637daa52b0146101c6575f5ffd5b80630a99764b1461010a5780630ccb53f61461013c578063123f8e9f1461014457806324ceaf2a1461016b575b5f5ffd5b6101296101183660046117a9565b60066020525f908152604090205481565b6040519081526020015b60405180910390f35b610129601081565b6101297f20c28da9ba7e56b7441489a11f2dbf9abe35c7756b0aaf6e59ec043d386d8ee081565b61012961017936600461194b565b610337565b61019161018c366004611aa5565b61035d565b6040516001600160a01b039091168152602001610133565b610129600481565b6101c46101bf366004611aa5565b6103af565b005b6101c46101d4366004611c3b565b6104c0565b6101fe6101e7366004611d43565b60046020525f908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610133565b61021b610677565b6040516101339796959493929190611da6565b6101fe61023c366004611d43565b60036020525f908152604090205463ffffffff1681565b6101fe610261366004611d43565b60076020525f908152604090205463ffffffff1681565b6101fe610286366004611d43565b60096020525f908152604090205463ffffffff1681565b6101fe6102ab366004611d43565b60056020525f908152604090205463ffffffff1681565b6101296102d03660046117a9565b60026020525f908152604090205481565b6103026102ef3660046117a9565b5f90815260026020526040902054151590565b6040519015158152602001610133565b6101fe610320366004611d43565b60086020525f908152604090205463ffffffff1681565b5f61035061034b8a8a8a8a8a8a8a8a6106b9565b6107ed565b9998505050505050505050565b5f5f5f6103796103738d8d8d8d8d8d8d8d610337565b8561081f565b5090925090505f81600381111561039257610392611e3c565b1461039d575f61039f565b815b9c9b505050505050505050505050565b5f89815260026020526040902054156104025760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481c9958dbdc99195960821b60448201526064015b60405180910390fd5b61041189898989898989610868565b5f6104228a8a8a8a8a8a8a8a6106b9565b90505f6104318a8a8486610a74565b5f8c8152600260205260408120849055909150610459908b908a90600160ff8a161490610b74565b61046b89888760ff166002145f610b74565b8a7f6e0f8c1e127022326d79971e5d5df8e705d949b2fd93db439168f735aca5cd368b8b8b8b8b8b8b338a6040516104ab99989796959493929190611ec7565b60405180910390a25050505050505050505050565b5f898152600260205260409020541561051b5760405162461bcd60e51b815260206004820152601b60248201527f616c72656164792061677265656420616e64207265636f72646564000000000060448201526064016103f9565b5f898152600660205260409020541561056a5760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481dda5d1b995cdcd959607a1b60448201526064016103f9565b61057989898989898989610868565b6105838833610df0565b8061059357506105938733610df0565b6105df5760405162461bcd60e51b815260206004820152601a60248201527f73656e646572206973206e6f7420696e2074686973206475656c00000000000060448201526064016103f9565b5f6105f08a8a8a8a8a8a8a8a6106b9565b90505f6105ff8a8a8486610e49565b5f8c815260066020526040902083905590506106248a89600160ff8916811490610b74565b61063789888760ff166002146001610b74565b8a7f2db8afc3533a28babfd708d08d1f2948b126c81e0e1c6210aa2e3d2611455c5c8b8b8b8b8b8b8b338a6040516104ab99989796959493929190611f5f565b5f6060805f5f5f6060610688611049565b61069061107a565b604080515f80825260208201909252600f60f81b9b939a50919850469750309650945092509050565b5f7f20c28da9ba7e56b7441489a11f2dbf9abe35c7756b0aaf6e59ec043d386d8ee089896040516020016106ed9190611ff3565b60405160208183030381529060405280519060200120896040516020016107149190611ff3565b604051602081830303815290604052805190602001208960405160200161073b9190612031565b60405160208183030381529060405280519060200120896040516020016107629190612031565b60408051601f198184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915261ffff851660e082015260ff84166101008201526001600160401b0383166101208201526101400160405160208183030381529060405280519060200120905098975050505050505050565b5f6108196107f96110a7565b8360405161190160f01b8152600281019290925260228201526042902090565b92915050565b5f5f5f8351604103610856576020840151604085015160608601515f1a610848888285856111d0565b955095509550505050610861565b505081515f91506002905b9250925092565b8661089d5760405162461bcd60e51b81526020600482015260056024820152641b9bc81a5960da1b60448201526064016103f9565b5f86511180156108af57506004865111155b6108e95760405162461bcd60e51b815260206004820152600b60248201526a7465616d20412073697a6560a81b60448201526064016103f9565b5f85511180156108fb57506004855111155b6109355760405162461bcd60e51b815260206004820152600b60248201526a7465616d20422073697a6560a81b60448201526064016103f9565b85518451148015610947575084518351145b6109935760405162461bcd60e51b815260206004820152601c60248201527f61206b696c6c20636f756e7420666f72206561636820706c617965720000000060448201526064016103f9565b8060ff16600114806109a857508060ff166002145b6109e75760405162461bcd60e51b815260206004820152601060248201526f3bb4b73732b91034b990189037b9101960811b60448201526064016103f9565b5f8261ffff16118015610a0657508161ffff16610a0385611298565b11155b8015610a1e57508161ffff16610a1b84611298565b11155b610a615760405162461bcd60e51b8152602060048201526014602482015273199c9859dcc81c185cdd081d1a19481b1a5b5a5d60621b60448201526064016103f9565b610a6b86866112dd565b50505050505050565b5f610a87610a81846107ed565b836115b8565b90505f610a948633610df0565b90508080610aa75750610aa78533610df0565b610af35760405162461bcd60e51b815260206004820152601a60248201527f73656e646572206973206e6f7420696e2074686973206475656c00000000000060448201526064016103f9565b80610b0757610b028683610df0565b610b11565b610b118583610df0565b610b6b5760405162461bcd60e51b815260206004820152602560248201527f6e656564732061207369676e61747572652066726f6d20746865206f74686572604482015264207465616d60d81b60648201526084016103f9565b50949350505050565b5f5b8451811015610de9578115610cb557838181518110610b9757610b9761205f565b602002602001015161ffff1660075f878481518110610bb857610bb861205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610bfc9190612087565b92506101000a81548163ffffffff021916908363ffffffff1602179055508215610c9e57600160085f878481518110610c3757610c3761205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610c7b9190612087565b92506101000a81548163ffffffff021916908363ffffffff160217905550610de1565b600160095f878481518110610c3757610c3761205f565b838181518110610cc757610cc761205f565b602002602001015161ffff1660035f878481518110610ce857610ce861205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610d2c9190612087565b92506101000a81548163ffffffff021916908363ffffffff1602179055508215610d6757600160045f878481518110610c3757610c3761205f565b600160055f878481518110610d7e57610d7e61205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610dc29190612087565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b600101610b76565b5050505050565b5f805b8351811015610e4057826001600160a01b0316848281518110610e1857610e1861205f565b60200260200101516001600160a01b031603610e38576001915050610819565b600101610df3565b505f9392505050565b60605f8251118015610e5d57506010825111155b610e995760405162461bcd60e51b815260206004820152600d60248201526c1dda5d1b995cdcc818dbdd5b9d609a1b60448201526064016103f9565b5f610ea3846107ed565b905082516001600160401b03811115610ebe57610ebe6117c0565b604051908082528060200260200182016040528015610ee7578160200160208202803683370190505b5091505f5b835181101561103f575f610f1983868481518110610f0c57610f0c61205f565b60200260200101516115b8565b9050610f258882610df0565b158015610f395750610f378782610df0565b155b610f855760405162461bcd60e51b815260206004820152601960248201527f61207769746e6573732077617320696e20746865206475656c0000000000000060448201526064016103f9565b5f5b8281101561100a57816001600160a01b0316858281518110610fab57610fab61205f565b60200260200101516001600160a01b0316036110025760405162461bcd60e51b815260206004820152601660248201527561207769746e657373207369676e656420747769636560501b60448201526064016103f9565b600101610f87565b508084838151811061101e5761101e61205f565b6001600160a01b039092166020928302919091019091015250600101610eec565b5050949350505050565b60606110757f00000000000000000000000000000000000000000000000000000000000000005f6115e0565b905090565b60606110757f000000000000000000000000000000000000000000000000000000000000000060016115e0565b5f306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156110ff57507f000000000000000000000000000000000000000000000000000000000000000046145b1561112957507f000000000000000000000000000000000000000000000000000000000000000090565b611075604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a08201525f9060c00160405160208183030381529060405280519060200120905090565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561120957505f9150600390508261128e565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561125a573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b03811661128557505f92506001915082905061128e565b92505f91508190505b9450945094915050565b5f805b82518110156112d7578281815181106112b6576112b661205f565b602002602001015161ffff16826112cd91906120a3565b915060010161129b565b50919050565b5f5b8251811015611493575f6001600160a01b03168382815181106113045761130461205f565b60200260200101516001600160a01b0316036113515760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f9565b5f61135d8260016120a3565b90505b83518110156113f35783818151811061137b5761137b61205f565b60200260200101516001600160a01b031684838151811061139e5761139e61205f565b60200260200101516001600160a01b0316036113eb5760405162461bcd60e51b815260206004820152600c60248201526b6c697374656420747769636560a01b60448201526064016103f9565b600101611360565b505f5b825181101561148a578281815181106114115761141161205f565b60200260200101516001600160a01b03168483815181106114345761143461205f565b60200260200101516001600160a01b0316036114825760405162461bcd60e51b815260206004820152600d60248201526c6f6e20626f7468207465616d7360981b60448201526064016103f9565b6001016113f6565b506001016112df565b505f5b81518110156115b3575f6001600160a01b03168282815181106114bb576114bb61205f565b60200260200101516001600160a01b0316036115085760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f9565b5f6115148260016120a3565b90505b82518110156115aa578281815181106115325761153261205f565b60200260200101516001600160a01b03168383815181106115555761155561205f565b60200260200101516001600160a01b0316036115a25760405162461bcd60e51b815260206004820152600c60248201526b6c697374656420747769636560a01b60448201526064016103f9565b600101611517565b50600101611496565b505050565b5f5f5f5f6115c6868661081f565b9250925092506115d68282611689565b5090949350505050565b606060ff83146115fa576115f383611745565b9050610819565b818054611606906120b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611632906120b6565b801561167d5780601f106116545761010080835404028352916020019161167d565b820191905f5260205f20905b81548152906001019060200180831161166057829003601f168201915b50505050509050610819565b5f82600381111561169c5761169c611e3c565b036116a5575050565b60018260038111156116b9576116b9611e3c565b036116d75760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156116eb576116eb611e3c565b0361170c5760405163fce698f760e01b8152600481018290526024016103f9565b600382600381111561172057611720611e3c565b03611741576040516335e2f38360e21b8152600481018290526024016103f9565b5050565b60605f61175183611782565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b5f60ff8216601f81111561081957604051632cd44ac360e21b815260040160405180910390fd5b5f602082840312156117b9575f5ffd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156117fc576117fc6117c0565b604052919050565b5f6001600160401b0382111561181c5761181c6117c0565b5060051b60200190565b80356001600160a01b038116811461183c575f5ffd5b919050565b5f82601f830112611850575f5ffd5b813561186361185e82611804565b6117d4565b8082825260208201915060208360051b860101925085831115611884575f5ffd5b602085015b838110156118a85761189a81611826565b835260209283019201611889565b5095945050505050565b803561ffff8116811461183c575f5ffd5b5f82601f8301126118d2575f5ffd5b81356118e061185e82611804565b8082825260208201915060208360051b860101925085831115611901575f5ffd5b602085015b838110156118a857611917816118b2565b835260209283019201611906565b803560ff8116811461183c575f5ffd5b80356001600160401b038116811461183c575f5ffd5b5f5f5f5f5f5f5f5f610100898b031215611963575f5ffd5b8835975060208901356001600160401b0381111561197f575f5ffd5b61198b8b828c01611841565b97505060408901356001600160401b038111156119a6575f5ffd5b6119b28b828c01611841565b96505060608901356001600160401b038111156119cd575f5ffd5b6119d98b828c016118c3565b95505060808901356001600160401b038111156119f4575f5ffd5b611a008b828c016118c3565b945050611a0f60a08a016118b2565b9250611a1d60c08a01611925565b9150611a2b60e08a01611935565b90509295985092959890939650565b5f82601f830112611a49575f5ffd5b81356001600160401b03811115611a6257611a626117c0565b611a75601f8201601f19166020016117d4565b818152846020838601011115611a89575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f5f5f5f5f5f5f5f6101208a8c031215611abe575f5ffd5b8935985060208a01356001600160401b03811115611ada575f5ffd5b611ae68c828d01611841565b98505060408a01356001600160401b03811115611b01575f5ffd5b611b0d8c828d01611841565b97505060608a01356001600160401b03811115611b28575f5ffd5b611b348c828d016118c3565b96505060808a01356001600160401b03811115611b4f575f5ffd5b611b5b8c828d016118c3565b955050611b6a60a08b016118b2565b9350611b7860c08b01611925565b9250611b8660e08b01611935565b91506101008a01356001600160401b03811115611ba1575f5ffd5b611bad8c828d01611a3a565b9150509295985092959850929598565b5f82601f830112611bcc575f5ffd5b8135611bda61185e82611804565b8082825260208201915060208360051b860101925085831115611bfb575f5ffd5b602085015b838110156118a85780356001600160401b03811115611c1d575f5ffd5b611c2c886020838a0101611a3a565b84525060209283019201611c00565b5f5f5f5f5f5f5f5f5f6101208a8c031215611c54575f5ffd5b8935985060208a01356001600160401b03811115611c70575f5ffd5b611c7c8c828d01611841565b98505060408a01356001600160401b03811115611c97575f5ffd5b611ca38c828d01611841565b97505060608a01356001600160401b03811115611cbe575f5ffd5b611cca8c828d016118c3565b96505060808a01356001600160401b03811115611ce5575f5ffd5b611cf18c828d016118c3565b955050611d0060a08b016118b2565b9350611d0e60c08b01611925565b9250611d1c60e08b01611935565b91506101008a01356001600160401b03811115611d37575f5ffd5b611bad8c828d01611bbd565b5f60208284031215611d53575f5ffd5b611d5c82611826565b9392505050565b5f81518084525f5b81811015611d8757602081850181015186830182015201611d6b565b505f602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e060208201525f611dc460e0830189611d63565b8281036040840152611dd68189611d63565b606084018890526001600160a01b038716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b81811015611e2b578351835260209384019390920191600101611e0d565b50909b9a5050505050505050505050565b634e487b7160e01b5f52602160045260245ffd5b5f8151808452602084019350602083015f5b82811015611e895781516001600160a01b0316865260209586019590910190600101611e62565b5093949350505050565b5f8151808452602084019350602083015f5b82811015611e8957815161ffff16865260209586019590910190600101611ea5565b61012081525f611edb61012083018c611e50565b8281036020840152611eed818c611e50565b90508281036040840152611f01818b611e93565b90508281036060840152611f15818a611e93565b61ffff989098166080840152505060ff9490941660a08501526001600160401b039290921660c08401526001600160a01b0390811660e08401521661010090910152949350505050565b61012081525f611f7361012083018c611e50565b8281036020840152611f85818c611e50565b90508281036040840152611f99818b611e93565b90508281036060840152611fad818a611e93565b61ffff8916608085015260ff881660a08501526001600160401b03871660c08501526001600160a01b03861660e0850152838103610100850152905061039f8185611e50565b81515f90829060208501835b828110156120265781516001600160a01b0316845260209384019390910190600101611fff565b509195945050505050565b81515f90829060208501835b8281101561202657815161ffff1684526020938401939091019060010161203d565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b63ffffffff818116838216019081111561081957610819612073565b8082018082111561081957610819612073565b600181811c908216806120ca57607f821691505b6020821081036112d757634e487b7160e01b5f52602260045260245ffdfea2646970667358221220514323905ec9ceb2b051db3fb28f2c4f1f9b3748418766653d674da8d260532e64736f6c634300081c0033
Deployed ByteCode
0x608060405234801561000f575f5ffd5b5060043610610106575f3560e01c80638047a97a1161009e578063adacbcd71161006e578063adacbcd714610278578063c903c2331461029d578063d1c60a3a146102c2578063d6399790146102e1578063fe8e693514610312575f5ffd5b80638047a97a146101d957806384b0196e1461021357806386a60c561461022e57806389c3c62c14610253575f5ffd5b806326ec3af0116100d957806326ec3af01461017e57806332c7189e146101a9578063406a2527146101b15780637daa52b0146101c6575f5ffd5b80630a99764b1461010a5780630ccb53f61461013c578063123f8e9f1461014457806324ceaf2a1461016b575b5f5ffd5b6101296101183660046117a9565b60066020525f908152604090205481565b6040519081526020015b60405180910390f35b610129601081565b6101297f20c28da9ba7e56b7441489a11f2dbf9abe35c7756b0aaf6e59ec043d386d8ee081565b61012961017936600461194b565b610337565b61019161018c366004611aa5565b61035d565b6040516001600160a01b039091168152602001610133565b610129600481565b6101c46101bf366004611aa5565b6103af565b005b6101c46101d4366004611c3b565b6104c0565b6101fe6101e7366004611d43565b60046020525f908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610133565b61021b610677565b6040516101339796959493929190611da6565b6101fe61023c366004611d43565b60036020525f908152604090205463ffffffff1681565b6101fe610261366004611d43565b60076020525f908152604090205463ffffffff1681565b6101fe610286366004611d43565b60096020525f908152604090205463ffffffff1681565b6101fe6102ab366004611d43565b60056020525f908152604090205463ffffffff1681565b6101296102d03660046117a9565b60026020525f908152604090205481565b6103026102ef3660046117a9565b5f90815260026020526040902054151590565b6040519015158152602001610133565b6101fe610320366004611d43565b60086020525f908152604090205463ffffffff1681565b5f61035061034b8a8a8a8a8a8a8a8a6106b9565b6107ed565b9998505050505050505050565b5f5f5f6103796103738d8d8d8d8d8d8d8d610337565b8561081f565b5090925090505f81600381111561039257610392611e3c565b1461039d575f61039f565b815b9c9b505050505050505050505050565b5f89815260026020526040902054156104025760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481c9958dbdc99195960821b60448201526064015b60405180910390fd5b61041189898989898989610868565b5f6104228a8a8a8a8a8a8a8a6106b9565b90505f6104318a8a8486610a74565b5f8c8152600260205260408120849055909150610459908b908a90600160ff8a161490610b74565b61046b89888760ff166002145f610b74565b8a7f6e0f8c1e127022326d79971e5d5df8e705d949b2fd93db439168f735aca5cd368b8b8b8b8b8b8b338a6040516104ab99989796959493929190611ec7565b60405180910390a25050505050505050505050565b5f898152600260205260409020541561051b5760405162461bcd60e51b815260206004820152601b60248201527f616c72656164792061677265656420616e64207265636f72646564000000000060448201526064016103f9565b5f898152600660205260409020541561056a5760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481dda5d1b995cdcd959607a1b60448201526064016103f9565b61057989898989898989610868565b6105838833610df0565b8061059357506105938733610df0565b6105df5760405162461bcd60e51b815260206004820152601a60248201527f73656e646572206973206e6f7420696e2074686973206475656c00000000000060448201526064016103f9565b5f6105f08a8a8a8a8a8a8a8a6106b9565b90505f6105ff8a8a8486610e49565b5f8c815260066020526040902083905590506106248a89600160ff8916811490610b74565b61063789888760ff166002146001610b74565b8a7f2db8afc3533a28babfd708d08d1f2948b126c81e0e1c6210aa2e3d2611455c5c8b8b8b8b8b8b8b338a6040516104ab99989796959493929190611f5f565b5f6060805f5f5f6060610688611049565b61069061107a565b604080515f80825260208201909252600f60f81b9b939a50919850469750309650945092509050565b5f7f20c28da9ba7e56b7441489a11f2dbf9abe35c7756b0aaf6e59ec043d386d8ee089896040516020016106ed9190611ff3565b60405160208183030381529060405280519060200120896040516020016107149190611ff3565b604051602081830303815290604052805190602001208960405160200161073b9190612031565b60405160208183030381529060405280519060200120896040516020016107629190612031565b60408051601f198184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915261ffff851660e082015260ff84166101008201526001600160401b0383166101208201526101400160405160208183030381529060405280519060200120905098975050505050505050565b5f6108196107f96110a7565b8360405161190160f01b8152600281019290925260228201526042902090565b92915050565b5f5f5f8351604103610856576020840151604085015160608601515f1a610848888285856111d0565b955095509550505050610861565b505081515f91506002905b9250925092565b8661089d5760405162461bcd60e51b81526020600482015260056024820152641b9bc81a5960da1b60448201526064016103f9565b5f86511180156108af57506004865111155b6108e95760405162461bcd60e51b815260206004820152600b60248201526a7465616d20412073697a6560a81b60448201526064016103f9565b5f85511180156108fb57506004855111155b6109355760405162461bcd60e51b815260206004820152600b60248201526a7465616d20422073697a6560a81b60448201526064016103f9565b85518451148015610947575084518351145b6109935760405162461bcd60e51b815260206004820152601c60248201527f61206b696c6c20636f756e7420666f72206561636820706c617965720000000060448201526064016103f9565b8060ff16600114806109a857508060ff166002145b6109e75760405162461bcd60e51b815260206004820152601060248201526f3bb4b73732b91034b990189037b9101960811b60448201526064016103f9565b5f8261ffff16118015610a0657508161ffff16610a0385611298565b11155b8015610a1e57508161ffff16610a1b84611298565b11155b610a615760405162461bcd60e51b8152602060048201526014602482015273199c9859dcc81c185cdd081d1a19481b1a5b5a5d60621b60448201526064016103f9565b610a6b86866112dd565b50505050505050565b5f610a87610a81846107ed565b836115b8565b90505f610a948633610df0565b90508080610aa75750610aa78533610df0565b610af35760405162461bcd60e51b815260206004820152601a60248201527f73656e646572206973206e6f7420696e2074686973206475656c00000000000060448201526064016103f9565b80610b0757610b028683610df0565b610b11565b610b118583610df0565b610b6b5760405162461bcd60e51b815260206004820152602560248201527f6e656564732061207369676e61747572652066726f6d20746865206f74686572604482015264207465616d60d81b60648201526084016103f9565b50949350505050565b5f5b8451811015610de9578115610cb557838181518110610b9757610b9761205f565b602002602001015161ffff1660075f878481518110610bb857610bb861205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610bfc9190612087565b92506101000a81548163ffffffff021916908363ffffffff1602179055508215610c9e57600160085f878481518110610c3757610c3761205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610c7b9190612087565b92506101000a81548163ffffffff021916908363ffffffff160217905550610de1565b600160095f878481518110610c3757610c3761205f565b838181518110610cc757610cc761205f565b602002602001015161ffff1660035f878481518110610ce857610ce861205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610d2c9190612087565b92506101000a81548163ffffffff021916908363ffffffff1602179055508215610d6757600160045f878481518110610c3757610c3761205f565b600160055f878481518110610d7e57610d7e61205f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f8282829054906101000a900463ffffffff16610dc29190612087565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b600101610b76565b5050505050565b5f805b8351811015610e4057826001600160a01b0316848281518110610e1857610e1861205f565b60200260200101516001600160a01b031603610e38576001915050610819565b600101610df3565b505f9392505050565b60605f8251118015610e5d57506010825111155b610e995760405162461bcd60e51b815260206004820152600d60248201526c1dda5d1b995cdcc818dbdd5b9d609a1b60448201526064016103f9565b5f610ea3846107ed565b905082516001600160401b03811115610ebe57610ebe6117c0565b604051908082528060200260200182016040528015610ee7578160200160208202803683370190505b5091505f5b835181101561103f575f610f1983868481518110610f0c57610f0c61205f565b60200260200101516115b8565b9050610f258882610df0565b158015610f395750610f378782610df0565b155b610f855760405162461bcd60e51b815260206004820152601960248201527f61207769746e6573732077617320696e20746865206475656c0000000000000060448201526064016103f9565b5f5b8281101561100a57816001600160a01b0316858281518110610fab57610fab61205f565b60200260200101516001600160a01b0316036110025760405162461bcd60e51b815260206004820152601660248201527561207769746e657373207369676e656420747769636560501b60448201526064016103f9565b600101610f87565b508084838151811061101e5761101e61205f565b6001600160a01b039092166020928302919091019091015250600101610eec565b5050949350505050565b60606110757f50756c7365426c6f636b7a204475656c730000000000000000000000000000115f6115e0565b905090565b60606110757f310000000000000000000000000000000000000000000000000000000000000160016115e0565b5f306001600160a01b037f00000000000000000000000023b5490e158ead5605ae6d19e1bcbc391deda810161480156110ff57507f00000000000000000000000000000000000000000000000000000000000003af46145b1561112957507f035013959368aa68c6483b1f4ca422595b82c4ea96a44f4101148d4f1bfc8bda90565b611075604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527fb78267282f994cf85d4f1337860d4682f82921926eb285d10c9e7b95b574e7aa918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a08201525f9060c00160405160208183030381529060405280519060200120905090565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561120957505f9150600390508261128e565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561125a573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b03811661128557505f92506001915082905061128e565b92505f91508190505b9450945094915050565b5f805b82518110156112d7578281815181106112b6576112b661205f565b602002602001015161ffff16826112cd91906120a3565b915060010161129b565b50919050565b5f5b8251811015611493575f6001600160a01b03168382815181106113045761130461205f565b60200260200101516001600160a01b0316036113515760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f9565b5f61135d8260016120a3565b90505b83518110156113f35783818151811061137b5761137b61205f565b60200260200101516001600160a01b031684838151811061139e5761139e61205f565b60200260200101516001600160a01b0316036113eb5760405162461bcd60e51b815260206004820152600c60248201526b6c697374656420747769636560a01b60448201526064016103f9565b600101611360565b505f5b825181101561148a578281815181106114115761141161205f565b60200260200101516001600160a01b03168483815181106114345761143461205f565b60200260200101516001600160a01b0316036114825760405162461bcd60e51b815260206004820152600d60248201526c6f6e20626f7468207465616d7360981b60448201526064016103f9565b6001016113f6565b506001016112df565b505f5b81518110156115b3575f6001600160a01b03168282815181106114bb576114bb61205f565b60200260200101516001600160a01b0316036115085760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f9565b5f6115148260016120a3565b90505b82518110156115aa578281815181106115325761153261205f565b60200260200101516001600160a01b03168383815181106115555761155561205f565b60200260200101516001600160a01b0316036115a25760405162461bcd60e51b815260206004820152600c60248201526b6c697374656420747769636560a01b60448201526064016103f9565b600101611517565b50600101611496565b505050565b5f5f5f5f6115c6868661081f565b9250925092506115d68282611689565b5090949350505050565b606060ff83146115fa576115f383611745565b9050610819565b818054611606906120b6565b80601f0160208091040260200160405190810160405280929190818152602001828054611632906120b6565b801561167d5780601f106116545761010080835404028352916020019161167d565b820191905f5260205f20905b81548152906001019060200180831161166057829003601f168201915b50505050509050610819565b5f82600381111561169c5761169c611e3c565b036116a5575050565b60018260038111156116b9576116b9611e3c565b036116d75760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156116eb576116eb611e3c565b0361170c5760405163fce698f760e01b8152600481018290526024016103f9565b600382600381111561172057611720611e3c565b03611741576040516335e2f38360e21b8152600481018290526024016103f9565b5050565b60605f61175183611782565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b5f60ff8216601f81111561081957604051632cd44ac360e21b815260040160405180910390fd5b5f602082840312156117b9575f5ffd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156117fc576117fc6117c0565b604052919050565b5f6001600160401b0382111561181c5761181c6117c0565b5060051b60200190565b80356001600160a01b038116811461183c575f5ffd5b919050565b5f82601f830112611850575f5ffd5b813561186361185e82611804565b6117d4565b8082825260208201915060208360051b860101925085831115611884575f5ffd5b602085015b838110156118a85761189a81611826565b835260209283019201611889565b5095945050505050565b803561ffff8116811461183c575f5ffd5b5f82601f8301126118d2575f5ffd5b81356118e061185e82611804565b8082825260208201915060208360051b860101925085831115611901575f5ffd5b602085015b838110156118a857611917816118b2565b835260209283019201611906565b803560ff8116811461183c575f5ffd5b80356001600160401b038116811461183c575f5ffd5b5f5f5f5f5f5f5f5f610100898b031215611963575f5ffd5b8835975060208901356001600160401b0381111561197f575f5ffd5b61198b8b828c01611841565b97505060408901356001600160401b038111156119a6575f5ffd5b6119b28b828c01611841565b96505060608901356001600160401b038111156119cd575f5ffd5b6119d98b828c016118c3565b95505060808901356001600160401b038111156119f4575f5ffd5b611a008b828c016118c3565b945050611a0f60a08a016118b2565b9250611a1d60c08a01611925565b9150611a2b60e08a01611935565b90509295985092959890939650565b5f82601f830112611a49575f5ffd5b81356001600160401b03811115611a6257611a626117c0565b611a75601f8201601f19166020016117d4565b818152846020838601011115611a89575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f5f5f5f5f5f5f5f6101208a8c031215611abe575f5ffd5b8935985060208a01356001600160401b03811115611ada575f5ffd5b611ae68c828d01611841565b98505060408a01356001600160401b03811115611b01575f5ffd5b611b0d8c828d01611841565b97505060608a01356001600160401b03811115611b28575f5ffd5b611b348c828d016118c3565b96505060808a01356001600160401b03811115611b4f575f5ffd5b611b5b8c828d016118c3565b955050611b6a60a08b016118b2565b9350611b7860c08b01611925565b9250611b8660e08b01611935565b91506101008a01356001600160401b03811115611ba1575f5ffd5b611bad8c828d01611a3a565b9150509295985092959850929598565b5f82601f830112611bcc575f5ffd5b8135611bda61185e82611804565b8082825260208201915060208360051b860101925085831115611bfb575f5ffd5b602085015b838110156118a85780356001600160401b03811115611c1d575f5ffd5b611c2c886020838a0101611a3a565b84525060209283019201611c00565b5f5f5f5f5f5f5f5f5f6101208a8c031215611c54575f5ffd5b8935985060208a01356001600160401b03811115611c70575f5ffd5b611c7c8c828d01611841565b98505060408a01356001600160401b03811115611c97575f5ffd5b611ca38c828d01611841565b97505060608a01356001600160401b03811115611cbe575f5ffd5b611cca8c828d016118c3565b96505060808a01356001600160401b03811115611ce5575f5ffd5b611cf18c828d016118c3565b955050611d0060a08b016118b2565b9350611d0e60c08b01611925565b9250611d1c60e08b01611935565b91506101008a01356001600160401b03811115611d37575f5ffd5b611bad8c828d01611bbd565b5f60208284031215611d53575f5ffd5b611d5c82611826565b9392505050565b5f81518084525f5b81811015611d8757602081850181015186830182015201611d6b565b505f602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e060208201525f611dc460e0830189611d63565b8281036040840152611dd68189611d63565b606084018890526001600160a01b038716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b81811015611e2b578351835260209384019390920191600101611e0d565b50909b9a5050505050505050505050565b634e487b7160e01b5f52602160045260245ffd5b5f8151808452602084019350602083015f5b82811015611e895781516001600160a01b0316865260209586019590910190600101611e62565b5093949350505050565b5f8151808452602084019350602083015f5b82811015611e8957815161ffff16865260209586019590910190600101611ea5565b61012081525f611edb61012083018c611e50565b8281036020840152611eed818c611e50565b90508281036040840152611f01818b611e93565b90508281036060840152611f15818a611e93565b61ffff989098166080840152505060ff9490941660a08501526001600160401b039290921660c08401526001600160a01b0390811660e08401521661010090910152949350505050565b61012081525f611f7361012083018c611e50565b8281036020840152611f85818c611e50565b90508281036040840152611f99818b611e93565b90508281036060840152611fad818a611e93565b61ffff8916608085015260ff881660a08501526001600160401b03871660c08501526001600160a01b03861660e0850152838103610100850152905061039f8185611e50565b81515f90829060208501835b828110156120265781516001600160a01b0316845260209384019390910190600101611fff565b509195945050505050565b81515f90829060208501835b8281101561202657815161ffff1684526020938401939091019060010161203d565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b63ffffffff818116838216019081111561081957610819612073565b8082018082111561081957610819612073565b600181811c908216806120ca57607f821691505b6020821081036112d757634e487b7160e01b5f52602260045260245ffdfea2646970667358221220514323905ec9ceb2b051db3fb28f2c4f1f9b3748418766653d674da8d260532e64736f6c634300081c0033