Overview
APE Balance
APE Value
$0.00Multichain Info
Latest 25 from a total of 70 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Register Redempt... | 32466557 | 9 days ago | IN | 0 APE | 2.37054116 | ||||
| Register Redempt... | 32466550 | 9 days ago | IN | 0 APE | 2.37052896 | ||||
| Register Redempt... | 32466545 | 9 days ago | IN | 0 APE | 2.37052896 | ||||
| Register Redempt... | 32466523 | 9 days ago | IN | 0 APE | 2.37050822 | ||||
| Register Redempt... | 32466518 | 9 days ago | IN | 0 APE | 2.37055946 | ||||
| Register Redempt... | 32466464 | 9 days ago | IN | 0 APE | 2.37055092 | ||||
| Register Redempt... | 32466453 | 9 days ago | IN | 0 APE | 2.37051554 | ||||
| Register Redempt... | 32466445 | 9 days ago | IN | 0 APE | 2.37055285 | ||||
| Register Redempt... | 32466434 | 9 days ago | IN | 0 APE | 2.37053628 | ||||
| Register Redempt... | 32466412 | 9 days ago | IN | 0 APE | 2.3705436 | ||||
| Register Redempt... | 32461295 | 9 days ago | IN | 0 APE | 2.37055702 | ||||
| Register Redempt... | 32461289 | 9 days ago | IN | 0 APE | 2.37056556 | ||||
| Register Redempt... | 32461286 | 9 days ago | IN | 0 APE | 2.37053872 | ||||
| Register Redempt... | 32461275 | 9 days ago | IN | 0 APE | 2.3705375 | ||||
| Register Redempt... | 32461241 | 9 days ago | IN | 0 APE | 2.37052286 | ||||
| Register Redempt... | 32461210 | 9 days ago | IN | 0 APE | 2.37055214 | ||||
| Register Redempt... | 32460530 | 9 days ago | IN | 0 APE | 2.37053628 | ||||
| Register Redempt... | 32460500 | 9 days ago | IN | 0 APE | 2.37051798 | ||||
| Register Redempt... | 32460473 | 9 days ago | IN | 0 APE | 2.37055946 | ||||
| Register Redempt... | 32460458 | 9 days ago | IN | 0 APE | 2.3705619 | ||||
| Register Redempt... | 32460422 | 9 days ago | IN | 0 APE | 2.1337155 | ||||
| Register Redempt... | 32460190 | 9 days ago | IN | 0 APE | 0.23931413 | ||||
| Grant Roles | 32460166 | 9 days ago | IN | 0 APE | 0.00489683 | ||||
| Register Redempt... | 25138782 | 100 days ago | IN | 0 APE | 0.01366105 | ||||
| Register Redempt... | 25138777 | 100 days ago | IN | 0 APE | 0.03024863 |
View more zero value Internal Transactions in Advanced View mode
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.28;
import {OwnableRoles} from "solady/auth/OwnableRoles.sol";
contract RedemptionCodeRegistry is OwnableRoles {
error RedemptionCodeNotFound();
error RedemptionDataLengthMismatch();
error RedemptionCodeAlreadyUsed();
error MintFailed();
/**
* @dev Redemption data is a bytes32 of the following format:
* - functionSelector (4 bytes)
* - tokenId (8 bytes)
* - mintAddress (20 bytes)
*/
mapping(bytes32 redemptionCodeHash => bytes32 redemptionData) public redemptionCodeHashToRedemption;
mapping(bytes32 redemptionCodeHash => bool) public usedRedemptionCodes;
uint256 public constant CODE_MANAGEMENT_ROLE = _ROLE_69;
constructor() {
_initializeOwner(tx.origin);
_grantRoles(tx.origin, CODE_MANAGEMENT_ROLE);
}
function registerRedemptionCodes(bytes32[] calldata redemptionCodeHashes, bytes32[] calldata redemptionData)
external
onlyRoles(CODE_MANAGEMENT_ROLE)
{
require(redemptionCodeHashes.length == redemptionData.length, RedemptionDataLengthMismatch());
for (uint256 i = 0; i < redemptionCodeHashes.length; i++) {
redemptionCodeHashToRedemption[redemptionCodeHashes[i]] = redemptionData[i];
}
}
function invalidateRedemptionCodes(bytes32[] calldata redemptionCodeHashes) external onlyRoles(CODE_MANAGEMENT_ROLE) {
for (uint256 i = 0; i < redemptionCodeHashes.length; i++) {
redemptionCodeHashToRedemption[redemptionCodeHashes[i]] = bytes32(0);
}
}
function redeemRedemptionCode(address to, bytes32 redemptionCode) external {
bytes32 redemptionData = redemptionCodeHashToRedemption[keccak256(abi.encode(redemptionCode))];
require(redemptionData != bytes32(0), RedemptionCodeNotFound());
require(!usedRedemptionCodes[redemptionCode], RedemptionCodeAlreadyUsed());
usedRedemptionCodes[redemptionCode] = true;
(bytes4 functionSelector, uint64 tokenId, address mintAddress) = _decodeRedemptionData(redemptionData);
(bool success,) =
mintAddress.call(abi.encodeWithSelector(functionSelector, to, tokenId, redemptionCode));
require(success, MintFailed());
}
function _encodeRedemptionData(bytes4 functionSelector, uint64 tokenId, address mintAddress)
internal
pure
returns (bytes32 redemptionData)
{
redemptionData = bytes32(uint256(uint32(functionSelector))) | (bytes32(uint256(tokenId)) << 32)
| (bytes32(uint256(uint160(mintAddress))) << 96);
}
function _decodeRedemptionData(bytes32 redemptionData)
internal
pure
returns (bytes4 functionSelector, uint64 tokenId, address mintAddress)
{
functionSelector = bytes4(uint32(uint256(redemptionData)));
tokenId = uint64(uint256(redemptionData >> 32));
mintAddress = address(uint160(uint256(redemptionData >> 96)));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import {Ownable} from "./Ownable.sol";
/// @notice Simple single owner and multiroles authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/OwnableRoles.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract OwnableRoles is Ownable {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* EVENTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The `user`'s roles is updated to `roles`.
/// Each bit of `roles` represents whether the role is set.
event RolesUpdated(address indexed user, uint256 indexed roles);
/// @dev `keccak256(bytes("RolesUpdated(address,uint256)"))`.
uint256 private constant _ROLES_UPDATED_EVENT_SIGNATURE =
0x715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* STORAGE */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The role slot of `user` is given by:
/// ```
/// mstore(0x00, or(shl(96, user), _ROLE_SLOT_SEED))
/// let roleSlot := keccak256(0x00, 0x20)
/// ```
/// This automatically ignores the upper bits of the `user` in case
/// they are not clean, as well as keep the `keccak256` under 32-bytes.
///
/// Note: This is equivalent to `uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))`.
uint256 private constant _ROLE_SLOT_SEED = 0x8b78c6d8;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* INTERNAL FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Overwrite the roles directly without authorization guard.
function _setRoles(address user, uint256 roles) internal virtual {
/// @solidity memory-safe-assembly
assembly {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, user)
// Store the new value.
sstore(keccak256(0x0c, 0x20), roles)
// Emit the {RolesUpdated} event.
log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, mload(0x0c)), roles)
}
}
/// @dev Updates the roles directly without authorization guard.
/// If `on` is true, each set bit of `roles` will be turned on,
/// otherwise, each set bit of `roles` will be turned off.
function _updateRoles(address user, uint256 roles, bool on) internal virtual {
/// @solidity memory-safe-assembly
assembly {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, user)
let roleSlot := keccak256(0x0c, 0x20)
// Load the current value.
let current := sload(roleSlot)
// Compute the updated roles if `on` is true.
let updated := or(current, roles)
// Compute the updated roles if `on` is false.
// Use `and` to compute the intersection of `current` and `roles`,
// `xor` it with `current` to flip the bits in the intersection.
if iszero(on) { updated := xor(current, and(current, roles)) }
// Then, store the new value.
sstore(roleSlot, updated)
// Emit the {RolesUpdated} event.
log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, mload(0x0c)), updated)
}
}
/// @dev Grants the roles directly without authorization guard.
/// Each bit of `roles` represents the role to turn on.
function _grantRoles(address user, uint256 roles) internal virtual {
_updateRoles(user, roles, true);
}
/// @dev Removes the roles directly without authorization guard.
/// Each bit of `roles` represents the role to turn off.
function _removeRoles(address user, uint256 roles) internal virtual {
_updateRoles(user, roles, false);
}
/// @dev Throws if the sender does not have any of the `roles`.
function _checkRoles(uint256 roles) internal view virtual {
/// @solidity memory-safe-assembly
assembly {
// Compute the role slot.
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, caller())
// Load the stored value, and if the `and` intersection
// of the value and `roles` is zero, revert.
if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) {
mstore(0x00, 0x82b42900) // `Unauthorized()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Throws if the sender is not the owner,
/// and does not have any of the `roles`.
/// Checks for ownership first, then lazily checks for roles.
function _checkOwnerOrRoles(uint256 roles) internal view virtual {
/// @solidity memory-safe-assembly
assembly {
// If the caller is not the stored owner.
// Note: `_ROLE_SLOT_SEED` is equal to `_OWNER_SLOT_NOT`.
if iszero(eq(caller(), sload(not(_ROLE_SLOT_SEED)))) {
// Compute the role slot.
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, caller())
// Load the stored value, and if the `and` intersection
// of the value and `roles` is zero, revert.
if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) {
mstore(0x00, 0x82b42900) // `Unauthorized()`.
revert(0x1c, 0x04)
}
}
}
}
/// @dev Throws if the sender does not have any of the `roles`,
/// and is not the owner.
/// Checks for roles first, then lazily checks for ownership.
function _checkRolesOrOwner(uint256 roles) internal view virtual {
/// @solidity memory-safe-assembly
assembly {
// Compute the role slot.
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, caller())
// Load the stored value, and if the `and` intersection
// of the value and `roles` is zero, revert.
if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) {
// If the caller is not the stored owner.
// Note: `_ROLE_SLOT_SEED` is equal to `_OWNER_SLOT_NOT`.
if iszero(eq(caller(), sload(not(_ROLE_SLOT_SEED)))) {
mstore(0x00, 0x82b42900) // `Unauthorized()`.
revert(0x1c, 0x04)
}
}
}
}
/// @dev Convenience function to return a `roles` bitmap from an array of `ordinals`.
/// This is meant for frontends like Etherscan, and is therefore not fully optimized.
/// Not recommended to be called on-chain.
/// Made internal to conserve bytecode. Wrap it in a public function if needed.
function _rolesFromOrdinals(uint8[] memory ordinals) internal pure returns (uint256 roles) {
/// @solidity memory-safe-assembly
assembly {
for { let i := shl(5, mload(ordinals)) } i { i := sub(i, 0x20) } {
// We don't need to mask the values of `ordinals`, as Solidity
// cleans dirty upper bits when storing variables into memory.
roles := or(shl(mload(add(ordinals, i)), 1), roles)
}
}
}
/// @dev Convenience function to return an array of `ordinals` from the `roles` bitmap.
/// This is meant for frontends like Etherscan, and is therefore not fully optimized.
/// Not recommended to be called on-chain.
/// Made internal to conserve bytecode. Wrap it in a public function if needed.
function _ordinalsFromRoles(uint256 roles) internal pure returns (uint8[] memory ordinals) {
/// @solidity memory-safe-assembly
assembly {
// Grab the pointer to the free memory.
ordinals := mload(0x40)
let ptr := add(ordinals, 0x20)
let o := 0
// The absence of lookup tables, De Bruijn, etc., here is intentional for
// smaller bytecode, as this function is not meant to be called on-chain.
for { let t := roles } 1 {} {
mstore(ptr, o)
// `shr` 5 is equivalent to multiplying by 0x20.
// Push back into the ordinals array if the bit is set.
ptr := add(ptr, shl(5, and(t, 1)))
o := add(o, 1)
t := shr(o, roles)
if iszero(t) { break }
}
// Store the length of `ordinals`.
mstore(ordinals, shr(5, sub(ptr, add(ordinals, 0x20))))
// Allocate the memory.
mstore(0x40, ptr)
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC UPDATE FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Allows the owner to grant `user` `roles`.
/// If the `user` already has a role, then it will be an no-op for the role.
function grantRoles(address user, uint256 roles) public payable virtual onlyOwner {
_grantRoles(user, roles);
}
/// @dev Allows the owner to remove `user` `roles`.
/// If the `user` does not have a role, then it will be an no-op for the role.
function revokeRoles(address user, uint256 roles) public payable virtual onlyOwner {
_removeRoles(user, roles);
}
/// @dev Allow the caller to remove their own roles.
/// If the caller does not have a role, then it will be an no-op for the role.
function renounceRoles(uint256 roles) public payable virtual {
_removeRoles(msg.sender, roles);
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC READ FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns the roles of `user`.
function rolesOf(address user) public view virtual returns (uint256 roles) {
/// @solidity memory-safe-assembly
assembly {
// Compute the role slot.
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, user)
// Load the stored value.
roles := sload(keccak256(0x0c, 0x20))
}
}
/// @dev Returns whether `user` has any of `roles`.
function hasAnyRole(address user, uint256 roles) public view virtual returns (bool) {
return rolesOf(user) & roles != 0;
}
/// @dev Returns whether `user` has all of `roles`.
function hasAllRoles(address user, uint256 roles) public view virtual returns (bool) {
return rolesOf(user) & roles == roles;
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* MODIFIERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Marks a function as only callable by an account with `roles`.
modifier onlyRoles(uint256 roles) virtual {
_checkRoles(roles);
_;
}
/// @dev Marks a function as only callable by the owner or by an account
/// with `roles`. Checks for ownership first, then lazily checks for roles.
modifier onlyOwnerOrRoles(uint256 roles) virtual {
_checkOwnerOrRoles(roles);
_;
}
/// @dev Marks a function as only callable by an account with `roles`
/// or the owner. Checks for roles first, then lazily checks for ownership.
modifier onlyRolesOrOwner(uint256 roles) virtual {
_checkRolesOrOwner(roles);
_;
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ROLE CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// IYKYK
uint256 internal constant _ROLE_0 = 1 << 0;
uint256 internal constant _ROLE_1 = 1 << 1;
uint256 internal constant _ROLE_2 = 1 << 2;
uint256 internal constant _ROLE_3 = 1 << 3;
uint256 internal constant _ROLE_4 = 1 << 4;
uint256 internal constant _ROLE_5 = 1 << 5;
uint256 internal constant _ROLE_6 = 1 << 6;
uint256 internal constant _ROLE_7 = 1 << 7;
uint256 internal constant _ROLE_8 = 1 << 8;
uint256 internal constant _ROLE_9 = 1 << 9;
uint256 internal constant _ROLE_10 = 1 << 10;
uint256 internal constant _ROLE_11 = 1 << 11;
uint256 internal constant _ROLE_12 = 1 << 12;
uint256 internal constant _ROLE_13 = 1 << 13;
uint256 internal constant _ROLE_14 = 1 << 14;
uint256 internal constant _ROLE_15 = 1 << 15;
uint256 internal constant _ROLE_16 = 1 << 16;
uint256 internal constant _ROLE_17 = 1 << 17;
uint256 internal constant _ROLE_18 = 1 << 18;
uint256 internal constant _ROLE_19 = 1 << 19;
uint256 internal constant _ROLE_20 = 1 << 20;
uint256 internal constant _ROLE_21 = 1 << 21;
uint256 internal constant _ROLE_22 = 1 << 22;
uint256 internal constant _ROLE_23 = 1 << 23;
uint256 internal constant _ROLE_24 = 1 << 24;
uint256 internal constant _ROLE_25 = 1 << 25;
uint256 internal constant _ROLE_26 = 1 << 26;
uint256 internal constant _ROLE_27 = 1 << 27;
uint256 internal constant _ROLE_28 = 1 << 28;
uint256 internal constant _ROLE_29 = 1 << 29;
uint256 internal constant _ROLE_30 = 1 << 30;
uint256 internal constant _ROLE_31 = 1 << 31;
uint256 internal constant _ROLE_32 = 1 << 32;
uint256 internal constant _ROLE_33 = 1 << 33;
uint256 internal constant _ROLE_34 = 1 << 34;
uint256 internal constant _ROLE_35 = 1 << 35;
uint256 internal constant _ROLE_36 = 1 << 36;
uint256 internal constant _ROLE_37 = 1 << 37;
uint256 internal constant _ROLE_38 = 1 << 38;
uint256 internal constant _ROLE_39 = 1 << 39;
uint256 internal constant _ROLE_40 = 1 << 40;
uint256 internal constant _ROLE_41 = 1 << 41;
uint256 internal constant _ROLE_42 = 1 << 42;
uint256 internal constant _ROLE_43 = 1 << 43;
uint256 internal constant _ROLE_44 = 1 << 44;
uint256 internal constant _ROLE_45 = 1 << 45;
uint256 internal constant _ROLE_46 = 1 << 46;
uint256 internal constant _ROLE_47 = 1 << 47;
uint256 internal constant _ROLE_48 = 1 << 48;
uint256 internal constant _ROLE_49 = 1 << 49;
uint256 internal constant _ROLE_50 = 1 << 50;
uint256 internal constant _ROLE_51 = 1 << 51;
uint256 internal constant _ROLE_52 = 1 << 52;
uint256 internal constant _ROLE_53 = 1 << 53;
uint256 internal constant _ROLE_54 = 1 << 54;
uint256 internal constant _ROLE_55 = 1 << 55;
uint256 internal constant _ROLE_56 = 1 << 56;
uint256 internal constant _ROLE_57 = 1 << 57;
uint256 internal constant _ROLE_58 = 1 << 58;
uint256 internal constant _ROLE_59 = 1 << 59;
uint256 internal constant _ROLE_60 = 1 << 60;
uint256 internal constant _ROLE_61 = 1 << 61;
uint256 internal constant _ROLE_62 = 1 << 62;
uint256 internal constant _ROLE_63 = 1 << 63;
uint256 internal constant _ROLE_64 = 1 << 64;
uint256 internal constant _ROLE_65 = 1 << 65;
uint256 internal constant _ROLE_66 = 1 << 66;
uint256 internal constant _ROLE_67 = 1 << 67;
uint256 internal constant _ROLE_68 = 1 << 68;
uint256 internal constant _ROLE_69 = 1 << 69;
uint256 internal constant _ROLE_70 = 1 << 70;
uint256 internal constant _ROLE_71 = 1 << 71;
uint256 internal constant _ROLE_72 = 1 << 72;
uint256 internal constant _ROLE_73 = 1 << 73;
uint256 internal constant _ROLE_74 = 1 << 74;
uint256 internal constant _ROLE_75 = 1 << 75;
uint256 internal constant _ROLE_76 = 1 << 76;
uint256 internal constant _ROLE_77 = 1 << 77;
uint256 internal constant _ROLE_78 = 1 << 78;
uint256 internal constant _ROLE_79 = 1 << 79;
uint256 internal constant _ROLE_80 = 1 << 80;
uint256 internal constant _ROLE_81 = 1 << 81;
uint256 internal constant _ROLE_82 = 1 << 82;
uint256 internal constant _ROLE_83 = 1 << 83;
uint256 internal constant _ROLE_84 = 1 << 84;
uint256 internal constant _ROLE_85 = 1 << 85;
uint256 internal constant _ROLE_86 = 1 << 86;
uint256 internal constant _ROLE_87 = 1 << 87;
uint256 internal constant _ROLE_88 = 1 << 88;
uint256 internal constant _ROLE_89 = 1 << 89;
uint256 internal constant _ROLE_90 = 1 << 90;
uint256 internal constant _ROLE_91 = 1 << 91;
uint256 internal constant _ROLE_92 = 1 << 92;
uint256 internal constant _ROLE_93 = 1 << 93;
uint256 internal constant _ROLE_94 = 1 << 94;
uint256 internal constant _ROLE_95 = 1 << 95;
uint256 internal constant _ROLE_96 = 1 << 96;
uint256 internal constant _ROLE_97 = 1 << 97;
uint256 internal constant _ROLE_98 = 1 << 98;
uint256 internal constant _ROLE_99 = 1 << 99;
uint256 internal constant _ROLE_100 = 1 << 100;
uint256 internal constant _ROLE_101 = 1 << 101;
uint256 internal constant _ROLE_102 = 1 << 102;
uint256 internal constant _ROLE_103 = 1 << 103;
uint256 internal constant _ROLE_104 = 1 << 104;
uint256 internal constant _ROLE_105 = 1 << 105;
uint256 internal constant _ROLE_106 = 1 << 106;
uint256 internal constant _ROLE_107 = 1 << 107;
uint256 internal constant _ROLE_108 = 1 << 108;
uint256 internal constant _ROLE_109 = 1 << 109;
uint256 internal constant _ROLE_110 = 1 << 110;
uint256 internal constant _ROLE_111 = 1 << 111;
uint256 internal constant _ROLE_112 = 1 << 112;
uint256 internal constant _ROLE_113 = 1 << 113;
uint256 internal constant _ROLE_114 = 1 << 114;
uint256 internal constant _ROLE_115 = 1 << 115;
uint256 internal constant _ROLE_116 = 1 << 116;
uint256 internal constant _ROLE_117 = 1 << 117;
uint256 internal constant _ROLE_118 = 1 << 118;
uint256 internal constant _ROLE_119 = 1 << 119;
uint256 internal constant _ROLE_120 = 1 << 120;
uint256 internal constant _ROLE_121 = 1 << 121;
uint256 internal constant _ROLE_122 = 1 << 122;
uint256 internal constant _ROLE_123 = 1 << 123;
uint256 internal constant _ROLE_124 = 1 << 124;
uint256 internal constant _ROLE_125 = 1 << 125;
uint256 internal constant _ROLE_126 = 1 << 126;
uint256 internal constant _ROLE_127 = 1 << 127;
uint256 internal constant _ROLE_128 = 1 << 128;
uint256 internal constant _ROLE_129 = 1 << 129;
uint256 internal constant _ROLE_130 = 1 << 130;
uint256 internal constant _ROLE_131 = 1 << 131;
uint256 internal constant _ROLE_132 = 1 << 132;
uint256 internal constant _ROLE_133 = 1 << 133;
uint256 internal constant _ROLE_134 = 1 << 134;
uint256 internal constant _ROLE_135 = 1 << 135;
uint256 internal constant _ROLE_136 = 1 << 136;
uint256 internal constant _ROLE_137 = 1 << 137;
uint256 internal constant _ROLE_138 = 1 << 138;
uint256 internal constant _ROLE_139 = 1 << 139;
uint256 internal constant _ROLE_140 = 1 << 140;
uint256 internal constant _ROLE_141 = 1 << 141;
uint256 internal constant _ROLE_142 = 1 << 142;
uint256 internal constant _ROLE_143 = 1 << 143;
uint256 internal constant _ROLE_144 = 1 << 144;
uint256 internal constant _ROLE_145 = 1 << 145;
uint256 internal constant _ROLE_146 = 1 << 146;
uint256 internal constant _ROLE_147 = 1 << 147;
uint256 internal constant _ROLE_148 = 1 << 148;
uint256 internal constant _ROLE_149 = 1 << 149;
uint256 internal constant _ROLE_150 = 1 << 150;
uint256 internal constant _ROLE_151 = 1 << 151;
uint256 internal constant _ROLE_152 = 1 << 152;
uint256 internal constant _ROLE_153 = 1 << 153;
uint256 internal constant _ROLE_154 = 1 << 154;
uint256 internal constant _ROLE_155 = 1 << 155;
uint256 internal constant _ROLE_156 = 1 << 156;
uint256 internal constant _ROLE_157 = 1 << 157;
uint256 internal constant _ROLE_158 = 1 << 158;
uint256 internal constant _ROLE_159 = 1 << 159;
uint256 internal constant _ROLE_160 = 1 << 160;
uint256 internal constant _ROLE_161 = 1 << 161;
uint256 internal constant _ROLE_162 = 1 << 162;
uint256 internal constant _ROLE_163 = 1 << 163;
uint256 internal constant _ROLE_164 = 1 << 164;
uint256 internal constant _ROLE_165 = 1 << 165;
uint256 internal constant _ROLE_166 = 1 << 166;
uint256 internal constant _ROLE_167 = 1 << 167;
uint256 internal constant _ROLE_168 = 1 << 168;
uint256 internal constant _ROLE_169 = 1 << 169;
uint256 internal constant _ROLE_170 = 1 << 170;
uint256 internal constant _ROLE_171 = 1 << 171;
uint256 internal constant _ROLE_172 = 1 << 172;
uint256 internal constant _ROLE_173 = 1 << 173;
uint256 internal constant _ROLE_174 = 1 << 174;
uint256 internal constant _ROLE_175 = 1 << 175;
uint256 internal constant _ROLE_176 = 1 << 176;
uint256 internal constant _ROLE_177 = 1 << 177;
uint256 internal constant _ROLE_178 = 1 << 178;
uint256 internal constant _ROLE_179 = 1 << 179;
uint256 internal constant _ROLE_180 = 1 << 180;
uint256 internal constant _ROLE_181 = 1 << 181;
uint256 internal constant _ROLE_182 = 1 << 182;
uint256 internal constant _ROLE_183 = 1 << 183;
uint256 internal constant _ROLE_184 = 1 << 184;
uint256 internal constant _ROLE_185 = 1 << 185;
uint256 internal constant _ROLE_186 = 1 << 186;
uint256 internal constant _ROLE_187 = 1 << 187;
uint256 internal constant _ROLE_188 = 1 << 188;
uint256 internal constant _ROLE_189 = 1 << 189;
uint256 internal constant _ROLE_190 = 1 << 190;
uint256 internal constant _ROLE_191 = 1 << 191;
uint256 internal constant _ROLE_192 = 1 << 192;
uint256 internal constant _ROLE_193 = 1 << 193;
uint256 internal constant _ROLE_194 = 1 << 194;
uint256 internal constant _ROLE_195 = 1 << 195;
uint256 internal constant _ROLE_196 = 1 << 196;
uint256 internal constant _ROLE_197 = 1 << 197;
uint256 internal constant _ROLE_198 = 1 << 198;
uint256 internal constant _ROLE_199 = 1 << 199;
uint256 internal constant _ROLE_200 = 1 << 200;
uint256 internal constant _ROLE_201 = 1 << 201;
uint256 internal constant _ROLE_202 = 1 << 202;
uint256 internal constant _ROLE_203 = 1 << 203;
uint256 internal constant _ROLE_204 = 1 << 204;
uint256 internal constant _ROLE_205 = 1 << 205;
uint256 internal constant _ROLE_206 = 1 << 206;
uint256 internal constant _ROLE_207 = 1 << 207;
uint256 internal constant _ROLE_208 = 1 << 208;
uint256 internal constant _ROLE_209 = 1 << 209;
uint256 internal constant _ROLE_210 = 1 << 210;
uint256 internal constant _ROLE_211 = 1 << 211;
uint256 internal constant _ROLE_212 = 1 << 212;
uint256 internal constant _ROLE_213 = 1 << 213;
uint256 internal constant _ROLE_214 = 1 << 214;
uint256 internal constant _ROLE_215 = 1 << 215;
uint256 internal constant _ROLE_216 = 1 << 216;
uint256 internal constant _ROLE_217 = 1 << 217;
uint256 internal constant _ROLE_218 = 1 << 218;
uint256 internal constant _ROLE_219 = 1 << 219;
uint256 internal constant _ROLE_220 = 1 << 220;
uint256 internal constant _ROLE_221 = 1 << 221;
uint256 internal constant _ROLE_222 = 1 << 222;
uint256 internal constant _ROLE_223 = 1 << 223;
uint256 internal constant _ROLE_224 = 1 << 224;
uint256 internal constant _ROLE_225 = 1 << 225;
uint256 internal constant _ROLE_226 = 1 << 226;
uint256 internal constant _ROLE_227 = 1 << 227;
uint256 internal constant _ROLE_228 = 1 << 228;
uint256 internal constant _ROLE_229 = 1 << 229;
uint256 internal constant _ROLE_230 = 1 << 230;
uint256 internal constant _ROLE_231 = 1 << 231;
uint256 internal constant _ROLE_232 = 1 << 232;
uint256 internal constant _ROLE_233 = 1 << 233;
uint256 internal constant _ROLE_234 = 1 << 234;
uint256 internal constant _ROLE_235 = 1 << 235;
uint256 internal constant _ROLE_236 = 1 << 236;
uint256 internal constant _ROLE_237 = 1 << 237;
uint256 internal constant _ROLE_238 = 1 << 238;
uint256 internal constant _ROLE_239 = 1 << 239;
uint256 internal constant _ROLE_240 = 1 << 240;
uint256 internal constant _ROLE_241 = 1 << 241;
uint256 internal constant _ROLE_242 = 1 << 242;
uint256 internal constant _ROLE_243 = 1 << 243;
uint256 internal constant _ROLE_244 = 1 << 244;
uint256 internal constant _ROLE_245 = 1 << 245;
uint256 internal constant _ROLE_246 = 1 << 246;
uint256 internal constant _ROLE_247 = 1 << 247;
uint256 internal constant _ROLE_248 = 1 << 248;
uint256 internal constant _ROLE_249 = 1 << 249;
uint256 internal constant _ROLE_250 = 1 << 250;
uint256 internal constant _ROLE_251 = 1 << 251;
uint256 internal constant _ROLE_252 = 1 << 252;
uint256 internal constant _ROLE_253 = 1 << 253;
uint256 internal constant _ROLE_254 = 1 << 254;
uint256 internal constant _ROLE_255 = 1 << 255;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Simple single owner authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract Ownable {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The caller is not authorized to call the function.
error Unauthorized();
/// @dev The `newOwner` cannot be the zero address.
error NewOwnerIsZeroAddress();
/// @dev The `pendingOwner` does not have a valid handover request.
error NoHandoverRequest();
/// @dev Cannot double-initialize.
error AlreadyInitialized();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* EVENTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The ownership is transferred from `oldOwner` to `newOwner`.
/// This event is intentionally kept the same as OpenZeppelin's Ownable to be
/// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
/// despite it not being as lightweight as a single argument event.
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
/// @dev An ownership handover to `pendingOwner` has been requested.
event OwnershipHandoverRequested(address indexed pendingOwner);
/// @dev The ownership handover to `pendingOwner` has been canceled.
event OwnershipHandoverCanceled(address indexed pendingOwner);
/// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;
/// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;
/// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* STORAGE */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The owner slot is given by:
/// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`.
/// It is intentionally chosen to be a high value
/// to avoid collision with lower slots.
/// The choice of manual storage layout is to enable compatibility
/// with both regular and upgradeable contracts.
bytes32 internal constant _OWNER_SLOT =
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;
/// The ownership handover slot of `newOwner` is given by:
/// ```
/// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
/// let handoverSlot := keccak256(0x00, 0x20)
/// ```
/// It stores the expiry timestamp of the two-step ownership handover.
uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* INTERNAL FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Override to return true to make `_initializeOwner` prevent double-initialization.
function _guardInitializeOwner() internal pure virtual returns (bool guard) {}
/// @dev Initializes the owner directly without authorization guard.
/// This function must be called upon initialization,
/// regardless of whether the contract is upgradeable or not.
/// This is to enable generalization to both regular and upgradeable contracts,
/// and to save gas in case the initial owner is not the caller.
/// For performance reasons, this function will not check if there
/// is an existing owner.
function _initializeOwner(address newOwner) internal virtual {
if (_guardInitializeOwner()) {
/// @solidity memory-safe-assembly
assembly {
let ownerSlot := _OWNER_SLOT
if sload(ownerSlot) {
mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.
revert(0x1c, 0x04)
}
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Store the new value.
sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
}
} else {
/// @solidity memory-safe-assembly
assembly {
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Store the new value.
sstore(_OWNER_SLOT, newOwner)
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
}
}
}
/// @dev Sets the owner directly without authorization guard.
function _setOwner(address newOwner) internal virtual {
if (_guardInitializeOwner()) {
/// @solidity memory-safe-assembly
assembly {
let ownerSlot := _OWNER_SLOT
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
// Store the new value.
sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
}
} else {
/// @solidity memory-safe-assembly
assembly {
let ownerSlot := _OWNER_SLOT
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
// Store the new value.
sstore(ownerSlot, newOwner)
}
}
}
/// @dev Throws if the sender is not the owner.
function _checkOwner() internal view virtual {
/// @solidity memory-safe-assembly
assembly {
// If the caller is not the stored owner, revert.
if iszero(eq(caller(), sload(_OWNER_SLOT))) {
mstore(0x00, 0x82b42900) // `Unauthorized()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Returns how long a two-step ownership handover is valid for in seconds.
/// Override to return a different value if needed.
/// Made internal to conserve bytecode. Wrap it in a public function if needed.
function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
return 48 * 3600;
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC UPDATE FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Allows the owner to transfer the ownership to `newOwner`.
function transferOwnership(address newOwner) public payable virtual onlyOwner {
/// @solidity memory-safe-assembly
assembly {
if iszero(shl(96, newOwner)) {
mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
revert(0x1c, 0x04)
}
}
_setOwner(newOwner);
}
/// @dev Allows the owner to renounce their ownership.
function renounceOwnership() public payable virtual onlyOwner {
_setOwner(address(0));
}
/// @dev Request a two-step ownership handover to the caller.
/// The request will automatically expire in 48 hours (172800 seconds) by default.
function requestOwnershipHandover() public payable virtual {
unchecked {
uint256 expires = block.timestamp + _ownershipHandoverValidFor();
/// @solidity memory-safe-assembly
assembly {
// Compute and set the handover slot to `expires`.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, caller())
sstore(keccak256(0x0c, 0x20), expires)
// Emit the {OwnershipHandoverRequested} event.
log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
}
}
}
/// @dev Cancels the two-step ownership handover to the caller, if any.
function cancelOwnershipHandover() public payable virtual {
/// @solidity memory-safe-assembly
assembly {
// Compute and set the handover slot to 0.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, caller())
sstore(keccak256(0x0c, 0x20), 0)
// Emit the {OwnershipHandoverCanceled} event.
log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
}
}
/// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
/// Reverts if there is no existing ownership handover requested by `pendingOwner`.
function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
/// @solidity memory-safe-assembly
assembly {
// Compute and set the handover slot to 0.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, pendingOwner)
let handoverSlot := keccak256(0x0c, 0x20)
// If the handover does not exist, or has expired.
if gt(timestamp(), sload(handoverSlot)) {
mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.
revert(0x1c, 0x04)
}
// Set the handover slot to 0.
sstore(handoverSlot, 0)
}
_setOwner(pendingOwner);
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC READ FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns the owner of the contract.
function owner() public view virtual returns (address result) {
/// @solidity memory-safe-assembly
assembly {
result := sload(_OWNER_SLOT)
}
}
/// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
function ownershipHandoverExpiresAt(address pendingOwner)
public
view
virtual
returns (uint256 result)
{
/// @solidity memory-safe-assembly
assembly {
// Compute the handover slot.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, pendingOwner)
// Load the handover slot.
result := sload(keccak256(0x0c, 0x20))
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* MODIFIERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Marks a function as only callable by the owner.
modifier onlyOwner() virtual {
_checkOwner();
_;
}
}{
"remappings": [
"solady/=lib/solady/src/",
"forge-std/=lib/forge-std/src/"
],
"optimizer": {
"enabled": false,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"MintFailed","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"RedemptionCodeAlreadyUsed","type":"error"},{"inputs":[],"name":"RedemptionCodeNotFound","type":"error"},{"inputs":[],"name":"RedemptionDataLengthMismatch","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"roles","type":"uint256"}],"name":"RolesUpdated","type":"event"},{"inputs":[],"name":"CODE_MANAGEMENT_ROLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"grantRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAllRoles","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAnyRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"redemptionCodeHashes","type":"bytes32[]"}],"name":"invalidateRedemptionCodes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes32","name":"redemptionCode","type":"bytes32"}],"name":"redeemRedemptionCode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redemptionCodeHash","type":"bytes32"}],"name":"redemptionCodeHashToRedemption","outputs":[{"internalType":"bytes32","name":"redemptionData","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"redemptionCodeHashes","type":"bytes32[]"},{"internalType":"bytes32[]","name":"redemptionData","type":"bytes32[]"}],"name":"registerRedemptionCodes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"renounceRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"revokeRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"rolesOf","outputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redemptionCodeHash","type":"bytes32"}],"name":"usedRedemptionCodes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561000f575f5ffd5b5061001f3261003d60201b60201c565b610038326820000000000000000061011960201b60201c565b61018b565b61004b61012f60201b60201c565b156100c3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561008557630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa350610116565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa35b50565b61012b8282600161013360201b60201c565b5050565b5f90565b638b78c6d8600c52825f526020600c2080548381178361015557848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b610fc2806101985f395ff3fe608060405260043610610113575f3560e01c80634a4ee7b11161009f5780639a23a0f0116100635780639a23a0f01461031b578063add438ce14610357578063f04e283e14610381578063f2fde38b1461039d578063fee81cf4146103b957610113565b80634a4ee7b114610285578063514e62fc146102a157806354d1f13d146102dd578063715018a6146102e75780638da5cb5b146102f157610113565b8063183a4f6e116100e6578063183a4f6e146101cb5780631c10893f146101e75780631cd64df414610203578063256929621461023f5780632de948071461024957610113565b80630c3596e3146101175780630e9514681461013f5780631246966d1461016757806313455b941461018f575b5f5ffd5b348015610122575f5ffd5b5061013d60048036038101906101389190610b9b565b6103f5565b005b34801561014a575f5ffd5b5061016560048036038101906101609190610c3a565b610613565b005b348015610172575f5ffd5b5061018d60048036038101906101889190610cb8565b6106d1565b005b34801561019a575f5ffd5b506101b560048036038101906101b09190610d03565b610737565b6040516101c29190610d3d565b60405180910390f35b6101e560048036038101906101e09190610d89565b61074b565b005b61020160048036038101906101fc9190610db4565b610758565b005b34801561020e575f5ffd5b5061022960048036038101906102249190610db4565b61076e565b6040516102369190610e0c565b60405180910390f35b610247610784565b005b348015610254575f5ffd5b5061026f600480360381019061026a9190610e25565b6107d5565b60405161027c9190610e5f565b60405180910390f35b61029f600480360381019061029a9190610db4565b6107ee565b005b3480156102ac575f5ffd5b506102c760048036038101906102c29190610db4565b610804565b6040516102d49190610e0c565b60405180910390f35b6102e561081b565b005b6102ef610854565b005b3480156102fc575f5ffd5b50610305610867565b6040516103129190610e87565b60405180910390f35b348015610326575f5ffd5b50610341600480360381019061033c9190610d03565b61088f565b60405161034e9190610e0c565b60405180910390f35b348015610362575f5ffd5b5061036b6108ac565b6040516103789190610e5f565b60405180910390f35b61039b60048036038101906103969190610e25565b6108b9565b005b6103b760048036038101906103b29190610e25565b6108f7565b005b3480156103c4575f5ffd5b506103df60048036038101906103da9190610e25565b610920565b6040516103ec9190610e5f565b60405180910390f35b5f5f5f836040516020016104099190610d3d565b6040516020818303038152906040528051906020012081526020019081526020015f205490505f5f1b810361046a576040517f93d44cbf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015f8381526020019081526020015f205f9054906101000a900460ff16156104bf576040517f29b1392500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805f8481526020019081526020015f205f6101000a81548160ff0219169083151502179055505f5f5f6104f384610939565b9250925092505f8173ffffffffffffffffffffffffffffffffffffffff168488858960405160240161052793929190610ec2565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105919190610f49565b5f604051808303815f865af19150503d805f81146105ca576040519150601f19603f3d011682016040523d82523d5f602084013e6105cf565b606091505b505090508061060a576040517f07637bd800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050565b682000000000000000006106268161095d565b828290508585905014610665576040517f0fbeecc500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505b858590508110156106c95783838281811061068857610687610f5f565b5b905060200201355f5f8888858181106106a4576106a3610f5f565b5b9050602002013581526020019081526020015f2081905550808060010191505061066a565b505050505050565b682000000000000000006106e48161095d565b5f5f90505b83839050811015610731575f5f1b5f5f86868581811061070c5761070b610f5f565b5b9050602002013581526020019081526020015f208190555080806001019150506106e9565b50505050565b5f602052805f5260405f205f915090505481565b6107553382610984565b50565b610760610993565b61076a82826109ca565b5050565b5f818261077a856107d5565b1614905092915050565b5f61078d6109da565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f5fa250565b5f638b78c6d8600c52815f526020600c20549050919050565b6107f6610993565b6108008282610984565b5050565b5f5f82610810856107d5565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f5fa2565b61085c610993565b6108655f6109e4565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b6820000000000000000081565b6108c1610993565b63389a75e1600c52805f526020600c2080544211156108e757636f5e88185f526004601cfd5b5f8155506108f4816109e4565b50565b6108ff610993565b8060601b61091457637448fbae5f526004601cfd5b61091d816109e4565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f5f5f835f1c60e01b9250602084901c5f1c9150606084901c5f1c90509193909250565b638b78c6d8600c52335f52806020600c205416610981576382b429005f526004601cfd5b50565b61098f82825f610aaa565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146109c8576382b429005f526004601cfd5b565b6109d682826001610aaa565b5050565b5f6202a300905090565b6109ec610b02565b15610a51577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b8217815550610aa7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b638b78c6d8600c52825f526020600c20805483811783610acc57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b5f90565b5f5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610b3782610b0e565b9050919050565b610b4781610b2d565b8114610b51575f5ffd5b50565b5f81359050610b6281610b3e565b92915050565b5f819050919050565b610b7a81610b68565b8114610b84575f5ffd5b50565b5f81359050610b9581610b71565b92915050565b5f5f60408385031215610bb157610bb0610b06565b5b5f610bbe85828601610b54565b9250506020610bcf85828601610b87565b9150509250929050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112610bfa57610bf9610bd9565b5b8235905067ffffffffffffffff811115610c1757610c16610bdd565b5b602083019150836020820283011115610c3357610c32610be1565b5b9250929050565b5f5f5f5f60408587031215610c5257610c51610b06565b5b5f85013567ffffffffffffffff811115610c6f57610c6e610b0a565b5b610c7b87828801610be5565b9450945050602085013567ffffffffffffffff811115610c9e57610c9d610b0a565b5b610caa87828801610be5565b925092505092959194509250565b5f5f60208385031215610cce57610ccd610b06565b5b5f83013567ffffffffffffffff811115610ceb57610cea610b0a565b5b610cf785828601610be5565b92509250509250929050565b5f60208284031215610d1857610d17610b06565b5b5f610d2584828501610b87565b91505092915050565b610d3781610b68565b82525050565b5f602082019050610d505f830184610d2e565b92915050565b5f819050919050565b610d6881610d56565b8114610d72575f5ffd5b50565b5f81359050610d8381610d5f565b92915050565b5f60208284031215610d9e57610d9d610b06565b5b5f610dab84828501610d75565b91505092915050565b5f5f60408385031215610dca57610dc9610b06565b5b5f610dd785828601610b54565b9250506020610de885828601610d75565b9150509250929050565b5f8115159050919050565b610e0681610df2565b82525050565b5f602082019050610e1f5f830184610dfd565b92915050565b5f60208284031215610e3a57610e39610b06565b5b5f610e4784828501610b54565b91505092915050565b610e5981610d56565b82525050565b5f602082019050610e725f830184610e50565b92915050565b610e8181610b2d565b82525050565b5f602082019050610e9a5f830184610e78565b92915050565b5f67ffffffffffffffff82169050919050565b610ebc81610ea0565b82525050565b5f606082019050610ed55f830186610e78565b610ee26020830185610eb3565b610eef6040830184610d2e565b949350505050565b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f610f2382610ef7565b610f2d8185610f01565b9350610f3d818560208601610f0b565b80840191505092915050565b5f610f548284610f19565b915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea26469706673582212202b061b585b990b796484df324fe3fe36470d7fca79b9cfe563bda777af863ddb64736f6c634300081c0033
Deployed Bytecode
0x608060405260043610610113575f3560e01c80634a4ee7b11161009f5780639a23a0f0116100635780639a23a0f01461031b578063add438ce14610357578063f04e283e14610381578063f2fde38b1461039d578063fee81cf4146103b957610113565b80634a4ee7b114610285578063514e62fc146102a157806354d1f13d146102dd578063715018a6146102e75780638da5cb5b146102f157610113565b8063183a4f6e116100e6578063183a4f6e146101cb5780631c10893f146101e75780631cd64df414610203578063256929621461023f5780632de948071461024957610113565b80630c3596e3146101175780630e9514681461013f5780631246966d1461016757806313455b941461018f575b5f5ffd5b348015610122575f5ffd5b5061013d60048036038101906101389190610b9b565b6103f5565b005b34801561014a575f5ffd5b5061016560048036038101906101609190610c3a565b610613565b005b348015610172575f5ffd5b5061018d60048036038101906101889190610cb8565b6106d1565b005b34801561019a575f5ffd5b506101b560048036038101906101b09190610d03565b610737565b6040516101c29190610d3d565b60405180910390f35b6101e560048036038101906101e09190610d89565b61074b565b005b61020160048036038101906101fc9190610db4565b610758565b005b34801561020e575f5ffd5b5061022960048036038101906102249190610db4565b61076e565b6040516102369190610e0c565b60405180910390f35b610247610784565b005b348015610254575f5ffd5b5061026f600480360381019061026a9190610e25565b6107d5565b60405161027c9190610e5f565b60405180910390f35b61029f600480360381019061029a9190610db4565b6107ee565b005b3480156102ac575f5ffd5b506102c760048036038101906102c29190610db4565b610804565b6040516102d49190610e0c565b60405180910390f35b6102e561081b565b005b6102ef610854565b005b3480156102fc575f5ffd5b50610305610867565b6040516103129190610e87565b60405180910390f35b348015610326575f5ffd5b50610341600480360381019061033c9190610d03565b61088f565b60405161034e9190610e0c565b60405180910390f35b348015610362575f5ffd5b5061036b6108ac565b6040516103789190610e5f565b60405180910390f35b61039b60048036038101906103969190610e25565b6108b9565b005b6103b760048036038101906103b29190610e25565b6108f7565b005b3480156103c4575f5ffd5b506103df60048036038101906103da9190610e25565b610920565b6040516103ec9190610e5f565b60405180910390f35b5f5f5f836040516020016104099190610d3d565b6040516020818303038152906040528051906020012081526020019081526020015f205490505f5f1b810361046a576040517f93d44cbf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015f8381526020019081526020015f205f9054906101000a900460ff16156104bf576040517f29b1392500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805f8481526020019081526020015f205f6101000a81548160ff0219169083151502179055505f5f5f6104f384610939565b9250925092505f8173ffffffffffffffffffffffffffffffffffffffff168488858960405160240161052793929190610ec2565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105919190610f49565b5f604051808303815f865af19150503d805f81146105ca576040519150601f19603f3d011682016040523d82523d5f602084013e6105cf565b606091505b505090508061060a576040517f07637bd800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050565b682000000000000000006106268161095d565b828290508585905014610665576040517f0fbeecc500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505b858590508110156106c95783838281811061068857610687610f5f565b5b905060200201355f5f8888858181106106a4576106a3610f5f565b5b9050602002013581526020019081526020015f2081905550808060010191505061066a565b505050505050565b682000000000000000006106e48161095d565b5f5f90505b83839050811015610731575f5f1b5f5f86868581811061070c5761070b610f5f565b5b9050602002013581526020019081526020015f208190555080806001019150506106e9565b50505050565b5f602052805f5260405f205f915090505481565b6107553382610984565b50565b610760610993565b61076a82826109ca565b5050565b5f818261077a856107d5565b1614905092915050565b5f61078d6109da565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f5fa250565b5f638b78c6d8600c52815f526020600c20549050919050565b6107f6610993565b6108008282610984565b5050565b5f5f82610810856107d5565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f5fa2565b61085c610993565b6108655f6109e4565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b6820000000000000000081565b6108c1610993565b63389a75e1600c52805f526020600c2080544211156108e757636f5e88185f526004601cfd5b5f8155506108f4816109e4565b50565b6108ff610993565b8060601b61091457637448fbae5f526004601cfd5b61091d816109e4565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f5f5f835f1c60e01b9250602084901c5f1c9150606084901c5f1c90509193909250565b638b78c6d8600c52335f52806020600c205416610981576382b429005f526004601cfd5b50565b61098f82825f610aaa565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146109c8576382b429005f526004601cfd5b565b6109d682826001610aaa565b5050565b5f6202a300905090565b6109ec610b02565b15610a51577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b8217815550610aa7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b638b78c6d8600c52825f526020600c20805483811783610acc57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b5f90565b5f5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610b3782610b0e565b9050919050565b610b4781610b2d565b8114610b51575f5ffd5b50565b5f81359050610b6281610b3e565b92915050565b5f819050919050565b610b7a81610b68565b8114610b84575f5ffd5b50565b5f81359050610b9581610b71565b92915050565b5f5f60408385031215610bb157610bb0610b06565b5b5f610bbe85828601610b54565b9250506020610bcf85828601610b87565b9150509250929050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112610bfa57610bf9610bd9565b5b8235905067ffffffffffffffff811115610c1757610c16610bdd565b5b602083019150836020820283011115610c3357610c32610be1565b5b9250929050565b5f5f5f5f60408587031215610c5257610c51610b06565b5b5f85013567ffffffffffffffff811115610c6f57610c6e610b0a565b5b610c7b87828801610be5565b9450945050602085013567ffffffffffffffff811115610c9e57610c9d610b0a565b5b610caa87828801610be5565b925092505092959194509250565b5f5f60208385031215610cce57610ccd610b06565b5b5f83013567ffffffffffffffff811115610ceb57610cea610b0a565b5b610cf785828601610be5565b92509250509250929050565b5f60208284031215610d1857610d17610b06565b5b5f610d2584828501610b87565b91505092915050565b610d3781610b68565b82525050565b5f602082019050610d505f830184610d2e565b92915050565b5f819050919050565b610d6881610d56565b8114610d72575f5ffd5b50565b5f81359050610d8381610d5f565b92915050565b5f60208284031215610d9e57610d9d610b06565b5b5f610dab84828501610d75565b91505092915050565b5f5f60408385031215610dca57610dc9610b06565b5b5f610dd785828601610b54565b9250506020610de885828601610d75565b9150509250929050565b5f8115159050919050565b610e0681610df2565b82525050565b5f602082019050610e1f5f830184610dfd565b92915050565b5f60208284031215610e3a57610e39610b06565b5b5f610e4784828501610b54565b91505092915050565b610e5981610d56565b82525050565b5f602082019050610e725f830184610e50565b92915050565b610e8181610b2d565b82525050565b5f602082019050610e9a5f830184610e78565b92915050565b5f67ffffffffffffffff82169050919050565b610ebc81610ea0565b82525050565b5f606082019050610ed55f830186610e78565b610ee26020830185610eb3565b610eef6040830184610d2e565b949350505050565b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f610f2382610ef7565b610f2d8185610f01565b9350610f3d818560208601610f0b565b80840191505092915050565b5f610f548284610f19565b915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea26469706673582212202b061b585b990b796484df324fe3fe36470d7fca79b9cfe563bda777af863ddb64736f6c634300081c0033
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.