Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
570453 | 31 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
VisibilityCredits
Compiler Version
v0.8.26+commit.8a97fa7a
ZkSolc Version
v1.5.11
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import "./interfaces/IVisibilityCredits.sol"; /** * @title VisibilityCredits * @notice Allows users to buy and sell visibility credits along a bonding curve. * @dev Users can spend these credits for ad purposes. */ contract VisibilityCredits is IVisibilityCredits, AccessControlDefaultAdminRulesUpgradeable, ReentrancyGuardUpgradeable { /// @dev to avoid overflow on bonding curve computations uint64 public constant MAX_TOTAL_SUPPLY = type(uint64).max; // 2^64 - 1 = 18_446_744_073_709_551_615 /** * @notice Users can purchase and sell visibility credits according to a bonding curve. * * @dev The bonding curve is defined by the formula: * PRICE (in wei) = BASE_PRICE + A * totalSupply^2 + B * totalSupply * - BASE_PRICE: The initial price when totalSupply is zero. * - A: Bonding curve quadratic factor, a constant that determine the curvature of the price function * - B: Bonding curve linear factor, a constant that determine the slope of the price function */ uint16 public constant A = 15; uint32 public constant B = 25_000; uint32 public constant BASE_PRICE = 10_000_000; /// @notice Fee percentages in ppm (parts per million). uint32 public constant FEE_DENOMINATOR = 1_000_000; // Using parts per million (ppm) uint16 public constant CREATOR_FEE = 20_000; // 2% fee to the creator for each trade uint16 public constant PROTOCOL_FEE = 30_000; // 3% base fee, should be higher than referrer fee + partner fee + referral bonus fee uint16 public constant REFERRER_FEE = 10_000; // 1% fee to the referrer (if any, deduced from protocol fee) uint16 public constant PARTNER_FEE = 250; // 0.25% bonus for the partner/marketing agency if linked to a referrer (deduced from protocol fee) uint16 public constant PARTNER_REFERRER_BONUS = 250; // 0.25% bonus for the referrer if linked to a partner (deduced from protocol fee) bytes32 public constant CREDITS_TRANSFER_ROLE = keccak256("CREDITS_TRANSFER_ROLE"); bytes32 public constant CREATORS_LINKER_ROLE = keccak256("CREATORS_LINKER_ROLE"); bytes32 public constant PARTNERS_LINKER_ROLE = keccak256("PARTNERS_LINKER_ROLE"); /// @custom:storage-location erc7201:noodles.VisibilityCredits struct VisibilityCreditsStorage { address payable protocolTreasury; /** * @notice Referrers can be linked to partners/marketing agencies to receive a fee bonus. * The bonus is a percentage of the trading cost, deducted from the protocol fee. * The bonus is split between the referrer and the partner. * @dev referrer address => partner address */ mapping(address => address) referrersToPartners; /** * @notice Record the last referral for each user. The referral still receives a bonus until the user trades with a new referrer. * The bonus is a percentage of the trading cost, deducted from the protocol fee. * @dev user address => referrer address */ mapping(address => address) usersToReferrers; /** * @notice This contract is agnostic to specific visibility interfaces. * We define a naming convention for visibility IDs: `{platformPrefix}-{immutableId}`. * For example, `x-807982663000674305` links visibility credits to Luca Netz's X (formerly Twitter, rest_id = 807982663000674305) account. * This approach allows for easy extension to other platforms by using different prefixes. * * @dev Access a creator's visibility information using `visibilityCredits[visibilityId]`, where: * `bytes32 visibilityId = keccak256(abi.encode(visibilityIdString));` */ mapping(bytes32 => Visibility) visibilityCredits; } // keccak256(abi.encode(uint256(keccak256("noodles.VisibilityCredits")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant VisibilityCreditsStorageLocation = 0x8b198ca743c7949447acc2a3ece04f744837fdfd02f0b1dab89bda5a49167b00; function _getVisibilityCreditsStorage() private pure returns (VisibilityCreditsStorage storage $) { assembly { $.slot := VisibilityCreditsStorageLocation } } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } /** * @notice Initializes the contract with the protocol treasury, a creators linker and a partners linker. * @param adminDelay The delay for admin role changes. * @param admin The address than can manage with admin role. * @param creatorsLinker The address that can set a creator address for a specific visibility ID. * @param partnersLinker The address that can set a partner address for a referrer address. * @param treasury The address of the protocol treasury. * * @dev Contract deployer is the default admin (`DEFAULT_ADMIN_ROLE`) at deployment. * The `AccessControlDefaultAdminRules` contract manages admin access with a delay for changes. */ function initialize( uint48 adminDelay, address admin, address creatorsLinker, address partnersLinker, address treasury ) public initializer { if (admin == address(0)) revert InvalidAddress(); if (creatorsLinker == address(0)) revert InvalidAddress(); if (partnersLinker == address(0)) revert InvalidAddress(); if (treasury == address(0)) revert InvalidAddress(); VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); $.protocolTreasury = payable(treasury); __AccessControlDefaultAdminRules_init_unchained(adminDelay, admin); _grantRole(CREATORS_LINKER_ROLE, creatorsLinker); _grantRole(PARTNERS_LINKER_ROLE, partnersLinker); __ReentrancyGuard_init_unchained(); } /** * @notice Buys a specified amount of visibility credits. * @dev Users must send sufficient Ether to cover the cost from bonding curve + fees. * @param visibilityId The ID representing the visibility credits. * @param amount The amount of credits to buy. * @param inputReferrer The address of the referrer (optional). */ function buyCredits( string calldata visibilityId, uint256 amount, address inputReferrer ) external payable nonReentrant { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); Visibility storage visibility = $.visibilityCredits[ getVisibilityKey(visibilityId) ]; uint256 totalSupply = visibility.totalSupply; if (totalSupply + amount > MAX_TOTAL_SUPPLY) { revert InvalidAmount(); } Trade memory trade = _tradeCostWithFees( totalSupply, amount, true, msg.sender, inputReferrer ); uint256 totalCost = trade.tradeCost + trade.creatorFee + trade.protocolFee + trade.referrerFee + trade.partnerFee; if (msg.value < totalCost) { revert NotEnoughEthSent(); } totalSupply += amount; visibility.totalSupply = totalSupply; visibility.claimableFeeBalance += trade.creatorFee; visibility.creditBalances[msg.sender] += amount; if (trade.referrer != $.usersToReferrers[msg.sender]) { $.usersToReferrers[msg.sender] = trade.referrer; } if (trade.referrerFee > 0) { Address.sendValue(payable(trade.referrer), trade.referrerFee); } if (trade.partnerFee > 0) { Address.sendValue(payable(trade.partner), trade.partnerFee); } Address.sendValue($.protocolTreasury, trade.protocolFee); // Refund excess Ether sent if (msg.value > totalCost) { Address.sendValue(payable(msg.sender), msg.value - totalCost); } CreditsTradeEvent memory tradeEvent = CreditsTradeEvent({ from: msg.sender, visibilityId: visibilityId, amount: amount, isBuy: true, tradeCost: trade.tradeCost, creatorFee: trade.creatorFee, protocolFee: trade.protocolFee, referrerFee: trade.referrerFee, partnerFee: trade.partnerFee, referrer: trade.referrer, partner: trade.partner, newTotalSupply: totalSupply }); emit CreditsTrade(tradeEvent); } /** * @notice Sells a specified amount of visibility credits. * @dev Users receive Ether minus applicable fees. * @param visibilityId The ID representing the visibility credits. * @param amount The amount of credits to sell. * @param inputReferrer The address of the referrer (optional). */ function sellCredits( string calldata visibilityId, uint256 amount, address inputReferrer ) external nonReentrant { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); Visibility storage visibility = $.visibilityCredits[ getVisibilityKey(visibilityId) ]; if (visibility.creditBalances[msg.sender] < amount) { revert NotEnoughCreditsOwned(); } uint256 totalSupply = visibility.totalSupply; Trade memory trade = _tradeCostWithFees( totalSupply, amount, false, msg.sender, inputReferrer ); uint256 reimbursement = trade.tradeCost - trade.creatorFee - trade.protocolFee - trade.referrerFee - trade.partnerFee; totalSupply -= amount; visibility.totalSupply = totalSupply; visibility.claimableFeeBalance += trade.creatorFee; visibility.creditBalances[msg.sender] -= amount; if (trade.referrer != $.usersToReferrers[msg.sender]) { $.usersToReferrers[msg.sender] = trade.referrer; } if (trade.referrerFee > 0) { Address.sendValue(payable(trade.referrer), trade.referrerFee); } if (trade.partnerFee > 0) { Address.sendValue(payable(trade.partner), trade.partnerFee); } Address.sendValue($.protocolTreasury, trade.protocolFee); Address.sendValue(payable(msg.sender), reimbursement); CreditsTradeEvent memory tradeEvent = CreditsTradeEvent({ from: msg.sender, visibilityId: visibilityId, amount: amount, isBuy: false, tradeCost: trade.tradeCost, creatorFee: trade.creatorFee, protocolFee: trade.protocolFee, referrerFee: trade.referrerFee, partnerFee: trade.partnerFee, referrer: trade.referrer, partner: trade.partner, newTotalSupply: totalSupply }); emit CreditsTrade(tradeEvent); } /** * @notice Allows creators to claim their accumulated fees. * @param visibilityId The ID representing the visibility credits. */ function claimCreatorFee( string calldata visibilityId ) external nonReentrant { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); Visibility storage visibility = $.visibilityCredits[ getVisibilityKey(visibilityId) ]; uint256 claimableFeeBalance = visibility.claimableFeeBalance; if (claimableFeeBalance == 0) { revert InvalidAmount(); } address creator = visibility.creator; if (creator == address(0)) { revert InvalidCreator(); } visibility.claimableFeeBalance = 0; Address.sendValue(payable(creator), claimableFeeBalance); emit CreatorFeeClaimed( creator, claimableFeeBalance, visibilityId, msg.sender ); } /** * @notice Grants the `CREDITS_TRANSFER_ROLE` to a specified account. * @dev Only callable by an account with the `DEFAULT_ADMIN_ROLE`. * @param grantee The address to grant the role. * */ function grantCreatorTransferRole( address grantee ) external onlyRole(DEFAULT_ADMIN_ROLE) { _grantRole(CREDITS_TRANSFER_ROLE, grantee); } /** * @notice Sets the creator for a specific visibility ID. * @dev Only callable by an account with the `CREATORS_LINKER_ROLE`. * @param visibilityId The ID representing the visibility credits. * @param creator The address of the creator, can be address(0). * @param metadata Additional metadata for the creator. */ function setCreatorVisibility( string calldata visibilityId, address creator, string calldata metadata ) external onlyRole(CREATORS_LINKER_ROLE) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); Visibility storage visibility = $.visibilityCredits[ getVisibilityKey(visibilityId) ]; visibility.creator = creator; emit CreatorVisibilitySet(visibilityId, creator, metadata); } /** * @notice Sets the partner for a referrer * @dev Only callable by an account with the `PARTNERS_LINKER_ROLE`. * @param referrer The address of the referrer, cannot be address(0). * @param partner The address of the partner/marketing agency, can be address(0). */ function setReferrerPartner( address referrer, address partner ) external onlyRole(PARTNERS_LINKER_ROLE) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); if (referrer == address(0)) { revert InvalidAddress(); } $.referrersToPartners[referrer] = partner; emit ReferrerPartnerSet(referrer, partner); } /** * @notice Transfers visibility credits between users. * @dev Only callable by an account with the `CREDITS_TRANSFER_ROLE`. * @param visibilityId The ID representing the visibility credits. * @param from The address to transfer credits from. * @param to The address to transfer credits to. * @param amount The amount of credits to transfer. */ function transferCredits( string calldata visibilityId, address from, address to, uint256 amount ) external onlyRole(CREDITS_TRANSFER_ROLE) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); Visibility storage visibility = $.visibilityCredits[ getVisibilityKey(visibilityId) ]; if (visibility.creditBalances[from] < amount) { revert NotEnoughCreditsOwned(); } visibility.creditBalances[from] -= amount; visibility.creditBalances[to] += amount; emit CreditsTransfer(visibilityId, from, to, amount); } /** * @notice Updates the protocol treasury address. * @dev Only callable by an account with the `DEFAULT_ADMIN_ROLE`. * @param treasury The address of the new protocol treasury (cannot be address(0)). */ function updateTreasury( address treasury ) external onlyRole(DEFAULT_ADMIN_ROLE) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); if (treasury == address(0)) { revert InvalidAddress(); } $.protocolTreasury = payable(treasury); } function getProtocolTreasury() external view returns (address) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); return $.protocolTreasury; } function getReferrerPartner( address referrer ) external view returns (address) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); return $.referrersToPartners[referrer]; } function getUserReferrer(address user) external view returns (address) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); return $.usersToReferrers[user]; } function getVisibility( string calldata visibilityId ) external view returns ( address creator, uint256 totalSupply, uint256 claimableFeeBalance ) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); Visibility storage visibility = $.visibilityCredits[ getVisibilityKey(visibilityId) ]; return ( visibility.creator, visibility.totalSupply, visibility.claimableFeeBalance ); } function getVisibilityCreditBalance( string calldata visibilityId, address account ) external view returns (uint256) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); return $.visibilityCredits[getVisibilityKey(visibilityId)].creditBalances[ account ]; } function buyCostWithFees( string calldata visibilityId, uint256 amount, address user, address inputReferrer ) external view returns (uint256 totalCost, Trade memory trade) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); uint256 totalSupply = $ .visibilityCredits[getVisibilityKey(visibilityId)] .totalSupply; trade = _tradeCostWithFees( totalSupply, amount, true, user, inputReferrer ); totalCost = trade.tradeCost + trade.creatorFee + trade.protocolFee + trade.referrerFee + trade.partnerFee; } function sellCostWithFees( string calldata visibilityId, uint256 amount, address user, address inputReferrer ) external view returns (uint256 reimbursement, Trade memory trade) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); uint256 totalSupply = $ .visibilityCredits[getVisibilityKey(visibilityId)] .totalSupply; trade = _tradeCostWithFees( totalSupply, amount, false, user, inputReferrer ); reimbursement = trade.tradeCost - trade.creatorFee - trade.protocolFee - trade.referrerFee - trade.partnerFee; } function getVisibilityKey( string calldata visibilityId ) public pure returns (bytes32) { return keccak256(abi.encode(visibilityId)); } function _tradeCostWithFees( uint256 totalSupply, uint256 amount, bool isBuy, address user, address inputReferrer ) private view returns (Trade memory trade) { VisibilityCreditsStorage storage $ = _getVisibilityCreditsStorage(); if (!isBuy && totalSupply < amount) { revert InvalidAmount(); } if (user == address(0)) { revert InvalidAddress(); } uint256 fromSupply = isBuy ? totalSupply : totalSupply - amount; trade.tradeCost = _tradeCost(fromSupply, amount); trade.creatorFee = (trade.tradeCost * CREATOR_FEE) / FEE_DENOMINATOR; trade.referrer = inputReferrer != address(0) ? inputReferrer : $.usersToReferrers[user]; trade.partner = trade.referrer != address(0) ? $.referrersToPartners[trade.referrer] : address(0); uint256 partnerFeeToApply = trade.partner != address(0) ? PARTNER_FEE : 0; uint256 referrerFeeToApply = trade.referrer != address(0) ? trade.partner != address(0) ? REFERRER_FEE + PARTNER_REFERRER_BONUS : REFERRER_FEE : 0; uint256 protocolFeeToApply = PROTOCOL_FEE - referrerFeeToApply - partnerFeeToApply; trade.partnerFee = (trade.tradeCost * partnerFeeToApply) / FEE_DENOMINATOR; trade.referrerFee = (trade.tradeCost * referrerFeeToApply) / FEE_DENOMINATOR; trade.protocolFee = (trade.tradeCost * protocolFeeToApply) / FEE_DENOMINATOR; } /** * @dev Calculates the current price per visibility credit based on the total supply. * @param totalSupply The current total supply of visibility credits. * @return The current price per credit in wei. function _getCurrentPrice( uint256 totalSupply ) private pure returns (uint256) { // Compute the current price using the bonding curve formula return BASE_PRICE + (A * (totalSupply ** 2)) + (B * totalSupply); } */ /** * @dev Calculates the total cost for buying or selling a given amount of credits * based on the bonding curve. The cost is determined by summing the prices * along the curve from the starting supply to the ending supply. * * The calculation uses mathematical formulas for the sum of squares and * the sum of natural numbers to efficiently compute the total cost without * looping over each credit unit price. * * For buying: * - fromSupply = current total supply * - toSupply = current total supply + amount - 1 = fromSupply + amount - 1 * * For selling: * - fromSupply = current total supply - amount * - toSupply = current total supply - 1 = fromSupply + amount - 1 * * Edge Case Handling: * - When fromSupply is zero (e.g., initial purchase or selling all credits), * special care is taken to avoid underflow in calculations. * * @param fromSupply The total supply of visibility credits before the trade if buying, or after the trade if selling. * @param amount The amount of credits to buy or sell. * @return The total cost in wei for the transaction. */ function _tradeCost( uint256 fromSupply, uint256 amount ) private pure returns (uint256) { if (amount == 0) { revert InvalidAmount(); } // The ending index of the credit unit being considered. uint256 toSupply = fromSupply + amount - 1; uint256 sumSquares; uint256 sumFirstN; if (fromSupply == 0) { // S2(n) calculates the cumulative sum of squares from k = 1 to n: // S2(n) = ∑_{k=1}^{n} k² = n(n + 1)(2n + 1) / 6 sumSquares = (toSupply * (toSupply + 1) * (2 * toSupply + 1)) / 6; // S1(n) calculates the cumulative sum from k = 1 to n: // S1(n) = ∑_{k=1}^{n} k = n(n + 1) / 2 sumFirstN = (toSupply * (toSupply + 1)) / 2; } else { // S2(n) = ∑_{k=1}^{n} k² = S2(n) = ∑_{k=1}^{j-1} k² + ∑_{k=j}^{n} k² // Thus the sum of squares from fromSupply to toSupply is: // ∑_{k=fromSupply}^{toSupply} k² = ∑_{k=1}^{toSupply} k² - ∑_{k=1}^{fromSupply - 1} k² // ∑_{k=fromSupply}^{toSupply} k² = S2(toSupply) - S2(fromSupply - 1) // ∑_{k=fromSupply}^{toSupply} k² = toSupply(toSupply + 1)(2*toSupply + 1) / 6 - ((fromSupply-1)((fromSupply -1) + 1)(2*(fromSupply -1) + 1)) / 6 uint256 sumSquaresTo = (toSupply * (toSupply + 1) * (2 * toSupply + 1)) / 6; uint256 sumSquaresFrom = ((fromSupply - 1) * fromSupply * (2 * fromSupply - 1)) / 6; sumSquares = sumSquaresTo - sumSquaresFrom; // Similarly, // S1(n) = ∑_{k=1}^{n} k = ∑_{k=1}^{j-1} k + ∑_{k=j}^{n} k // Thus the sum from fromSupply to toSupply is: // ∑_{k=fromSupply}^{toSupply} k = ∑_{k=1}^{n} k - ∑_{k=1}^{j-1} k // ∑_{k=fromSupply}^{toSupply} k = S1(toSupply) - S1(fromSupply - 1) // ∑_{k=fromSupply}^{toSupply} k = toSupply(toSupply + 1) / 2 - (fromSupply - 1)((fromSupply - 1) + 1) / 2 uint256 sumFirstNTo = (toSupply * (toSupply + 1)) / 2; uint256 sumFirstNFrom = ((fromSupply - 1) * fromSupply) / 2; sumFirstN = sumFirstNTo - sumFirstNFrom; } // Total cost is the sum of base prices and the bonding curve contributions return (BASE_PRICE * amount) + (A * sumSquares) + (B * sumFirstN); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IVisibilityCredits { struct CreditsTradeEvent { address from; string visibilityId; uint256 amount; bool isBuy; uint256 tradeCost; uint256 creatorFee; uint256 protocolFee; uint256 referrerFee; uint256 partnerFee; address referrer; address partner; uint256 newTotalSupply; } struct Trade { uint256 tradeCost; uint256 creatorFee; uint256 protocolFee; uint256 referrerFee; uint256 partnerFee; address referrer; address partner; } struct Visibility { address creator; uint256 totalSupply; uint256 claimableFeeBalance; mapping(address => uint256) creditBalances; } event CreatorFeeClaimed( address indexed creator, uint256 amount, string visibilityId, address from ); event CreatorVisibilitySet( string visibilityId, address creator, string metadata ); event CreditsTrade(CreditsTradeEvent tradeEvent); event CreditsTransfer( string visibilityId, address indexed from, address indexed to, uint256 amount ); event ReferrerPartnerSet(address referrer, address partner); error InvalidAddress(); error InvalidCreator(); error InvalidAmount(); error NotEnoughEthSent(); error NotEnoughCreditsOwned(); function buyCredits( string calldata visibilityId, uint256 amount, address inputReferrer ) external payable; function sellCredits( string calldata visibilityId, uint256 amount, address inputReferrer ) external; function claimCreatorFee(string calldata visibilityId) external; function setCreatorVisibility( string calldata visibilityId, address creator, string calldata metadata ) external; function setReferrerPartner(address referrer, address partner) external; function transferCredits( string calldata visibilityId, address from, address to, uint256 amount ) external; function updateTreasury(address treasury) external; function getProtocolTreasury() external view returns (address); function getReferrerPartner( address referrer ) external view returns (address); function getUserReferrer(address user) external view returns (address); function getVisibility( string calldata visibilityId ) external view returns ( address creator, uint256 totalSupply, uint256 claimableFeeBalance ); function getVisibilityCreditBalance( string calldata visibilityId, address account ) external view returns (uint256); function getVisibilityKey( string calldata visibilityId ) external pure returns (bytes32); function buyCostWithFees( string calldata visibilityId, uint256 amount, address user, address inputReferrer ) external view returns (uint256 totalCost, Trade memory trade); function sellCostWithFees( string calldata visibilityId, uint256 amount, address user, address inputReferrer ) external view returns (uint256 reimbursement, Trade memory trade); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard struct ReentrancyGuardStorage { uint256 _status; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00; function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) { assembly { $.slot := ReentrancyGuardStorageLocation } } /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); $._status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // On the first call to nonReentrant, _status will be NOT_ENTERED if ($._status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail $._status = ENTERED; } function _nonReentrantAfter() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) $._status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); return $._status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, bytes memory returndata) = recipient.call{value: amount}(""); if (!success) { _revert(returndata); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlDefaultAdminRules.sol) pragma solidity ^0.8.20; import {IAccessControlDefaultAdminRules} from "@openzeppelin/contracts/access/extensions/IAccessControlDefaultAdminRules.sol"; import {AccessControlUpgradeable} from "../AccessControlUpgradeable.sol"; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows specifying special rules to manage * the `DEFAULT_ADMIN_ROLE` holder, which is a sensitive role with special permissions * over other roles that may potentially have privileged rights in the system. * * If a specific role doesn't have an admin role assigned, the holder of the * `DEFAULT_ADMIN_ROLE` will have the ability to grant it and revoke it. * * This contract implements the following risk mitigations on top of {AccessControl}: * * * Only one account holds the `DEFAULT_ADMIN_ROLE` since deployment until it's potentially renounced. * * Enforces a 2-step process to transfer the `DEFAULT_ADMIN_ROLE` to another account. * * Enforces a configurable delay between the two steps, with the ability to cancel before the transfer is accepted. * * The delay can be changed by scheduling, see {changeDefaultAdminDelay}. * * It is not possible to use another role to manage the `DEFAULT_ADMIN_ROLE`. * * Example usage: * * ```solidity * contract MyToken is AccessControlDefaultAdminRules { * constructor() AccessControlDefaultAdminRules( * 3 days, * msg.sender // Explicit initial `DEFAULT_ADMIN_ROLE` holder * ) {} * } * ``` */ abstract contract AccessControlDefaultAdminRulesUpgradeable is Initializable, IAccessControlDefaultAdminRules, IERC5313, AccessControlUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.AccessControlDefaultAdminRules struct AccessControlDefaultAdminRulesStorage { // pending admin pair read/written together frequently address _pendingDefaultAdmin; uint48 _pendingDefaultAdminSchedule; // 0 == unset uint48 _currentDelay; address _currentDefaultAdmin; // pending delay pair read/written together frequently uint48 _pendingDelay; uint48 _pendingDelaySchedule; // 0 == unset } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControlDefaultAdminRules")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AccessControlDefaultAdminRulesStorageLocation = 0xeef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698400; function _getAccessControlDefaultAdminRulesStorage() private pure returns (AccessControlDefaultAdminRulesStorage storage $) { assembly { $.slot := AccessControlDefaultAdminRulesStorageLocation } } /** * @dev Sets the initial values for {defaultAdminDelay} and {defaultAdmin} address. */ function __AccessControlDefaultAdminRules_init(uint48 initialDelay, address initialDefaultAdmin) internal onlyInitializing { __AccessControlDefaultAdminRules_init_unchained(initialDelay, initialDefaultAdmin); } function __AccessControlDefaultAdminRules_init_unchained(uint48 initialDelay, address initialDefaultAdmin) internal onlyInitializing { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (initialDefaultAdmin == address(0)) { revert AccessControlInvalidDefaultAdmin(address(0)); } $._currentDelay = initialDelay; _grantRole(DEFAULT_ADMIN_ROLE, initialDefaultAdmin); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlDefaultAdminRules).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC5313-owner}. */ function owner() public view virtual returns (address) { return defaultAdmin(); } /// /// Override AccessControl role management /// /** * @dev See {AccessControl-grantRole}. Reverts for `DEFAULT_ADMIN_ROLE`. */ function grantRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) { if (role == DEFAULT_ADMIN_ROLE) { revert AccessControlEnforcedDefaultAdminRules(); } super.grantRole(role, account); } /** * @dev See {AccessControl-revokeRole}. Reverts for `DEFAULT_ADMIN_ROLE`. */ function revokeRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) { if (role == DEFAULT_ADMIN_ROLE) { revert AccessControlEnforcedDefaultAdminRules(); } super.revokeRole(role, account); } /** * @dev See {AccessControl-renounceRole}. * * For the `DEFAULT_ADMIN_ROLE`, it only allows renouncing in two steps by first calling * {beginDefaultAdminTransfer} to the `address(0)`, so it's required that the {pendingDefaultAdmin} schedule * has also passed when calling this function. * * After its execution, it will not be possible to call `onlyRole(DEFAULT_ADMIN_ROLE)` functions. * * NOTE: Renouncing `DEFAULT_ADMIN_ROLE` will leave the contract without a {defaultAdmin}, * thereby disabling any functionality that is only available for it, and the possibility of reassigning a * non-administrated role. */ function renounceRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) { (address newDefaultAdmin, uint48 schedule) = pendingDefaultAdmin(); if (newDefaultAdmin != address(0) || !_isScheduleSet(schedule) || !_hasSchedulePassed(schedule)) { revert AccessControlEnforcedDefaultAdminDelay(schedule); } delete $._pendingDefaultAdminSchedule; } super.renounceRole(role, account); } /** * @dev See {AccessControl-_grantRole}. * * For `DEFAULT_ADMIN_ROLE`, it only allows granting if there isn't already a {defaultAdmin} or if the * role has been previously renounced. * * NOTE: Exposing this function through another mechanism may make the `DEFAULT_ADMIN_ROLE` * assignable again. Make sure to guarantee this is the expected behavior in your implementation. */ function _grantRole(bytes32 role, address account) internal virtual override returns (bool) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (role == DEFAULT_ADMIN_ROLE) { if (defaultAdmin() != address(0)) { revert AccessControlEnforcedDefaultAdminRules(); } $._currentDefaultAdmin = account; } return super._grantRole(role, account); } /** * @dev See {AccessControl-_revokeRole}. */ function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) { delete $._currentDefaultAdmin; } return super._revokeRole(role, account); } /** * @dev See {AccessControl-_setRoleAdmin}. Reverts for `DEFAULT_ADMIN_ROLE`. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual override { if (role == DEFAULT_ADMIN_ROLE) { revert AccessControlEnforcedDefaultAdminRules(); } super._setRoleAdmin(role, adminRole); } /// /// AccessControlDefaultAdminRules accessors /// /** * @inheritdoc IAccessControlDefaultAdminRules */ function defaultAdmin() public view virtual returns (address) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); return $._currentDefaultAdmin; } /** * @inheritdoc IAccessControlDefaultAdminRules */ function pendingDefaultAdmin() public view virtual returns (address newAdmin, uint48 schedule) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); return ($._pendingDefaultAdmin, $._pendingDefaultAdminSchedule); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function defaultAdminDelay() public view virtual returns (uint48) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); uint48 schedule = $._pendingDelaySchedule; return (_isScheduleSet(schedule) && _hasSchedulePassed(schedule)) ? $._pendingDelay : $._currentDelay; } /** * @inheritdoc IAccessControlDefaultAdminRules */ function pendingDefaultAdminDelay() public view virtual returns (uint48 newDelay, uint48 schedule) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); schedule = $._pendingDelaySchedule; return (_isScheduleSet(schedule) && !_hasSchedulePassed(schedule)) ? ($._pendingDelay, schedule) : (0, 0); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function defaultAdminDelayIncreaseWait() public view virtual returns (uint48) { return 5 days; } /// /// AccessControlDefaultAdminRules public and internal setters for defaultAdmin/pendingDefaultAdmin /// /** * @inheritdoc IAccessControlDefaultAdminRules */ function beginDefaultAdminTransfer(address newAdmin) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _beginDefaultAdminTransfer(newAdmin); } /** * @dev See {beginDefaultAdminTransfer}. * * Internal function without access restriction. */ function _beginDefaultAdminTransfer(address newAdmin) internal virtual { uint48 newSchedule = SafeCast.toUint48(block.timestamp) + defaultAdminDelay(); _setPendingDefaultAdmin(newAdmin, newSchedule); emit DefaultAdminTransferScheduled(newAdmin, newSchedule); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function cancelDefaultAdminTransfer() public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _cancelDefaultAdminTransfer(); } /** * @dev See {cancelDefaultAdminTransfer}. * * Internal function without access restriction. */ function _cancelDefaultAdminTransfer() internal virtual { _setPendingDefaultAdmin(address(0), 0); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function acceptDefaultAdminTransfer() public virtual { (address newDefaultAdmin, ) = pendingDefaultAdmin(); if (_msgSender() != newDefaultAdmin) { // Enforce newDefaultAdmin explicit acceptance. revert AccessControlInvalidDefaultAdmin(_msgSender()); } _acceptDefaultAdminTransfer(); } /** * @dev See {acceptDefaultAdminTransfer}. * * Internal function without access restriction. */ function _acceptDefaultAdminTransfer() internal virtual { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); (address newAdmin, uint48 schedule) = pendingDefaultAdmin(); if (!_isScheduleSet(schedule) || !_hasSchedulePassed(schedule)) { revert AccessControlEnforcedDefaultAdminDelay(schedule); } _revokeRole(DEFAULT_ADMIN_ROLE, defaultAdmin()); _grantRole(DEFAULT_ADMIN_ROLE, newAdmin); delete $._pendingDefaultAdmin; delete $._pendingDefaultAdminSchedule; } /// /// AccessControlDefaultAdminRules public and internal setters for defaultAdminDelay/pendingDefaultAdminDelay /// /** * @inheritdoc IAccessControlDefaultAdminRules */ function changeDefaultAdminDelay(uint48 newDelay) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _changeDefaultAdminDelay(newDelay); } /** * @dev See {changeDefaultAdminDelay}. * * Internal function without access restriction. */ function _changeDefaultAdminDelay(uint48 newDelay) internal virtual { uint48 newSchedule = SafeCast.toUint48(block.timestamp) + _delayChangeWait(newDelay); _setPendingDelay(newDelay, newSchedule); emit DefaultAdminDelayChangeScheduled(newDelay, newSchedule); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function rollbackDefaultAdminDelay() public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _rollbackDefaultAdminDelay(); } /** * @dev See {rollbackDefaultAdminDelay}. * * Internal function without access restriction. */ function _rollbackDefaultAdminDelay() internal virtual { _setPendingDelay(0, 0); } /** * @dev Returns the amount of seconds to wait after the `newDelay` will * become the new {defaultAdminDelay}. * * The value returned guarantees that if the delay is reduced, it will go into effect * after a wait that honors the previously set delay. * * See {defaultAdminDelayIncreaseWait}. */ function _delayChangeWait(uint48 newDelay) internal view virtual returns (uint48) { uint48 currentDelay = defaultAdminDelay(); // When increasing the delay, we schedule the delay change to occur after a period of "new delay" has passed, up // to a maximum given by defaultAdminDelayIncreaseWait, by default 5 days. For example, if increasing from 1 day // to 3 days, the new delay will come into effect after 3 days. If increasing from 1 day to 10 days, the new // delay will come into effect after 5 days. The 5 day wait period is intended to be able to fix an error like // using milliseconds instead of seconds. // // When decreasing the delay, we wait the difference between "current delay" and "new delay". This guarantees // that an admin transfer cannot be made faster than "current delay" at the time the delay change is scheduled. // For example, if decreasing from 10 days to 3 days, the new delay will come into effect after 7 days. return newDelay > currentDelay ? uint48(Math.min(newDelay, defaultAdminDelayIncreaseWait())) // no need to safecast, both inputs are uint48 : currentDelay - newDelay; } /// /// Private setters /// /** * @dev Setter of the tuple for pending admin and its schedule. * * May emit a DefaultAdminTransferCanceled event. */ function _setPendingDefaultAdmin(address newAdmin, uint48 newSchedule) private { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); (, uint48 oldSchedule) = pendingDefaultAdmin(); $._pendingDefaultAdmin = newAdmin; $._pendingDefaultAdminSchedule = newSchedule; // An `oldSchedule` from `pendingDefaultAdmin()` is only set if it hasn't been accepted. if (_isScheduleSet(oldSchedule)) { // Emit for implicit cancellations when another default admin was scheduled. emit DefaultAdminTransferCanceled(); } } /** * @dev Setter of the tuple for pending delay and its schedule. * * May emit a DefaultAdminDelayChangeCanceled event. */ function _setPendingDelay(uint48 newDelay, uint48 newSchedule) private { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); uint48 oldSchedule = $._pendingDelaySchedule; if (_isScheduleSet(oldSchedule)) { if (_hasSchedulePassed(oldSchedule)) { // Materialize a virtual delay $._currentDelay = $._pendingDelay; } else { // Emit for implicit cancellations when another delay was scheduled. emit DefaultAdminDelayChangeCanceled(); } } $._pendingDelay = newDelay; $._pendingDelaySchedule = newSchedule; } /// /// Private helpers /// /** * @dev Defines if an `schedule` is considered set. For consistency purposes. */ function _isScheduleSet(uint48 schedule) private pure returns (bool) { return schedule != 0; } /** * @dev Defines if an `schedule` is considered passed. For consistency purposes. */ function _hasSchedulePassed(uint48 schedule) private view returns (bool) { return schedule < block.timestamp; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl struct AccessControlStorage { mapping(bytes32 role => RoleData) _roles; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800; function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) { assembly { $.slot := AccessControlStorageLocation } } /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { AccessControlStorage storage $ = _getAccessControlStorage(); return $._roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { AccessControlStorage storage $ = _getAccessControlStorage(); return $._roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { AccessControlStorage storage $ = _getAccessControlStorage(); bytes32 previousAdminRole = getRoleAdmin(role); $._roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { AccessControlStorage storage $ = _getAccessControlStorage(); if (!hasRole(role, account)) { $._roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { AccessControlStorage storage $ = _getAccessControlStorage(); if (hasRole(role, account)) { $._roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC-165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role). * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5313.sol) pragma solidity ^0.8.20; /** * @dev Interface for the Light Contract Ownership Standard. * * A standardized minimal interface required to identify an account that controls a contract */ interface IERC5313 { /** * @dev Gets the address of the owner. */ function owner() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol) pragma solidity ^0.8.20; import {Panic} from "../Panic.sol"; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { 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 success flag (no overflow). */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow). */ function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow). */ function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { 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 success flag (no division by zero). */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero). */ function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * SafeCast.toUint(condition)); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(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. Panic.panic(Panic.DIVISION_BY_ZERO); } // The following calculation ensures accurate ceiling division without overflow. // Since a is non-zero, (a - 1) / b will not overflow. // The largest possible result occurs when (a - 1) / b is type(uint256).max, // but the largest value we can obtain is type(uint256).max - 1, which happens // when a = type(uint256).max and b = 1. unchecked { return SafeCast.toUint(a > 0) * ((a - 1) / b + 1); } } /** * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2²⁵⁶ + 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²⁵⁶. Also prevents denominator == 0. if (denominator <= prod1) { Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW)); } /////////////////////////////////////////////// // 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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv ≡ 1 mod 2⁴. 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⁸ inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶ inverse *= 2 - denominator * inverse; // inverse mod 2³² inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴ inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸ inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶ // 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²⁵⁶. Since the preconditions guarantee that the outcome is // less than 2²⁵⁶, 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; } } /** * @dev 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) { return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0); } /** * @dev Calculate the modular multiplicative inverse of a number in Z/nZ. * * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0. * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible. * * If the input value is not inversible, 0 is returned. * * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}. */ function invMod(uint256 a, uint256 n) internal pure returns (uint256) { unchecked { if (n == 0) return 0; // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version) // Used to compute integers x and y such that: ax + ny = gcd(a, n). // When the gcd is 1, then the inverse of a modulo n exists and it's x. // ax + ny = 1 // ax = 1 + (-y)n // ax ≡ 1 (mod n) # x is the inverse of a modulo n // If the remainder is 0 the gcd is n right away. uint256 remainder = a % n; uint256 gcd = n; // Therefore the initial coefficients are: // ax + ny = gcd(a, n) = n // 0a + 1n = n int256 x = 0; int256 y = 1; while (remainder != 0) { uint256 quotient = gcd / remainder; (gcd, remainder) = ( // The old remainder is the next gcd to try. remainder, // Compute the next remainder. // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd // where gcd is at most n (capped to type(uint256).max) gcd - remainder * quotient ); (x, y) = ( // Increment the coefficient of a. y, // Decrement the coefficient of n. // Can overflow, but the result is casted to uint256 so that the // next value of y is "wrapped around" to a value between 0 and n - 1. x - y * int256(quotient) ); } if (gcd != 1) return 0; // No inverse exists. return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative. } } /** * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`. * * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that * `a**(p-2)` is the modular multiplicative inverse of a in Fp. * * NOTE: this function does NOT check that `p` is a prime greater than `2`. */ function invModPrime(uint256 a, uint256 p) internal view returns (uint256) { unchecked { return Math.modExp(a, p - 2, p); } } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m) * * Requirements: * - modulus can't be zero * - underlying staticcall to precompile must succeed * * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make * sure the chain you're using it on supports the precompiled contract for modular exponentiation * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, * the underlying function will succeed given the lack of a revert, but the result may be incorrectly * interpreted as 0. */ function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) { (bool success, uint256 result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m). * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying * to operate modulo 0 or if the underlying precompile reverted. * * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack * of a revert, but the result may be incorrectly interpreted as 0. */ function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) { if (m == 0) return (false, 0); assembly ("memory-safe") { let ptr := mload(0x40) // | Offset | Content | Content (Hex) | // |-----------|------------|--------------------------------------------------------------------| // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x60:0x7f | value of b | 0x<.............................................................b> | // | 0x80:0x9f | value of e | 0x<.............................................................e> | // | 0xa0:0xbf | value of m | 0x<.............................................................m> | mstore(ptr, 0x20) mstore(add(ptr, 0x20), 0x20) mstore(add(ptr, 0x40), 0x20) mstore(add(ptr, 0x60), b) mstore(add(ptr, 0x80), e) mstore(add(ptr, 0xa0), m) // Given the result < m, it's guaranteed to fit in 32 bytes, // so we can use the memory scratch space located at offset 0. success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20) result := mload(0x00) } } /** * @dev Variant of {modExp} that supports inputs of arbitrary length. */ function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) { (bool success, bytes memory result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Variant of {tryModExp} that supports inputs of arbitrary length. */ function tryModExp( bytes memory b, bytes memory e, bytes memory m ) internal view returns (bool success, bytes memory result) { if (_zeroBytes(m)) return (false, new bytes(0)); uint256 mLen = m.length; // Encode call args in result and move the free memory pointer result = abi.encodePacked(b.length, e.length, mLen, b, e, m); assembly ("memory-safe") { let dataPtr := add(result, 0x20) // Write result on top of args to avoid allocating extra memory. success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen) // Overwrite the length. // result.length > returndatasize() is guaranteed because returndatasize() == m.length mstore(result, mLen) // Set the memory pointer after the returned data. mstore(0x40, add(dataPtr, mLen)) } } /** * @dev Returns whether the provided byte array is zero. */ function _zeroBytes(bytes memory byteArray) private pure returns (bool) { for (uint256 i = 0; i < byteArray.length; ++i) { if (byteArray[i] != 0) { return false; } } return true; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * This method is based on Newton's method for computing square roots; the algorithm is restricted to only * using integer operations. */ function sqrt(uint256 a) internal pure returns (uint256) { unchecked { // Take care of easy edge cases when a == 0 or a == 1 if (a <= 1) { return a; } // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between // the current value as `ε_n = | x_n - sqrt(a) |`. // // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is // bigger than any uint256. // // By noticing that // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)` // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar // to the msb function. uint256 aa = a; uint256 xn = 1; if (aa >= (1 << 128)) { aa >>= 128; xn <<= 64; } if (aa >= (1 << 64)) { aa >>= 64; xn <<= 32; } if (aa >= (1 << 32)) { aa >>= 32; xn <<= 16; } if (aa >= (1 << 16)) { aa >>= 16; xn <<= 8; } if (aa >= (1 << 8)) { aa >>= 8; xn <<= 4; } if (aa >= (1 << 4)) { aa >>= 4; xn <<= 2; } if (aa >= (1 << 2)) { xn <<= 1; } // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1). // // We can refine our estimation by noticing that the middle of that interval minimizes the error. // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2). // This is going to be our x_0 (and ε_0) xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2) // From here, Newton's method give us: // x_{n+1} = (x_n + a / x_n) / 2 // // One should note that: // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a // = ((x_n² + a) / (2 * x_n))² - a // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²) // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²) // = (x_n² - a)² / (2 * x_n)² // = ((x_n² - a) / (2 * x_n))² // ≥ 0 // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n // // This gives us the proof of quadratic convergence of the sequence: // ε_{n+1} = | x_{n+1} - sqrt(a) | // = | (x_n + a / x_n) / 2 - sqrt(a) | // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) | // = | (x_n - sqrt(a))² / (2 * x_n) | // = | ε_n² / (2 * x_n) | // = ε_n² / | (2 * x_n) | // // For the first iteration, we have a special case where x_0 is known: // ε_1 = ε_0² / | (2 * x_0) | // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2))) // ≤ 2**(2*e-4) / (3 * 2**(e-1)) // ≤ 2**(e-3) / 3 // ≤ 2**(e-3-log2(3)) // ≤ 2**(e-4.5) // // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n: // ε_{n+1} = ε_n² / | (2 * x_n) | // ≤ (2**(e-k))² / (2 * 2**(e-1)) // ≤ 2**(2*e-2*k) / 2**e // ≤ 2**(e-2*k) xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5 xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9 xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18 xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36 xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72 // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either // sqrt(a) or sqrt(a) + 1. return xn - SafeCast.toUint(xn > a / xn); } } /** * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a); } } /** * @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; uint256 exp; unchecked { exp = 128 * SafeCast.toUint(value > (1 << 128) - 1); value >>= exp; result += exp; exp = 64 * SafeCast.toUint(value > (1 << 64) - 1); value >>= exp; result += exp; exp = 32 * SafeCast.toUint(value > (1 << 32) - 1); value >>= exp; result += exp; exp = 16 * SafeCast.toUint(value > (1 << 16) - 1); value >>= exp; result += exp; exp = 8 * SafeCast.toUint(value > (1 << 8) - 1); value >>= exp; result += exp; exp = 4 * SafeCast.toUint(value > (1 << 4) - 1); value >>= exp; result += exp; exp = 2 * SafeCast.toUint(value > (1 << 2) - 1); value >>= exp; result += exp; result += SafeCast.toUint(value > 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value); } } /** * @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value); } } /** * @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; uint256 isGt; unchecked { isGt = SafeCast.toUint(value > (1 << 128) - 1); value >>= isGt * 128; result += isGt * 16; isGt = SafeCast.toUint(value > (1 << 64) - 1); value >>= isGt * 64; result += isGt * 8; isGt = SafeCast.toUint(value > (1 << 32) - 1); value >>= isGt * 32; result += isGt * 4; isGt = SafeCast.toUint(value > (1 << 16) - 1); value >>= isGt * 16; result += isGt * 2; result += SafeCast.toUint(value > (1 << 8) - 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value); } } /** * @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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/IAccessControlDefaultAdminRules.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlDefaultAdminRules declared to support ERC-165 detection. */ interface IAccessControlDefaultAdminRules is IAccessControl { /** * @dev The new default admin is not a valid default admin. */ error AccessControlInvalidDefaultAdmin(address defaultAdmin); /** * @dev At least one of the following rules was violated: * * - The `DEFAULT_ADMIN_ROLE` must only be managed by itself. * - The `DEFAULT_ADMIN_ROLE` must only be held by one account at the time. * - Any `DEFAULT_ADMIN_ROLE` transfer must be in two delayed steps. */ error AccessControlEnforcedDefaultAdminRules(); /** * @dev The delay for transferring the default admin delay is enforced and * the operation must wait until `schedule`. * * NOTE: `schedule` can be 0 indicating there's no transfer scheduled. */ error AccessControlEnforcedDefaultAdminDelay(uint48 schedule); /** * @dev Emitted when a {defaultAdmin} transfer is started, setting `newAdmin` as the next * address to become the {defaultAdmin} by calling {acceptDefaultAdminTransfer} only after `acceptSchedule` * passes. */ event DefaultAdminTransferScheduled(address indexed newAdmin, uint48 acceptSchedule); /** * @dev Emitted when a {pendingDefaultAdmin} is reset if it was never accepted, regardless of its schedule. */ event DefaultAdminTransferCanceled(); /** * @dev Emitted when a {defaultAdminDelay} change is started, setting `newDelay` as the next * delay to be applied between default admin transfer after `effectSchedule` has passed. */ event DefaultAdminDelayChangeScheduled(uint48 newDelay, uint48 effectSchedule); /** * @dev Emitted when a {pendingDefaultAdminDelay} is reset if its schedule didn't pass. */ event DefaultAdminDelayChangeCanceled(); /** * @dev Returns the address of the current `DEFAULT_ADMIN_ROLE` holder. */ function defaultAdmin() external view returns (address); /** * @dev Returns a tuple of a `newAdmin` and an accept schedule. * * After the `schedule` passes, the `newAdmin` will be able to accept the {defaultAdmin} role * by calling {acceptDefaultAdminTransfer}, completing the role transfer. * * A zero value only in `acceptSchedule` indicates no pending admin transfer. * * NOTE: A zero address `newAdmin` means that {defaultAdmin} is being renounced. */ function pendingDefaultAdmin() external view returns (address newAdmin, uint48 acceptSchedule); /** * @dev Returns the delay required to schedule the acceptance of a {defaultAdmin} transfer started. * * This delay will be added to the current timestamp when calling {beginDefaultAdminTransfer} to set * the acceptance schedule. * * NOTE: If a delay change has been scheduled, it will take effect as soon as the schedule passes, making this * function returns the new delay. See {changeDefaultAdminDelay}. */ function defaultAdminDelay() external view returns (uint48); /** * @dev Returns a tuple of `newDelay` and an effect schedule. * * After the `schedule` passes, the `newDelay` will get into effect immediately for every * new {defaultAdmin} transfer started with {beginDefaultAdminTransfer}. * * A zero value only in `effectSchedule` indicates no pending delay change. * * NOTE: A zero value only for `newDelay` means that the next {defaultAdminDelay} * will be zero after the effect schedule. */ function pendingDefaultAdminDelay() external view returns (uint48 newDelay, uint48 effectSchedule); /** * @dev Starts a {defaultAdmin} transfer by setting a {pendingDefaultAdmin} scheduled for acceptance * after the current timestamp plus a {defaultAdminDelay}. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * Emits a DefaultAdminRoleChangeStarted event. */ function beginDefaultAdminTransfer(address newAdmin) external; /** * @dev Cancels a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}. * * A {pendingDefaultAdmin} not yet accepted can also be cancelled with this function. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * May emit a DefaultAdminTransferCanceled event. */ function cancelDefaultAdminTransfer() external; /** * @dev Completes a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}. * * After calling the function: * * - `DEFAULT_ADMIN_ROLE` should be granted to the caller. * - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder. * - {pendingDefaultAdmin} should be reset to zero values. * * Requirements: * * - Only can be called by the {pendingDefaultAdmin}'s `newAdmin`. * - The {pendingDefaultAdmin}'s `acceptSchedule` should've passed. */ function acceptDefaultAdminTransfer() external; /** * @dev Initiates a {defaultAdminDelay} update by setting a {pendingDefaultAdminDelay} scheduled for getting * into effect after the current timestamp plus a {defaultAdminDelay}. * * This function guarantees that any call to {beginDefaultAdminTransfer} done between the timestamp this * method is called and the {pendingDefaultAdminDelay} effect schedule will use the current {defaultAdminDelay} * set before calling. * * The {pendingDefaultAdminDelay}'s effect schedule is defined in a way that waiting until the schedule and then * calling {beginDefaultAdminTransfer} with the new delay will take at least the same as another {defaultAdmin} * complete transfer (including acceptance). * * The schedule is designed for two scenarios: * * - When the delay is changed for a larger one the schedule is `block.timestamp + newDelay` capped by * {defaultAdminDelayIncreaseWait}. * - When the delay is changed for a shorter one, the schedule is `block.timestamp + (current delay - new delay)`. * * A {pendingDefaultAdminDelay} that never got into effect will be canceled in favor of a new scheduled change. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * Emits a DefaultAdminDelayChangeScheduled event and may emit a DefaultAdminDelayChangeCanceled event. */ function changeDefaultAdminDelay(uint48 newDelay) external; /** * @dev Cancels a scheduled {defaultAdminDelay} change. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * May emit a DefaultAdminDelayChangeCanceled event. */ function rollbackDefaultAdminDelay() external; /** * @dev Maximum time in seconds for an increase to {defaultAdminDelay} (that is scheduled using {changeDefaultAdminDelay}) * to take effect. Default to 5 days. * * When the {defaultAdminDelay} is scheduled to be increased, it goes into effect after the new delay has passed with * the purpose of giving enough time for reverting any accidental change (i.e. using milliseconds instead of seconds) * that may lock the contract. However, to avoid excessive schedules, the wait is capped by this function and it can * be overrode for a custom {defaultAdminDelay} increase scheduling. * * IMPORTANT: Make sure to add a reasonable amount of time while overriding this value, otherwise, * there's a risk of setting a high new delay that goes into effect almost immediately without the * possibility of human intervention in the case of an input error (eg. set milliseconds instead of seconds). */ function defaultAdminDelayIncreaseWait() external view returns (uint48); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"uint48","name":"schedule","type":"uint48"}],"name":"AccessControlEnforcedDefaultAdminDelay","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCreator","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotEnoughCreditsOwned","type":"error"},{"inputs":[],"name":"NotEnoughEthSent","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"visibilityId","type":"string"},{"indexed":false,"internalType":"address","name":"from","type":"address"}],"name":"CreatorFeeClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"visibilityId","type":"string"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"string","name":"metadata","type":"string"}],"name":"CreatorVisibilitySet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isBuy","type":"bool"},{"internalType":"uint256","name":"tradeCost","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"uint256","name":"referrerFee","type":"uint256"},{"internalType":"uint256","name":"partnerFee","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"partner","type":"address"},{"internalType":"uint256","name":"newTotalSupply","type":"uint256"}],"indexed":false,"internalType":"struct IVisibilityCredits.CreditsTradeEvent","name":"tradeEvent","type":"tuple"}],"name":"CreditsTrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"visibilityId","type":"string"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CreditsTransfer","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminDelayChangeCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"newDelay","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"effectSchedule","type":"uint48"}],"name":"DefaultAdminDelayChangeScheduled","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint48","name":"acceptSchedule","type":"uint48"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"address","name":"partner","type":"address"}],"name":"ReferrerPartnerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"A","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"B","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_PRICE","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CREATORS_LINKER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CREATOR_FEE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CREDITS_TRANSFER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TOTAL_SUPPLY","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PARTNERS_LINKER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PARTNER_FEE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PARTNER_REFERRER_BONUS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROTOCOL_FEE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REFERRER_FEE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"inputReferrer","type":"address"}],"name":"buyCostWithFees","outputs":[{"internalType":"uint256","name":"totalCost","type":"uint256"},{"components":[{"internalType":"uint256","name":"tradeCost","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"uint256","name":"referrerFee","type":"uint256"},{"internalType":"uint256","name":"partnerFee","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"partner","type":"address"}],"internalType":"struct IVisibilityCredits.Trade","name":"trade","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"inputReferrer","type":"address"}],"name":"buyCredits","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"}],"name":"changeDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"}],"name":"claimCreatorFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelay","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelayIncreaseWait","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"}],"name":"getReferrerPartner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserReferrer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"}],"name":"getVisibility","outputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"claimableFeeBalance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"address","name":"account","type":"address"}],"name":"getVisibilityCreditBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"}],"name":"getVisibilityKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"grantee","type":"address"}],"name":"grantCreatorTransferRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint48","name":"adminDelay","type":"uint48"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"creatorsLinker","type":"address"},{"internalType":"address","name":"partnersLinker","type":"address"},{"internalType":"address","name":"treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdminDelay","outputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollbackDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"inputReferrer","type":"address"}],"name":"sellCostWithFees","outputs":[{"internalType":"uint256","name":"reimbursement","type":"uint256"},{"components":[{"internalType":"uint256","name":"tradeCost","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"uint256","name":"referrerFee","type":"uint256"},{"internalType":"uint256","name":"partnerFee","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"partner","type":"address"}],"internalType":"struct IVisibilityCredits.Trade","name":"trade","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"inputReferrer","type":"address"}],"name":"sellCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"metadata","type":"string"}],"name":"setCreatorVisibility","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"partner","type":"address"}],"name":"setReferrerPartner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasury","type":"address"}],"name":"updateTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
9c4d535b00000000000000000000000000000000000000000000000000000000000000000100055b197d646d7ae76692383a23d942513268f53ee97e5c4b652d543541b300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x0002000000000002001400000000000200010000000103550000006003100270000004b20030019d0000008004000039000000400040043f00000001002001900000003c0000c13d000004b202300197000000040020008c00000db30000413d000000000301043b000000e003300270000004b90030009c0000005b0000213d000004d90030009c000000860000213d000004e90030009c000000c90000213d000004f10030009c0000017e0000213d000004f50030009c000002fc0000613d000004f60030009c000003090000613d000004f70030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d0000000001000411000004f901100197000000000010043f0000051c01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000006dc0000613d0000052701000041000000000101041a001100000001001d001200d00010027a0000075c0000c13d0000052702000041000000000102041a000004f901100197000000000012041b0000000001000019000012c30001042e0000000001000416000000000001004b00000db30000c13d000004b301000041000000000101041a000004b400100198000008f80000c13d000004b502100197000004b50020009c000000560000613d000004b5011001c7000004b302000041000000000012041b000004b501000041000000800010043f0000000001000414000004b20010009c000004b201008041000000c001100210000004b6011001c70000800d020000390000000103000039000004b70400004112c212b80000040f000000010020019000000db30000613d000000200100003900000100001004430000012000000443000004b801000041000012c30001042e000004ba0030009c000000970000213d000004ca0030009c000001170000213d000004d20030009c0000018b0000213d000004d60030009c000002f00000613d000004d70030009c000002f00000613d000004d80030009c00000db30000c13d000000440020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000002402100370000000000202043b001200000002001d000004f90020009c00000db30000213d0000000401100370000000000101043b000000000010043f0000050401000041000000200010043f0000004002000039000000000100001912c2128c0000040f0000001202000029000000000020043f000000200010043f0000000001000019000000400200003912c2128c0000040f000000000101041a000000ff001001900000000001000039000000010100c039000000800010043f0000051001000041000012c30001042e000004da0030009c000001200000213d000004e20030009c000001970000213d000004e60030009c000003100000613d000004e70030009c0000031b0000613d000004e80030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d0000050301000041000000800010043f0000051001000041000012c30001042e000004bb0030009c0000016f0000213d000004c30030009c000002330000213d000004c70030009c000003560000613d000004c80030009c000003600000613d000004c90030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d0000000001000411000004f901100197000000000010043f0000051c01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000006dc0000613d0000050101000041000000000201041a0000051d03200197000000000031041b0000051e00200198000000c70000613d0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d0200003900000001030000390000051f0400004112c212b80000040f000000010020019000000db30000613d0000000001000019000012c30001042e000004ea0030009c000002650000213d000004ee0030009c000003720000613d000004ef0030009c0000040d0000613d000004f00030009c00000db30000c13d000000440020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000402100370000000000202043b001200000002001d0000002401100370000000000101043b001100000001001d000004f90010009c00000db30000213d0000001201000029000000000001004b0000036e0000613d000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000000101100039000000000101041a001000000001001d000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000000002000411000004f902200197000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff001001900000085c0000c13d0000052001000041000000000010043f0000000001000411000000040010043f0000001001000029000000240010043f0000052101000041000012c400010430000004cb0030009c000002720000213d000004cf0030009c000004160000613d000004d00030009c000004230000613d000004d10030009c000002f50000613d00000db30000013d000004db0030009c000002890000213d000004df0030009c0000044c0000613d000004e00030009c000004aa0000613d000004e10030009c00000db30000c13d000000640020008c00000db30000413d0000000003000416000000000003004b00000db30000c13d0000000403100370000000000303043b000004b50030009c00000db30000213d0000002304300039000000000024004b00000db30000813d001100040030003d0000001104100360000000000404043b001200000004001d000004b50040009c00000db30000213d00000012033000290000002403300039000000000023004b00000db30000213d0000002403100370000000000303043b001000000003001d000004f90030009c00000db30000213d0000004403100370000000000303043b000004b50030009c00000db30000213d0000002304300039000000000024004b00000db30000813d0000000404300039000000000141034f000000000101043b000f00000001001d000004b50010009c00000db30000213d0000002403300039000e00000003001d0000000f01300029000000000021004b00000db30000213d0000000001000411000004f901100197000000000010043f0000053401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff0010019000000a2c0000c13d0000052001000041000000000010043f0000000001000411000000040010043f0000050301000041000000240010043f0000052101000041000012c400010430000004bc0030009c000002b50000213d000004c00030009c000004db0000613d000004c10030009c000005610000613d000004c20030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d0000000f01000039000000800010043f0000051001000041000012c30001042e000004f20030009c000005e60000613d000004f30030009c000005ed0000613d000004f40030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d0000050801000041000000800010043f0000051001000041000012c30001042e000004d30030009c000005f40000613d000004d40030009c000005fd0000613d000004d50030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d000000800000043f0000051001000041000012c30001042e000004e30030009c000006140000613d000004e40030009c000006320000613d000004e50030009c00000db30000c13d0000000003000416000000000003004b00000db30000c13d000000840020008c00000db30000413d0000000403100370000000000503043b000004b50050009c00000db30000213d0000002303500039000000000023004b00000db30000813d0000000404500039000000000341034f000000000303043b000004b50030009c00000db30000213d00000000053500190000002405500039000000000025004b00000db30000213d0000002402100370000000000202043b001200000002001d0000004402100370000000000202043b001100000002001d000004f90020009c00000db30000213d0000006402100370000000000202043b001000000002001d000004f90020009c00000db30000213d0000016002000039000000400020043f0000002002400039000000000221034f000000800000043f000000a00000043f000000c00000043f000000e00000043f000001000000043f000001200000043f000001400000043f0000002001000039000001800010043f0000054d05300198000001a00030043f0000001f0630018f000001c004500039000001d70000613d000001c007000039000000000802034f000000008908043c0000000007970436000000000047004b000001d30000c13d000000000006004b000001e40000613d000000000252034f0000000305600210000000000604043300000000065601cf000000000656022f000000000202043b0000010005500089000000000252022f00000000025201cf000000000262019f0000000000240435000001c00230003900000000000204350000001f023000390000054d032001970000007f023000390000054d022001970000004001300039000001600010043f000005180020009c000007f20000213d0000016002200039000000400020043f000004b20010009c000004b20100804100000060011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000121019f00000519011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000010043f0000051401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000000101100039000000000101041a00000012020000290000001103000029000000100400002912c20f3f0000040f000000000301001900000000210104340000000002020433000000000012001a000008d00000413d000000000112001900000040023000390000000002020433000000000012001a000008d00000413d000000000112001900000060023000390000000002020433000000000012001a000008d00000413d000000000112001900000080023000390000000002020433000000000012001a000008d00000413d0000000002120019000000400100043d001200000001001d12c20e520000040f00000012020000290000000001210049000004b20010009c000004b2010080410000006001100210000004b20020009c000004b2020080410000004002200210000000000121019f000012c30001042e000004c40030009c000006390000613d000004c50030009c000006460000613d000004c60030009c00000db30000c13d000000440020008c00000db30000413d0000000003000416000000000003004b00000db30000c13d0000000403100370000000000403043b000004b50040009c00000db30000213d0000002303400039000000000023004b00000db30000813d0000000403400039000000000331034f000000000303043b000004b50030009c00000db30000213d00000024044000390000000005430019000000000025004b00000db30000213d0000002401100370000000000101043b001200000001001d000004f90010009c00000db30000213d0000000001040019000000000203001912c20ea40000040f000000000010043f0000051401000041000000200010043f0000004002000039000000000100001912c2128c0000040f0000001202000029000000000020043f0000000301100039000000200010043f0000000001000019000000400200003912c2128c0000040f000000000101041a0000067c0000013d000004eb0030009c0000064d0000613d000004ec0030009c000006700000613d000004ed0030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d000004b501000041000000800010043f0000051001000041000012c30001042e000004cc0030009c000006770000613d000004cd0030009c000006830000613d000004ce0030009c00000db30000c13d0000000001000416000000000001004b00000db30000c13d0000050101000041000000000101041a000004f9021001970000000003000411000000000023004b000006f10000c13d000000a001100270000004f8021001980000070e0000c13d0000052901000041000000000010043f000000040020043f0000052401000041000012c400010430000004dc0030009c000002f50000613d000004dd0030009c000006c00000613d000004de0030009c00000db30000c13d000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b001200000001001d000004f90010009c00000db30000213d0000000001000411000004f901100197000000000010043f0000051c01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000006dc0000613d0000001203000029000000000003004b000007c10000613d000004ff01000041000000000201041a0000050002200197000000000232019f000000000021041b0000000001000019000012c30001042e000004bd0030009c000006e30000613d000004be0030009c000006ea0000613d000004bf0030009c00000db30000c13d000000a40020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000402100370000000000202043b001200000002001d000004f80020009c00000db30000213d0000002402100370000000000202043b001100000002001d000004f90020009c00000db30000213d0000004402100370000000000202043b001000000002001d000004f90020009c00000db30000213d0000006402100370000000000202043b000f00000002001d000004f90020009c00000db30000213d0000008401100370000000000101043b000e00000001001d000004f90010009c00000db30000213d000004b301000041000000000201041a000d04b40020019b000c00000002001d000004b501200198000008d70000613d000000010010008c000008f80000c13d000004fa010000410000000000100443000000000100041000000004001004430000000001000414000004b20010009c000004b201008041000000c001100210000004fb011001c7000080020200003912c212bd0000040f0000000100200190000008d60000613d000000000101043b000008d80000013d0000000001000416000000000001004b00000db30000c13d0000052701000041000005f80000013d0000000001000416000000000001004b00000db30000c13d000000fa01000039000000800010043f0000051001000041000012c30001042e000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b000005490010019800000db30000c13d0000054a0010009c0000074a0000c13d00000001020000390000074f0000013d0000000001000416000000000001004b00000db30000c13d0000053701000041000000800010043f0000051001000041000012c30001042e000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b000004f90010009c00000db30000213d12c20e700000040f000006430000013d000000440020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000402100370000000000202043b001200000002001d0000002401100370000000000101043b001100000001001d000004f90010009c00000db30000213d0000001201000029000000000001004b00000011020000290000034f0000c13d0000052703000041000000000303041a000000000323013f000004f9003001980000034f0000c13d0000050101000041000000000101041a000000a002100270000004f803200197000004f900100198000007bc0000c13d000000000003004b000007bc0000613d001000000003001d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d000000000101043b0000001003000029000000000013004b00000012010000290000001102000029000007bc0000813d0000050103000041000000000403041a0000054004400197000000000043041b0000000003000411000000000032004b000007590000613d0000054101000041000000000010043f0000050d01000041000012c4000104300000000001000416000000000001004b00000db30000c13d12c20f0e0000040f000004f901100197000000800010043f000004f801200197000000a00010043f0000052201000041000012c30001042e000000440020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000402100370000000000202043b0000002401100370000000000101043b001200000001001d000004f90010009c00000db30000213d000000000002004b000007530000c13d0000054301000041000000000010043f0000050d01000041000012c400010430000000640020008c00000db30000413d0000000403100370000000000403043b000004b50040009c00000db30000213d0000002303400039000000000023004b00000db30000813d0000000403400039000000000531034f000000000505043b001200000005001d000004b50050009c00000db30000213d0000002405400039001000000005001d001100120050002d000000110020006b00000db30000213d0000004402100370000000000202043b000f00000002001d000004f90020009c00000db30000213d0000002402100370000000000502043b0000050902000041000000000402041a000000020040008c0000062e0000613d000d00000005001d0000000204000039000000000042041b0000002002000039000000a00020043f0000002002300039000000000221034f0000001203000029000000c00030043f0000054d013001980000001f0630018f000e00000001001d000000e001100039000003a50000613d000000e003000039000000000402034f000000004504043c0000000003530436000000000013004b000003a10000c13d000000000006004b000003b20000613d0000000e022003600000000303600210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f0000000000210435000b00000006001d0000001202000029000000e00120003900000000000104350000001f012000390000054d031001970000007f013000390000054d02100197000c00000003001d0000004001300039000000800010043f000005440020009c000007f20000813d0000008002200039000000400020043f000004b20010009c000004b20100804100000060011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000121019f00000513011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000010043f0000051401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000a00000001001d0000000101100039000800000001001d000000000101041a0000000d0010002a000008d00000413d0000000d02100029000900000002001d000004b50020009c000008580000213d00000000030004110000000d020000290000000f0400002912c20f3f0000040f000f00000001001d0000000012010434000300000001001d0000000001010433000000000021001a000008d00000413d00000000022100190000000f030000290000004003300039000700000003001d0000000003030433000000000023001a000008d00000413d00000000022300190000000f030000290000006003300039000600000003001d0000000003030433000000000023001a000008d00000413d00000000022300190000000f030000290000008003300039000500000003001d0000000003030433000000000023001a000008d00000413d000400000023001d0000000003000416000000040030006c00000be20000813d0000054501000041000000000010043f0000050d01000041000012c400010430000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b12c20e920000040f0000067c0000013d000000240020008c00000db30000413d0000000003000416000000000003004b00000db30000c13d0000000401100370000000000101043b000004b50010009c00000db30000213d000000040110003912c20e380000040f12c20ea40000040f0000067c0000013d000000440020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000402100370000000000202043b001200000002001d000004f90020009c00000db30000213d0000002401100370000000000101043b001100000001001d000004f90010009c00000db30000213d0000000001000411000004f901100197000000000010043f0000052f01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000007be0000c13d0000052001000041000000000010043f0000000001000411000000040010043f0000050801000041000000240010043f0000052101000041000012c400010430000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b001200000001001d000004f90010009c00000db30000213d0000000001000411000004f901100197000000000010043f0000051c01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000006dc0000613d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d000000000201043b000005360020009c000004d40000813d001100000002001d0000052701000041000000000101041a000f00000001001d001000d00010027a000008a50000c13d0000050101000041000000000101041a000000d0011002700000001101100029001100000001001d000004f80010009c000008d00000213d0000001101000029000000a0011002100000051e011001970000050102000041000000000302041a0000051d04300197000000000141019f00000012011001af000000000012041b0000051e00300198000004990000613d0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d0200003900000001030000390000051f0400004112c212b80000040f000000010020019000000db30000613d000000400100043d00000011020000290000000000210435000004b20010009c000004b20100804100000040011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f0000050b011001c70000800d0200003900000002030000390000053b040000410000001205000029000000c40000013d000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b001200000001001d000004f80010009c00000db30000213d0000000001000411000004f901100197000000000010043f0000051c01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000006dc0000613d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d000000000201043b000005360020009c000007f80000413d0000053a01000041000000000010043f0000003001000039000000040010043f000000240020043f0000052101000041000012c4000104300000000003000416000000000003004b00000db30000c13d000000840020008c00000db30000413d0000000403100370000000000503043b000004b50050009c00000db30000213d0000002303500039000000000023004b00000db30000813d0000000404500039000000000341034f000000000303043b000004b50030009c00000db30000213d00000000053500190000002405500039000000000025004b00000db30000213d0000002402100370000000000202043b001200000002001d0000004402100370000000000202043b001100000002001d000004f90020009c00000db30000213d0000006402100370000000000202043b001000000002001d000004f90020009c00000db30000213d0000016002000039000000400020043f0000002002400039000000000221034f000000800000043f000000a00000043f000000c00000043f000000e00000043f000001000000043f000001200000043f000001400000043f0000002001000039000001800010043f0000054d05300198000001a00030043f0000001f0630018f000001c004500039000005150000613d000001c007000039000000000802034f000000008908043c0000000007970436000000000047004b000005110000c13d000000000006004b000005220000613d000000000252034f0000000305600210000000000604043300000000065601cf000000000656022f000000000202043b0000010005500089000000000252022f00000000025201cf000000000262019f0000000000240435000001c00230003900000000000204350000001f023000390000054d032001970000007f023000390000054d022001970000004001300039000001600010043f000005180020009c000007f20000213d0000016002200039000000400020043f000004b20010009c000004b20100804100000060011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000121019f00000519011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000010043f0000051401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000000101100039000000000101041a00000012020000290000001103000029000000100400002912c210510000040f000000000301001900000000210104340000000002020433000000000121004b000008d00000413d00000040023000390000000002020433000000000121004b000008d00000413d00000060023000390000000002020433000000000121004b000008d00000413d00000080023000390000000002020433000000000221004b000002260000813d000008d00000013d000000640020008c00000db30000413d0000000003000416000000000003004b00000db30000c13d0000000403100370000000000403043b000004b50040009c00000db30000213d0000002303400039000000000023004b00000db30000813d0000000403400039000000000531034f000000000505043b001200000005001d000004b50050009c00000db30000213d0000001204400029001100240040003d000000110020006b00000db30000213d0000004402100370000000000202043b001000000002001d000004f90020009c00000db30000213d0000002402100370000000000502043b0000050902000041000000000402041a000000020040008c0000062e0000613d000e00000005001d0000000204000039000000000042041b0000002002000039000000a00020043f0000001204000029000000c00040043f0000054d054001980000001f0640018f000b00200030003d0000000b02100360000f00000005001d000000e001500039000005960000613d000000e003000039000000000402034f000000004504043c0000000003530436000000000013004b000005920000c13d000000000006004b000005a30000613d0000000f022003600000000303600210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f0000000000210435000c00000006001d0000001202000029000000e00120003900000000000104350000001f012000390000054d031001970000007f013000390000054d02100197000d00000003001d0000004001300039000000800010043f000005120020009c000007f20000213d0000008002200039000000400020043f000004b20010009c000004b20100804100000060011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000121019f00000513011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000010043f0000051401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000201043b0000000001000411000004f901100197000900000001001d000000000010043f000a00000002001d0000000301200039000800000001001d000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a0000000e0010006c00000d030000813d0000052e01000041000000000010043f0000050d01000041000012c4000104300000000001000416000000000001004b00000db30000c13d0000753001000039000000800010043f0000051001000041000012c30001042e0000000001000416000000000001004b00000db30000c13d00004e2001000039000000800010043f0000051001000041000012c30001042e0000000001000416000000000001004b00000db30000c13d000004ff01000041000000000101041a000004f901100197000000800010043f0000051001000041000012c30001042e0000000001000416000000000001004b00000db30000c13d0000000002000415000000140220008a00000005022002100000052701000041000000000301041a000000d001300272000006f60000c13d0000000501200270000000000100003f00000000010000190000000004000019000000400200043d000000200320003900000000004304350000000000120435000004b20020009c000004b202008041000000400120021000000532011001c7000012c30001042e000000240020008c00000db30000413d0000000003000416000000000003004b00000db30000c13d0000000403100370000000000403043b000004b50040009c00000db30000213d0000002303400039000000000023004b00000db30000813d0000000403400039000000000531034f000000000505043b001200000005001d000004b50050009c00000db30000213d00000012044000290000002404400039000000000024004b00000db30000213d0000050902000041000000000402041a000000020040008c000007c50000c13d0000054801000041000000000010043f0000050d01000041000012c4000104300000000001000416000000000001004b00000db30000c13d0000271001000039000000800010043f0000051001000041000012c30001042e000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b000004f90010009c00000db30000213d12c20e810000040f000000000101041a000004f9011001970000067c0000013d0000000001000416000000000001004b00000db30000c13d0000051b01000041000000800010043f0000051001000041000012c30001042e000000240020008c00000db30000413d0000000003000416000000000003004b00000db30000c13d0000000401100370000000000101043b000004b50010009c00000db30000213d000000040110003912c20e380000040f12c20ea40000040f000000000010043f0000051401000041000000200010043f0000004002000039000000000100001912c2128c0000040f0000000102100039000000000202041a000000000301041a0000000201100039000000000101041a000000400400043d0000004005400039000000000015043500000020014000390000000000210435000004f9013001970000000000140435000004b20040009c000004b204008041000000400140021000000542011001c7000012c30001042e0000000001000416000000000001004b00000db30000c13d000061a801000039000000800010043f0000051001000041000012c30001042e0000000001000416000000000001004b00000db30000c13d12c20ef00000040f000004f801100197000000400200043d0000000000120435000004b20020009c000004b20200804100000040012002100000051a011001c7000012c30001042e000000840020008c00000db30000413d0000000003000416000000000003004b00000db30000c13d0000000403100370000000000303043b000004b50030009c00000db30000213d0000002304300039000000000024004b00000db30000813d001100040030003d0000001104100360000000000404043b001200000004001d000004b50040009c00000db30000213d00000012033000290000002403300039000000000023004b00000db30000213d0000002402100370000000000202043b001000000002001d000004f90020009c00000db30000213d0000004402100370000000000202043b000f00000002001d000004f90020009c00000db30000213d0000006401100370000000000101043b000e00000001001d0000000001000411000004f901100197000000000010043f0000052a01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff001001900000090a0000c13d0000052001000041000000000010043f0000000001000411000000040010043f0000050f01000041000000240010043f0000052101000041000012c400010430000000240020008c00000db30000413d0000000002000416000000000002004b00000db30000c13d0000000401100370000000000101043b001200000001001d000004f90010009c00000db30000213d0000000001000411000004f901100197000000000010043f0000051c01000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000007730000c13d0000052001000041000000000010043f0000000001000411000000040010043f000000240000043f0000052101000041000012c4000104300000000001000416000000000001004b00000db30000c13d0000051101000041000000800010043f0000051001000041000012c30001042e0000000001000416000000000001004b00000db30000c13d0000050f01000041000000800010043f0000051001000041000012c30001042e0000052301000041000000000010043f000000040030043f0000052401000041000012c400010430001100000003001d001200000001001d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d0000000002000415000000130220008a0000000502200210000000000101043b0000001204000029000000000014004b0000001101000029000006070000413d000000a001100270000004f8011001970000060b0000013d001200000002001d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d000000000101043b0000001202000029000000000012004b000002840000813d0000052701000041000000000201041a001200000002001d0000050002200197000000000021041b000000000000043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d0000001202000029000004f902200197000000000101043b001200000002001d000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000009d10000c13d000000000100041112c211d80000040f0000050101000041000000000201041a0000051d02200197000000000021041b0000000001000019000012c30001042e0000054b0010009c000000000200003900000001020060390000054c0010009c00000001022061bf000000010120018f000000800010043f0000051001000041000012c30001042e0000000001020019001100000002001d12c20e920000040f12c20f140000040f0000001101000029000000120200002912c212310000040f0000000001000019000012c30001042e000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d000000000101043b000000120010006b000008070000813d000000110100002900000030011002100000051d011001970000050102000041000000000302041a0000050203300197000000000113019f000000000012041b000000360000013d0000050f01000041000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001202000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000000c70000c13d0000050f01000041000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001202000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000054e0220019700000001022001bf000000000021041b0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d02000039000000040300003900000507040000410000050f0500004100000012060000290000000007000411000000c40000013d0000052901000041000006f20000013d0000001201000029000000000001004b000008130000c13d0000053301000041000000000010043f0000050d01000041000012c4000104300000000204000039000000000042041b0000002002000039000000a00020043f0000001204000029000000c00040043f0000054d074001980000001f0840018f000e00200030003d0000000e03100360000000e001700039000007d70000613d000000e004000039000000000503034f000000005605043c0000000004640436000000000014004b000007d30000c13d000000000008004b000007e40000613d000000000373034f0000000304800210000000000501043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f0000000000310435001000000008001d001100000007001d0000001203000029000000e00130003900000000000104350000001f013000390000054d031001970000007f013000390000054d02100197000f00000003001d0000004001300039000000800010043f000005120020009c000008370000a13d0000054701000041000000000010043f0000004101000039000000040010043f0000052401000041000012c400010430001100000002001d0000052701000041000000000101041a000f00000001001d001000d00010027a000008b70000c13d0000050101000041000000000101041a000000d001100270000000120110006c000008ca0000813d0000001201000029000005370010009c0000053701008041000008cc0000013d0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d020000390000000103000039000005380400004112c212b80000040f000000010020019000000db30000613d000000360000013d000000000010043f0000053001000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a00000500022001970000001103000029000000000232019f000000000021041b000000400100043d0000002002100039000000000032043500000012020000290000000000210435000004b20010009c000004b20100804100000040011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000505011001c70000800d0200003900000001030000390000053104000041000000c40000013d0000008002200039000000400020043f000004b20010009c000004b20100804100000060011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000121019f00000513011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000010043f0000051401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000201043b0000000201200039000000000401041a000000000004004b000009fd0000c13d0000054601000041000000000010043f0000050d01000041000012c4000104300000001201000029000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001102000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff00100190000000c70000c13d0000001201000029000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001102000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000054e0220019700000001022001bf000000000021041b0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d0200003900000004030000390000050704000041000000120500002900000011060000290000000007000411000000c40000013d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d000000000101043b000000100010006b0000047c0000813d0000000f01000029000000a001100270000004f8011001970000047f0000013d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f0000000100200190000008d60000613d000000000101043b000000100010006b000007fe0000813d0000000f01000029000000a001100270000004f801100197000000120110006c000008030000413d000004f80010009c000008d00000213d0000001101100029001000000001001d000004f80010009c000008fc0000a13d0000054701000041000000000010043f0000001101000039000000040010043f0000052401000041000012c400010430000000000001042f0000000d01000029000000000001004b000008f80000c13d0000000c03000029000004fc0130019700000001021001bf000004fd01300197000004fe011001c70000000d0000006b000000000102c019000004b302000041000000000012041b000000110000006b000007c10000613d000000100000006b000007c10000613d0000000f02000029000f04f90020019c000007c10000613d0000000e02000029000004f902200198000007c10000613d000004ff03000041000000000403041a0000050004400197000000000224019f000000000023041b000004b40010019800000ae20000c13d0000050c01000041000000000010043f0000050d01000041000012c4000104300000050e01000041000000000010043f0000050d01000041000012c4000104300000052701000041000000000101041a000000d00210027200000a110000613d000000110020006c00000a040000813d00000030021002100000051d022001970000050103000041000000000403041a0000050204400197000000000224019f000000000023041b00000a110000013d000000400100043d0000004002100039000000120400002900000000004204350000002002100039000000200300003900000000003204350000054d05400198000d001f004001930000006004100039000c00000005001d000000000554001900000011060000290000002006600039000b00000006001d0000000106600367000009210000613d000000000706034f0000000008040019000000007907043c0000000008980436000000000058004b0000091d0000c13d0000000d0000006b0000092f0000613d0000000c066003600000000d070000290000000307700210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f00000000006504350000001205000029000000000454001900000000000404350000001f045000390000054d0540019700000040045000390000000000410435001100000005001d0000007f045000390000054d034001970000000003310019000000000013004b00000000040000390000000104004039000004b50030009c000007f20000213d0000000100400190000007f20000c13d000000400030043f000004b20020009c000004b20200804100000040022002100000000001010433000004b20010009c000004b2010080410000006001100210000000000121019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000506011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000010043f0000051401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001002000029000000000020043f0000000301100039000a00000001001d000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a0000000e0010006c000005e20000413d0000001001000029000000000010043f0000000a01000029000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000000e0220006c000008d00000413d000000000021041b0000000f01000029000000000010043f0000000a01000029000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000000e0020002a000008d00000413d0000000e02200029000000000021041b000000400100043d0000004002100039000000120300002900000000003204350000004002000039000000000221043600000060031000390000000c043000290000000b0500002900000001055003670000000c0000006b000009ab0000613d000000000605034f0000000007030019000000006806043c0000000007870436000000000047004b000009a70000c13d0000000d0000006b000009b90000613d0000000c055003600000000d060000290000000306600210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f0000000000540435000000120330002900000000000304350000000e030000290000000000320435000004b20010009c000004b201008041000000400110021000000011020000290000052b0020009c0000052b020080410000006002200210000000000112019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000121019f0000052c0110009a0000800d0200003900000003030000390000052d0400004100000010050000290000000f06000029000000c40000013d000000000000043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001202000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000054e02200197000000000021041b0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d020000390000000403000039000005280400004100000000050000190000001206000029000000000700041112c212b80000040f0000000100200190000007420000c13d00000db30000013d000000000202041a000d04f90020019c00000b9b0000c13d0000053f01000041000000000010043f0000050d01000041000012c4000104300000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d020000390000000103000039000005380400004112c212b80000040f000000010020019000000db30000613d0000052701000041000000000101041a000004f9011001970000001203000029000000a0023002100000051e02200197000000000112019f0000001004000029000000d002400210000000000121019f0000052702000041000000000012041b000000400100043d000000200210003900000000004204350000000000310435000004b20010009c000004b20100804100000040011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000505011001c70000800d0200003900000001030000390000053904000041000000c40000013d000000400100043d0000004002100039000000120400002900000000004204350000002002100039000000200300003900000000003204350000054d05400198000d001f004001930000006003100039000c00000005001d000000000453001900000011050000290000002005500039001100000005001d000000010550036700000a430000613d000000000605034f0000000007030019000000006806043c0000000007870436000000000047004b00000a3f0000c13d0000000d0000006b00000a510000613d0000000c055003600000000d060000290000000306600210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f00000000005404350000001204000029000000000343001900000000000304350000001f034000390000054d0530019700000040035000390000000000310435000b00000005001d0000007f035000390000054d033001970000000003310019000000000013004b00000000040000390000000104004039000004b50030009c000007f20000213d0000000100400190000007f20000c13d000000400030043f000004b20020009c000004b20200804100000040022002100000000001010433000004b20010009c000004b2010080410000006001100210000000000121019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000506011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000010043f0000051401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a000005000220019700000010022001af000000000021041b000000400100043d0000006002100039000000120300002900000000003204350000006002000039000000000221043600000080041000390000000c05400029000000010300036700000011063003600000000c0000006b00000a9a0000613d000000000706034f0000000008040019000000007907043c0000000008980436000000000058004b00000a960000c13d0000000d0000006b00000aa80000613d0000000c066003600000000d070000290000000307700210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f0000000000650435000000120540002900000000000504350000000b05400029000000000415004900000040061000390000000000460435000000100400002900000000004204350000000e043003600000000f0300002900000000023504360000054d053001980000001f0630018f000000000352001900000abd0000613d000000000704034f0000000008020019000000007907043c0000000008980436000000000038004b00000ab90000c13d000000000006004b00000aca0000613d000000000454034f0000000305600210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004304350000000f040000290000001f034000390000054d033001970000000004420019000000000004043500000000031300490000000002230019000004b20020009c000004b2020080410000006002200210000004b20010009c000004b2010080410000004001100210000000000112019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000506011001c70000800d0200003900000001030000390000053504000041000000c40000013d0000001201000029000000d0011002100000050102000041000000000302041a0000050203300197000000000113019f000000000012041b000000110100002912c211d80000040f0000050301000041000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001002000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff0010019000000b360000c13d0000050301000041000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000001002000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000054e0220019700000001022001bf000000000021041b0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d020000390000000403000039000000000700041100000507040000410000050305000041000000100600002912c212b80000040f000000010020019000000db30000613d0000050801000041000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000000f02000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000ff0010019000000b810000c13d0000050801000041000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b0000000f02000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000054e0220019700000001022001bf000000000021041b0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d0200003900000004030000390000000007000411000005070400004100000508050000410000000f0600002912c212b80000040f000000010020019000000db30000613d000004b301000041000000000101041a000004b400100198000008f40000613d00000001030000390000050902000041000000000032041b0000000d0000006b000000c70000c13d0000050a01100197000004b302000041000000000012041b000000400100043d0000000000310435000004b20010009c000004b20100804100000040011002100000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f0000050b011001c70000800d02000039000004b704000041000000c40000013d000c00000004001d000000000001041b0000000d01000029000000000204001912c211610000040f000000400100043d0000006002100039000000120300002900000000003204350000002002100039000000600300003900000000003204350000000c020000290000000000210435000000800210003900000011032000290000000e040000290000000104400367000000110000006b00000bb50000613d000000000504034f0000000006020019000000005705043c0000000006760436000000000036004b00000bb10000c13d000000100000006b00000bc30000613d000000110440036000000010050000290000000305500210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f000000000043043500000012022000290000000000020435000000400210003900000000030004110000000000320435000004b20010009c000004b20100804100000040011002100000000f020000290000053c0020009c0000053c020080410000006002200210000000000112019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000121019f0000053d0110009a0000800d0200003900000002030000390000053e040000410000000d0500002912c212b80000040f000000010020019000000db30000613d00000001010000390000050902000041000000000012041b0000000001000019000012c30001042e00000009020000290000000803000029000000000023041b0000000a020000290000000202200039000000000302041a000000000013001a000008d00000413d0000000001130019000000000012041b0000000001000411000004f901100197000800000001001d000000000010043f0000000a010000290000000301100039000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000000d0020002a000008d00000413d0000000d02200029000000000021041b0000000f01000029000000a001100039000a00000001001d0000000001010433000200000001001d0000000801000029000000000010043f0000051501000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000020110014f000004f90010019800000c300000613d0000000a010000290000000001010433000200000001001d0000000801000029000000000010043f0000051501000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d0000000202000029000004f902200197000000000101043b000000000301041a0000050003300197000000000223019f000000000021041b00000006010000290000000002010433000000000002004b00000c380000613d0000000a010000290000000001010433000004f90110019712c211610000040f00000005010000290000000002010433000000000002004b0000000f01000029000800c00010003d00000c420000613d00000008010000290000000001010433000004f90110019712c211610000040f00000007010000290000000002010433000004ff01000041000000000101041a000004f90110019712c211610000040f0000000002000416000000040220006c00000c4d0000a13d000000000100041112c211610000040f000000400100043d000005160010009c000007f20000213d0000000502000029000000000a0204330000000602000029000000000902043300000007020000290000000006020433000000030200002900000000050204330000000f0200002900000000040204330000000a020000290000000003020433000000080200002900000000080204330000018002100039000000400020043f000000000200041100000000022104360000000c070000290000003f077000390000054d0b700197000000400700043d000000000bb7001900000000007b004b000000000c000039000000010c004039000004b500b0009c000007f20000213d0000000100c00190000007f20000c13d0000004000b0043f000000120b000029000000000bb70436000000110d0000290000000000d0007c00000db30000213d000000100c0000290011000100c0036b0000000e0cb000290000000e0000006b00000c7f0000613d000000110e00035f000000000f0b001900000000ed0e043c000000000fdf04360000000000cf004b00000c7b0000c13d000004f90e300197000004f90f8001970000000b0000006b00000c900000613d000000110800035f0000000e038003600000000b080000290000000308800210000000000d0c0433000000000d8d01cf000000000d8d022f000000000303043b0000010008800089000000000383022f00000000038301cf0000000003d3019f00000000003c04350000001203b00029000000000003043500000160081000390000000903000029001200000008001d00000000003804350000014003100039001100000003001d0000000000f30435000001200b1000390000000000eb0435000001000c1000390000000000ac0435000000e00a10003900000000009a0435000000c0091000390000000000690435000000a006100039000000000056043500000080051000390000000000450435000000600d100039000000010400003900000000004d0435000000400e1000390000000d0300002900000000003e04350000000000720435000000400400043d000000200300003900000000073404360000000001010433000004f90110019700000000001704350000000001020433000000400240003900000180070000390000000000720435000001a00f400039000000007201043400000000002f0435000001c001400039000000000002004b00000cc40000613d000000000f00001900000000031f00190000000008f7001900000000080804330000000000830435000000200ff0003900000000002f004b00000cbd0000413d0000000003210019000000000003043500000000030e04330000006007400039000000000037043500000000030d0433000000000003004b0000000003000039000000010300c039000000800740003900000000003704350000000003050433000000a00540003900000000003504350000000003060433000000c00540003900000000003504350000000003090433000000e005400039000000000035043500000000030a04330000010005400039000000000035043500000000030c04330000012005400039000000000035043500000000030b0433000004f9033001970000014005400039000000000035043500000011030000290000000003030433000004f9033001970000016005400039000000000035043500000012030000290000000003030433000001800540003900000000003504350000001f022000390000054d0220019700000000024200490000000001120019000004b20010009c000004b2010080410000006001100210000004b20040009c000004b2040080410000004002400210000000000121019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000506011001c70000800d020000390000000103000039000005170400004112c212b80000040f000000010020019000000db30000613d00000bdd0000013d0000000a010000290000000101100039000600000001001d000000000101041a000700000001001d0000000e020000290000000003000411000000100400002912c210510000040f001000000001001d0000000012010434000500000001001d0000000001010433000000000212004b000008d00000413d00000010030000290000004003300039000400000003001d0000000003030433000000000232004b000008d00000413d00000010030000290000006003300039000300000003001d0000000003030433000000000232004b000008d00000413d00000010030000290000008003300039000200000003001d00000000030304330001000000320053000008d00000413d00000007030000290007000e00300074000008d00000413d00000007020000290000000603000029000000000023041b0000000a020000290000000202200039000000000302041a000000000013001a000008d00000413d0000000001130019000000000012041b0000000901000029000000000010043f0000000801000029000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000201041a0000000e0220006c000008d00000413d000000000021041b0000001001000029000000a001100039000a00000001001d0000000001010433000800000001001d0000000901000029000000000010043f0000051501000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d000000000101043b000000000101041a000000080110014f000004f90010019800000d710000613d0000000a010000290000000001010433000800000001001d0000000901000029000000000010043f0000051501000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000db30000613d0000000802000029000004f902200197000000000101043b000000000301041a0000050003300197000000000223019f000000000021041b00000003010000290000000002010433000000000002004b00000d790000613d0000000a010000290000000001010433000004f90110019712c211610000040f0000001001000029000900c00010003d00000002010000290000000002010433000000000002004b00000d830000613d00000009010000290000000001010433000004f90110019712c211610000040f000004ff01000041000000000101041a00000004020000290000000002020433000004f90110019712c211610000040f0000000001000411000000010200002912c211610000040f000000400100043d000005160010009c000007f20000213d0000000202000029000000000902043300000003020000290000000007020433000000040200002900000000060204330000000502000029000000000502043300000010020000290000000004020433000000090200002900000000030204330000000a0200002900000000080204330000018002100039000000400020043f000000000200041100000000022104360000000d0a0000290000003f0aa000390000054d0ba00197000000400a00043d000000000bba00190000000000ab004b000000000c000039000000010c004039000004b500b0009c000007f20000213d0000000100c00190000007f20000c13d0000004000b0043f000000120b000029000000000bba0436000000110d0000290000000000d0007c00000db50000a13d0000000001000019000012c4000104300000000b0c0000290011000100c0036b0000000f0cb000290000000f0000006b00000dc00000613d000000110e00035f000000000f0b001900000000ed0e043c000000000fdf04360000000000cf004b00000dbc0000c13d000004f90f300197000004f90e8001970000000c0000006b00000dd10000613d000000110800035f0000000f038003600000000c080000290000000308800210000000000d0c0433000000000d8d01cf000000000d8d022f000000000303043b0000010008800089000000000383022f00000000038301cf0000000003d3019f00000000003c04350000001203b00029000000000003043500000160081000390000000703000029001200000008001d00000000003804350000014003100039001100000003001d0000000000f30435000001200b1000390000000000eb0435000001000c10003900000000009c0435000000e0091000390000000000790435000000c0071000390000000000670435000000a006100039000000000056043500000080051000390000000000450435000000400d1000390000000e0300002900000000003d04350000000000a20435000000600a10003900000000000a0435000000400400043d0000002003000039000000000e3404360000000001010433000004f90110019700000000001e043500000000010204330000004002400039000001800e0000390000000000e20435000001a00f40003900000000e201043400000000002f0435000001c001400039000000000002004b00000e040000613d000000000f00001900000000031f00190000000008fe001900000000080804330000000000830435000000200ff0003900000000002f004b00000dfd0000413d0000000003210019000000000003043500000000030d04330000006008400039000000000038043500000000030a0433000000000003004b0000000003000039000000010300c039000000800840003900000000003804350000000003050433000000a00540003900000000003504350000000003060433000000c00540003900000000003504350000000003070433000000e005400039000000000035043500000000030904330000010005400039000000000035043500000000030c04330000012005400039000000000035043500000000030b0433000004f9033001970000014005400039000000000035043500000011030000290000000003030433000004f9033001970000016005400039000000000035043500000012030000290000000003030433000001800540003900000000003504350000001f022000390000054d0220019700000000024200490000000001120019000004b20010009c000004b2010080410000006001100210000004b20040009c000004b2040080410000004002400210000000000121019f000000000200041400000cf70000013d0000001f03100039000000000023004b00000000040000190000054f040040410000054f052001970000054f03300197000000000653013f000000000053004b00000000030000190000054f030020410000054f0060009c000000000304c019000000000003004b00000e500000613d0000000103100367000000000303043b000004b50030009c00000e500000213d00000020011000390000000004310019000000000024004b00000e500000213d0000000002030019000000000001042d0000000001000019000012c4000104300000000002210436000000005403043400000000004204350000000002050433000000400410003900000000002404350000004002300039000000000202043300000060041000390000000000240435000000600230003900000000020204330000008004100039000000000024043500000080023000390000000002020433000000a0041000390000000000240435000000a0023000390000000002020433000004f902200197000000c0041000390000000000240435000000c0023000390000000002020433000004f902200197000000e00310003900000000002304350000010001100039000000000001042d000004f901100197000000000010043f0000051501000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000e7f0000613d000000000101043b000000000001042d0000000001000019000012c400010430000004f901100197000000000010043f0000053001000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000e900000613d000000000101043b000000000001042d0000000001000019000012c400010430000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000ea20000613d000000000101043b0000000101100039000000000101041a000000000001042d0000000001000019000012c400010430000000400300043d000000400430003900000000002404350000002004300039000000200500003900000000005404350000054d082001980000001f0920018f00000060063000390000000007860019000000010110036700000eb60000613d000000000a01034f000000000b06001900000000ac0a043c000000000bcb043600000000007b004b00000eb20000c13d000000000009004b00000ec30000613d000000000181034f0000000308900210000000000907043300000000098901cf000000000989022f000000000101043b0000010008800089000000000181022f00000000018101cf000000000191019f0000000000170435000000000126001900000000000104350000001f012000390000054d01100197000000400210003900000000002304350000007f011000390000054d021001970000000001320019000000000021004b00000000020000390000000102004039000004b50010009c00000ee80000213d000000010020019000000ee80000c13d000000400010043f000004b20040009c000004b20400804100000040014002100000000002030433000004b20020009c000004b2020080410000006002200210000000000112019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000506011001c7000080100200003912c212bd0000040f000000010020019000000eee0000613d000000000101043b000000000001042d0000054701000041000000000010043f0000004101000039000000040010043f0000052401000041000012c4000104300000000001000019000012c40001043000020000000000020000052701000041000000000101041a000000d00210027200000f090000613d000100000002001d000200000001001d000005250100004100000000001004430000000001000414000004b20010009c000004b201008041000000c00110021000000526011001c70000800b0200003912c212bd0000040f000000010020019000000f0d0000613d000000000101043b000000010010006b000000020100002900000f090000813d000000a001100270000004f801100197000000000001042d0000050101000041000000000101041a000000d001100270000000000001042d000000000001042f0000050101000041000000000201041a000004f901200197000000a002200270000004f802200197000000000001042d0001000000000002000100000001001d000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000f350000613d000000000101043b0000000002000411000004f902200197000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f000000010020019000000f350000613d000000000101043b000000000101041a000000ff0010019000000f370000613d000000000001042d0000000001000019000012c4000104300000052001000041000000000010043f0000000001000411000000040010043f0000000101000029000000240010043f0000052101000041000012c4000104300008000000000002000000400f00043d0000055000f0009c000010430000813d000000e005f00039000000400050043f000000c008f000390000000000080435000000a005f00039000600000005001d00000000000504350000008005f00039000500000005001d00000000000504350000006007f0003900000000000704350000004006f00039000000000006043500000000050f04360000000000050435000004f903300198000010490000613d000300000007001d000200000006001d000000000002004b0000104d0000613d000400000008001d000000000012001a000010320000413d000000000812001a000010320000613d000000010780008a00000000068700a9000000000001004b00000f750000613d000000000007004b00000f870000613d00000000097600d9000000000089004b000010320000c13d000005510070009c000010320000213d000000000006004b00000f8c0000613d000000010970021000000001099001bf000000000b6900a9000000000a6b00d900000000009a004b000010320000c13d000000010a10008c00000000091a00a900000f900000c13d00000f9f0000013d000000000007004b0000100b0000613d00000000017600d9000000000081004b000010320000c13d000005510070009c000010320000213d000000010170021000000001071001bf00000000016700a9000000000006004b00000f840000613d00000000086100d9000000000078004b000010320000c13d000000060b10011a000000010160027000000fb20000013d000000000b000019000000010a10008c00000000091a00a900000f900000c13d00000f9f0000013d000000000b000019000000010a10008c00000000091a00a900000f9f0000613d000000000ca900d900000000001c004b000010320000c13d000005510010009c000010320000213d0000000100100212000010320000613d000000000009004b00000f9f0000613d000000000d1a0019000000000c9d00a9000000000e9c00d90000000000de004b00000fa00000613d000010320000013d000000000c000019000000060bb0011a000000060cc0011a000000000bcb004b000010320000413d000000000007004b00000fa90000613d00000000077600d9000000000087004b000010320000c13d00000000000a004b00000fae0000613d0000000007a900d9000000000017004b000010320000c13d00000001016002700000000106900270000000000161004b000010320000413d00000511062000d1000005110760012a000000000027004b000010320000c13d0000000f02b000c90000000f0720011a0000000000b7004b000010320000c13d000000000062001a000010320000413d000061a8071000c9000061a80870011a000000000018004b000010320000c13d0000000001620019000000000071001a000010320000413d000000000271001a00000000002f043500004e20012000c900000fca0000613d00000000022100d900004e200020008c000010320000c13d00010000000f001d0000051b0110012a0000000000150435000004f90140019800000fd20000613d0000000602000029000000000012043500000fe40000013d000000000030043f0000051501000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000010410000613d000000000101043b000000000101041a000004f901100198000000060200002900000000001204350000100e0000613d000000000010043f0000053001000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000010410000613d00000006020000290000000005020433000000000101043b000000000101041a000004f902100197000000040100002900000000002104350000000003000415000000080330008a0000000503300210000000000002004b000000fa07000039000000000700603900000000040000390000000104006039000004f9005001980000000101000029000010090000613d0000000003000415000000070330008a0000000503300210000000000002004b0000280a020000390000271002006039000010170000013d0000000002000019000010170000013d000000000b000019000000010160027000000fb20000013d000000040100002900000000000104350000000003000415000000080330008a0000000503300210000000010400003900000000070000190000000002000019000000010100002900000001004001900000743604000039000075300400c039000000050330027000000000032400550000000003010433000000000003004b000010380000613d00000000057300a900000000063500d9000000000076004b000010320000c13d0000051b0550012a0000000506000029000000000056043500000000062300a900000000053600d9000000000025004b000010320000c13d00000000022400490000051b0460012a0000000305000029000000000045043500000000042300a900000000033400d9000000000023004b0000103d0000613d0000054701000041000000000010043f0000001101000039000000040010043f0000052401000041000012c400010430000000050200002900000000000204350000000302000029000000000002043500000000040000190000051b0240012a00000002030000290000000000230435000000000001042d0000000001000019000012c4000104300000054701000041000000000010043f0000004101000039000000040010043f0000052401000041000012c4000104300000053301000041000000000010043f0000050d01000041000012c4000104300000054601000041000000000010043f0000050d01000041000012c4000104300008000000000002000000400f00043d0000055000f0009c000011570000813d000000e005f00039000000400050043f000000c008f000390000000000080435000000a00df0003900000000000d04350000008005f00039000500000005001d00000000000504350000006005f00039000400000005001d00000000000504350000004006f00039000000000006043500000000050f04360000000000050435000000000721004b000011510000413d000004f9033001980000115d0000613d000000000002004b000011510000613d000300000008001d000200000006001d000000010810008a00000000061800a9000000000021004b00060000000d001d000010840000c13d000000000008004b000010970000613d00000000078600d9000000000017004b000011420000c13d000005510080009c000011420000213d000000010180021000000001071001bf00000000016700a9000000000006004b000010810000613d00000000086100d9000000000078004b000011420000c13d000000060b10011a0000000101600270000010c60000013d000000000008004b0000109a0000613d00000000098600d9000000000019004b000011420000c13d000005510080009c000011420000213d000000000006004b0000109f0000613d000000010980021000000001099001bf000000000b6900a9000000000a6b00d900000000009a004b000011420000c13d000000010a70008c00000000097a00a9000010a30000c13d000010b30000013d000000000b0000190000000101600270000010c60000013d000000000b000019000000010a70008c00000000097a00a9000010a30000c13d000010b30000013d000000000b000019000000010a70008c00000000097a00a9000010b30000613d000000000ca900d900000000007c004b000011420000c13d000005510070009c000011420000213d0000000100700212000011420000613d000000000009004b000010b30000613d000000000d7a0019000000000c9d00a9000000000e9c00d90000000000de004b000000060d000029000010b40000613d000011420000013d000000000c000019000000060bb0011a000000060cc0011a000000000bcb004b000011420000413d000000000008004b000010bd0000613d00000000088600d9000000000018004b000011420000c13d00000000000a004b000010c20000613d0000000001a900d9000000000071004b000011420000c13d00000001016002700000000106900270000000000161004b000011420000413d00000511062000d1000005110760012a000000000027004b000011420000c13d0000000f02b000c90000000f0720011a0000000000b7004b000011420000c13d000000000062001a000011420000413d000061a8071000c9000061a80870011a000000000018004b000011420000c13d0000000001620019000000000071001a000011420000413d000000000271001a00000000002f043500004e20012000c9000010de0000613d00000000022100d900004e200020008c000011420000c13d00010000000f001d0000051b0110012a0000000000150435000004f901400198000010e50000613d00000000001d0435000010f70000013d000000000030043f0000051501000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000011550000613d000000000101043b000000000101041a000004f901100198000000060200002900000000001204350000111e0000613d000000000010043f0000053001000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000011550000613d00000006020000290000000005020433000000000101043b000000000101041a000004f902100197000000030100002900000000002104350000000003000415000000080330008a0000000503300210000000000002004b000000fa07000039000000000700603900000000040000390000000104006039000004f90050019800000001010000290000111c0000613d0000000003000415000000070330008a0000000503300210000000000002004b0000280a020000390000271002006039000011270000013d0000000002000019000011270000013d000000030100002900000000000104350000000003000415000000080330008a0000000503300210000000010400003900000000070000190000000002000019000000010100002900000001004001900000743604000039000075300400c039000000050330027000000000032400550000000003010433000000000003004b000011480000613d00000000057300a900000000063500d9000000000076004b000011420000c13d0000051b0550012a0000000506000029000000000056043500000000062300a900000000053600d9000000000025004b000011420000c13d00000000022400490000051b0460012a0000000405000029000000000045043500000000042300a900000000033400d9000000000023004b0000114d0000613d0000054701000041000000000010043f0000001101000039000000040010043f0000052401000041000012c400010430000000050200002900000000000204350000000402000029000000000002043500000000040000190000051b0240012a00000002030000290000000000230435000000000001042d0000054601000041000000000010043f0000050d01000041000012c4000104300000000001000019000012c4000104300000054701000041000000000010043f0000004101000039000000040010043f0000052401000041000012c4000104300000053301000041000000000010043f0000050d01000041000012c4000104300003000000000002000200000002001d000100000001001d00000552010000410000000000100443000000000100041000000004001004430000000001000414000004b20010009c000004b201008041000000c001100210000004fb011001c70000800a0200003912c212bd0000040f0000000100200190000011b20000613d000000000101043b0000000203000029000000000031004b000011b30000413d0000000101000029000004f9041001970000000001000414000004b20010009c000004b201008041000000c001100210000000000003004b000011810000613d00000506011001c700008009020000390000000005000019000011820000013d000000000204001912c212b80000040f0000006003100270000004b205300198000011ad0000613d0000001f0350003900000553033001970000003f033000390000055404300197000000400300043d0000000004430019000000000034004b00000000060000390000000106004039000004b50040009c000011ca0000213d0000000100600190000011ca0000c13d000000400040043f0000001f0650018f0000000004530436000005550750019800000000057400190000119f0000613d000000000801034f0000000009040019000000008a08043c0000000009a90436000000000059004b0000119b0000c13d000000000006004b000011af0000613d000000000171034f0000000306600210000000000705043300000000076701cf000000000767022f000000000101043b0000010006600089000000000161022f00000000016101cf000000000171019f0000000000150435000011af0000013d000000600300003900000080040000390000000100200190000011c30000613d000000000001042d000000000001042f0000000001000410000300000001001d0000800a0100003900000024030000390000000004000415000000030440008a0000000504400210000005520200004112c212a10000040f0000055702000041000000000020043f000000040010043f0000000201000029000000240010043f0000052101000041000012c4000104300000000001030433000000000001004b000011d00000c13d0000055601000041000000000010043f0000050d01000041000012c4000104300000054701000041000000000010043f0000004101000039000000040010043f0000052401000041000012c400010430000004b20040009c000004b2040080410000004002400210000004b20010009c000004b2010080410000006001100210000000000121019f000012c40001043000010000000000020000052702000041000000000302041a000004f9003001980000122d0000c13d000104f90010019b000005000130019700000001011001af000000000012041b000000000000043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f00000001002001900000122b0000613d000000000101043b0000000102000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f00000001002001900000122b0000613d000000000101043b000000000101041a000000ff001001900000122a0000c13d000000000000043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f00000001002001900000122b0000613d000000000101043b0000000102000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f00000001002001900000122b0000613d000000000101043b000000000201041a0000054e0220019700000001022001bf000000000021041b0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d020000390000000403000039000000000700041100000507040000410000000005000019000000010600002912c212b80000040f00000001002001900000122b0000613d000000000001042d0000000001000019000012c4000104300000054301000041000000000010043f0000050d01000041000012c4000104300002000000000002000000000001004b0000123b0000c13d0000052704000041000000000504041a000000000325013f000004f9003001980000123b0000c13d0000050003500197000000000034041b000100000002001d000200000001001d000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000012890000613d000000000101043b0000000102000029000004f902200197000100000002001d000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000012890000613d000000000101043b000000000101041a000000ff00100190000012880000613d0000000201000029000000000010043f0000050401000041000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000012890000613d000000000101043b0000000102000029000000000020043f000000200010043f0000000001000414000004b20010009c000004b201008041000000c00110021000000505011001c7000080100200003912c212bd0000040f0000000100200190000012890000613d000000000101043b000000000201041a0000054e02200197000000000021041b0000000001000414000004b20010009c000004b201008041000000c00110021000000506011001c70000800d020000390000000403000039000000000700041100000528040000410000000205000029000000010600002912c212b80000040f0000000100200190000012890000613d000000000001042d0000000001000019000012c400010430000000000001042f000004b20010009c000004b2010080410000004001100210000004b20020009c000004b2020080410000006002200210000000000112019f0000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000506011001c7000080100200003912c212bd0000040f00000001002001900000129f0000613d000000000101043b000000000001042d0000000001000019000012c40001043000000000050100190000000000200443000000040030008c000012a80000a13d000000050140027000000000010100310000000400100443000004b20030009c000004b20300804100000060013002100000000002000414000004b20020009c000004b202008041000000c002200210000000000112019f00000558011001c7000000000205001912c212bd0000040f0000000100200190000012b70000613d000000000101043b000000000001042d000000000001042f000012bb002104210000000102000039000000000001042d0000000002000019000000000001042d000012c0002104230000000102000039000000000001042d0000000002000019000000000001042d000012c200000432000012c30001042e000012c40001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a000000000000000000000000000000000000000000000000ff0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff0200000000000000000000000000000000000020000000800000000000000000c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d200000002000000000000000000000000000000400000010000000000000000000000000000000000000000000000000000000000000000000000000084ef8ffb00000000000000000000000000000000000000000000000000000000cf6eefb600000000000000000000000000000000000000000000000000000000e0b17e1200000000000000000000000000000000000000000000000000000000f86325ec00000000000000000000000000000000000000000000000000000000f86325ed00000000000000000000000000000000000000000000000000000000fb29b8c200000000000000000000000000000000000000000000000000000000fd7d799a00000000000000000000000000000000000000000000000000000000e0b17e1300000000000000000000000000000000000000000000000000000000eccc35fe00000000000000000000000000000000000000000000000000000000f446c1d000000000000000000000000000000000000000000000000000000000d65991e600000000000000000000000000000000000000000000000000000000d65991e700000000000000000000000000000000000000000000000000000000d73792a900000000000000000000000000000000000000000000000000000000d8b5a8b700000000000000000000000000000000000000000000000000000000cf6eefb700000000000000000000000000000000000000000000000000000000d547741f00000000000000000000000000000000000000000000000000000000d602b9fd00000000000000000000000000000000000000000000000000000000a2cd009d00000000000000000000000000000000000000000000000000000000cc8463c700000000000000000000000000000000000000000000000000000000cc8463c800000000000000000000000000000000000000000000000000000000ce9823fa00000000000000000000000000000000000000000000000000000000cefc142900000000000000000000000000000000000000000000000000000000a2cd009e00000000000000000000000000000000000000000000000000000000a4dde61f00000000000000000000000000000000000000000000000000000000c3ca7f31000000000000000000000000000000000000000000000000000000009611f3d8000000000000000000000000000000000000000000000000000000009611f3d900000000000000000000000000000000000000000000000000000000a1eda53c00000000000000000000000000000000000000000000000000000000a217fddf0000000000000000000000000000000000000000000000000000000084ef8ffc000000000000000000000000000000000000000000000000000000008da5cb5b0000000000000000000000000000000000000000000000000000000091d148540000000000000000000000000000000000000000000000000000000036144c9900000000000000000000000000000000000000000000000000000000634e93d90000000000000000000000000000000000000000000000000000000071c1c6670000000000000000000000000000000000000000000000000000000071c1c668000000000000000000000000000000000000000000000000000000007974f3d8000000000000000000000000000000000000000000000000000000007f51bb1f00000000000000000000000000000000000000000000000000000000634e93da00000000000000000000000000000000000000000000000000000000649a5ec7000000000000000000000000000000000000000000000000000000007075e7e800000000000000000000000000000000000000000000000000000000406f924700000000000000000000000000000000000000000000000000000000406f92480000000000000000000000000000000000000000000000000000000057adb295000000000000000000000000000000000000000000000000000000005c742a0c0000000000000000000000000000000000000000000000000000000036144c9a0000000000000000000000000000000000000000000000000000000036568abe0000000000000000000000000000000000000000000000000000000039de2ab4000000000000000000000000000000000000000000000000000000002268a97100000000000000000000000000000000000000000000000000000000320ba8f600000000000000000000000000000000000000000000000000000000320ba8f70000000000000000000000000000000000000000000000000000000032e7c5bf0000000000000000000000000000000000000000000000000000000033039d3d000000000000000000000000000000000000000000000000000000002268a97200000000000000000000000000000000000000000000000000000000248a9ca3000000000000000000000000000000000000000000000000000000002f2ff15d000000000000000000000000000000000000000000000000000000000b4501fc000000000000000000000000000000000000000000000000000000000b4501fd000000000000000000000000000000000000000000000000000000001a7dfa9f000000000000000000000000000000000000000000000000000000001d6598c80000000000000000000000000000000000000000000000000000000001ffc9a700000000000000000000000000000000000000000000000000000000022d63fb000000000000000000000000000000000000000000000000000000000aa6220b0000000000000000000000000000000000000000000000000000ffffffffffff000000000000000000000000ffffffffffffffffffffffffffffffffffffffff1806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000100000000000000018b198ca743c7949447acc2a3ece04f744837fdfd02f0b1dab89bda5a49167b00ffffffffffffffffffffffff0000000000000000000000000000000000000000eef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698400000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffaead680697d8eb75a175f7306a351336c6b05bc835dd5b872d2b717cb603746302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800020000000000000000000000000000000000004000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d350372ee5c687a138f5ddcda54d53bd80be194f0df9f32fdb50eb5eb98e260b69b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00ffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff0200000000000000000000000000000000000020000000000000000000000000d7e6bcf8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000f92ee8a9000000000000000000000000000000000000000000000000000000004032bac08a63c53f52fb370aca24a5388e07cc0d7ad5c5253fe4892e6710a18400000000000000000000000000000000000000200000008000000000000000000000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000ffffffffffffff7f0200000000000000000000000000000000000000000000a000000000000000008b198ca743c7949447acc2a3ece04f744837fdfd02f0b1dab89bda5a49167b038b198ca743c7949447acc2a3ece04f744837fdfd02f0b1dab89bda5a49167b02000000000000000000000000000000000000000000000000fffffffffffffe7f71bcc1b48f1efc70febd36f295a39ceb31113dda75613b9232b2dd56659975a1000000000000000000000000000000000000000000000000fffffffffffffe9f0200000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000f4240b7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97dffffffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffffffff00000000000000000000000000000000000000008886ebfc4259abdbc16601dd8fb5678e54878f47b3c34836cfc51154a9605109e2517d3f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000040000000800000000000000000c22c8022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d955391320200000200000000000000000000000000000004000000000000000000000000eef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401f6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b19ca5ebb000000000000000000000000000000000000000000000000000000005bd32650deaa5525c967180c32efbee71c7b47ad7a02122c9c87ea7d6ea0dd4000000000000000000000000000000000000000000000000000000000ffffff9ffdffffffffffffffffffffffffffffffffffffa000000000000000000000000097f8390f303d41a6db07b9e74de160b187da60bc50baf55ed8cdf777ba2d6a8415761ddb00000000000000000000000000000000000000000000000000000000bd231ea0fce7ea76366158df4b27f4eedc5ffc5b2b1a6f93140a79e5092fa0db8b198ca743c7949447acc2a3ece04f744837fdfd02f0b1dab89bda5a49167b01da2aca334521c5e57e72d7302c47356409a0b5c4a40038737639f66ca47e21b20000000000000000000000000000000000000040000000000000000000000000e6c4247b0000000000000000000000000000000000000000000000000000000085963e3e5ad55f074320ba108ae2f24d60869776ffca2b9bf5b491d70fad937a1379e222b05d06d186c6f0da80501e623d6e7435983eff3431984e8cbba1f92c000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000697802b1fa2edafe6f7b9e97c1a9e0c3660e645beb2dcaa2d45bdbf9beaf5472e1ec5f1038c18cf84a56e432fdbfaf746924b7ea511dfe03a6506a0ceba4888788d9b6dfcc650000000000000000000000000000000000000000000000000000000003377dc44241e779dd06afab5b788a35ca5f3b778836e2990bdb26a2a4b2e5ed600000000000000000000000000000000000000000000000000000000ffffff7ffdffffffffffffffffffffffffffffffffffff8000000000000000000000000040c59d2f1a31c57fcacf51488b47d55b46e40ea5cc3811363bdfc77c7e665e4bcb6e534400000000000000000000000000000000000000000000000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff6697b2320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000003fc3c27a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff80e16b18b4000000000000000000000000000000000000000000000000000000002c5211c6000000000000000000000000000000000000000000000000000000004e487b71000000000000000000000000000000000000000000000000000000003ee5aeb50000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff314987860000000000000000000000000000000000000000000000000000000001ffc9a7000000000000000000000000000000000000000000000000000000007965db0b00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9cc7f708afc65944829bd487b90b72536b1951864fbfc14e125fc972a6507f3900000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000003ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0d6bda27500000000000000000000000000000000000000000000000000000000cf4791810000000000000000000000000000000000000000000000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bde4a564ff6115eef089fd964017e8795573ff471a7479f28b9b222bd88315ab
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.