Source Code
Latest 9 from a total of 9 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Accept Transfer | 21709239 | 446 days ago | IN | 0 ETH | 0.00000097 | ||||
| Transfer | 21709183 | 446 days ago | IN | 0 ETH | 0.00000065 | ||||
| Accept Transfer | 21686054 | 446 days ago | IN | 0 ETH | 0.00000085 | ||||
| Transfer | 21685931 | 446 days ago | IN | 0 ETH | 0.00000055 | ||||
| Accept Transfer | 21685665 | 446 days ago | IN | 0 ETH | 0.00000081 | ||||
| Transfer | 21685538 | 446 days ago | IN | 0 ETH | 0.00000058 | ||||
| Accept Transfer | 21674387 | 447 days ago | IN | 0 ETH | 0.00000142 | ||||
| Transfer | 21674289 | 447 days ago | IN | 0 ETH | 0.00000082 | ||||
| Transfer Ownersh... | 18073306 | 530 days ago | IN | 0 ETH | 0.00000022 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
PassportRegistry
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract PassportRegistry is Ownable, Pausable {
// wallet => passport id
mapping(address => uint256) public passportId;
// passport id => wallet
mapping(uint256 => address) public idPassport;
// wallet => bool
mapping(address => bool) public walletActive;
// id => bool
mapping(uint256 => bool) public idActive;
// id => source
mapping(uint256 => string) public idSource;
// source => # passports
mapping(string => uint256) public sourcePassports;
// Total number of passports created
uint256 public totalCreates;
// Total number of passports sequencially created
uint256 public totalSequencialCreates;
// Total number of passports created by admins
uint256 public totalAdminsCreates;
// Total number of passport transfers
uint256 public totalPassportTransfers;
// The next id to be issued
uint256 private _nextSequentialPassportId;
// Smart contract id in sequencial mode
bool private _sequencial;
// A new passport has been created
event Create(address indexed wallet, uint256 passportId, string source);
// A passport has been tranfered
event Transfer(uint256 oldPassportId, uint256 newPassportId, address indexed oldWallet, address indexed newWallet);
// A passport has been deactivated
event Deactivate(address indexed wallet, uint256 passportId);
// A passport has been activated
event Activate(address indexed wallet, uint256 passportId);
// Passport generation mode changed
event PassportGenerationChanged(bool sequencial, uint256 nextSequencialPassportId);
// Transfer request initiated
event TransferRequested(address indexed fromWallet, address indexed toWallet, uint256 passportId);
// Transfer request accepted
event TransferAccepted(address indexed fromWallet, address indexed toWallet, uint256 passportId);
// Transfer request revoked
event TransferRevoked(address indexed wallet, uint256 passportId);
mapping(uint256 => address) public transferRequests;
/**
* @dev Modifier to make a function callable only when the contract is in sequencial mode.
*
* Requirements:
*
* - The contract must be in sequencial mode.
*/
modifier whenSequencialGeneration() {
require(sequencial(), "Admin generation mode");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is in admin generation mode.
*
* Requirements:
*
* - The contract must be in admin generation mode.
*/
modifier whenAdminGeneration() {
require(!sequencial(), "Sequencial generation mode");
_;
}
constructor(address initialOwner) Ownable(initialOwner) {
_sequencial = false;
}
/**
* @notice Creates a new passport with the next sequential ID.
* @dev Can only be called when the contract is in sequential generation mode and not paused.
* @param source The source of the passport creation.
*/
function create(string memory source) public whenNotPaused whenSequencialGeneration {
require(passportId[msg.sender] == 0, "Passport already exists");
totalSequencialCreates++;
_create(msg.sender, _nextSequentialPassportId, source);
_nextSequentialPassportId += 1;
}
/**
* @notice Creates a new passport with a specified ID for a specific wallet.
* @dev Can only be called by the owner when the contract is in admin generation mode and not paused.
* @param source The source of the passport creation.
* @param wallet The address of the wallet to associate with the new passport.
* @param id The ID to assign to the new passport.
*/
function adminCreate(
string memory source,
address wallet,
uint256 id
) public onlyOwner whenNotPaused whenAdminGeneration {
require(passportId[wallet] == 0, "Passport already exists");
totalAdminsCreates++;
_create(wallet, id, source);
}
/**
* @notice Transfers the passport ID of the msg.sender to the new wallet.
* @dev Can only be called by the passport owner and when the contract is not paused.
* @param newWallet The address of the new wallet to transfer the passport to.
*/
function transfer(address newWallet) public whenNotPaused {
uint256 id = passportId[msg.sender];
require(newWallet != msg.sender, "You can not transfer to yourself");
require(newWallet != address(0), "You can not transfer to zero address");
require(id != 0, "Passport does not exist");
require(passportId[newWallet] == 0, "Wallet passed already has a passport");
require(transferRequests[id] == address(0), "Pending transfer already exists for this passport ID");
transferRequests[id] = newWallet;
emit TransferRequested(msg.sender, newWallet, id);
}
/**
* @notice Accepts a pending passport transfer to the msg.sender's wallet.
* @dev Can be called by the new wallet to accept the transfer.
*/
function acceptTransfer(uint256 _passportId) public whenNotPaused {
address newWallet = transferRequests[_passportId];
require(newWallet == msg.sender, "You are not authorized to accept this transfer");
address oldWallet = idPassport[_passportId];
require(oldWallet != address(0), "Passport does not exist");
passportId[oldWallet] = 0;
passportId[newWallet] = _passportId;
idPassport[_passportId] = newWallet;
walletActive[oldWallet] = false;
walletActive[newWallet] = true;
totalPassportTransfers++;
delete transferRequests[_passportId];
emit TransferAccepted(oldWallet, newWallet, _passportId);
emit Transfer(_passportId, _passportId, oldWallet, newWallet);
}
/**
* @notice Revokes a pending passport transfer.
* @dev Can only be called by the passport owner and when the contract is not paused.
* @param _passportId The ID of the passport for which to revoke the transfer.
*/
function revokeTransfer(uint256 _passportId) public whenNotPaused {
address owner = idPassport[_passportId];
require(owner == msg.sender, "You are not the owner of this passport");
require(transferRequests[_passportId] != address(0), "No pending transfer to revoke");
delete transferRequests[_passportId];
emit TransferRevoked(msg.sender, _passportId);
}
// Admin
/**
* @notice Transfers the passport ID from one wallet to another.
* @dev Can only be called by the owner (aka admin).
* @param wallet The address of the wallet to transfer the passport from.
* @param id The new passport ID to assign to the wallet.
*/
function adminTransfer(address wallet, uint256 id) public onlyOwner {
uint256 oldId = passportId[wallet];
address idOwner = idPassport[id];
require(oldId != 0, "Wallet does not have a passport to transfer from");
require(idOwner == address(0), "New passport id already has a owner");
string memory source = idSource[oldId];
idSource[id] = source;
idSource[oldId] = "";
passportId[wallet] = id;
idPassport[oldId] = address(0);
walletActive[wallet] = true;
idActive[id] = true;
idActive[oldId] = false;
totalPassportTransfers++;
emit Transfer(oldId, id, wallet, wallet);
}
/**
* @notice Activates the passport with the given passport ID.
* @dev Can only be called by the owner when the contract is not paused.
* @param _passportId The ID of the passport to activate.
*/
function activate(uint256 _passportId) public whenNotPaused onlyOwner {
address wallet = idPassport[_passportId];
require(wallet != address(0), "Passport must exist");
require(walletActive[wallet] == false, "Passport must be inactive");
walletActive[wallet] = true;
idActive[_passportId] = true;
// emit event
emit Activate(wallet, _passportId);
}
/**
* @notice Deactivates the passport with the given passport ID.
* @dev Can only be called by the owner when the contract is not paused.
* @param _passportId The ID of the passport to deactivate.
*/
function deactivate(uint256 _passportId) public whenNotPaused onlyOwner {
address wallet = idPassport[_passportId];
require(wallet != address(0), "Passport must exist");
require(walletActive[wallet] == true, "Passport must be active");
walletActive[wallet] = false;
idActive[_passportId] = false;
// emit event
emit Deactivate(wallet, _passportId);
}
/**
* @notice Pauses the contract, disabling future creations.
* @dev Can only be called by the owner.
*/
function pause() public whenNotPaused onlyOwner {
_pause();
}
/**
* @notice Enables the contract, enabling new creations.
* @dev Can only be called by the owner.
*/
function unpause() public whenPaused onlyOwner {
_unpause();
}
/**
* @notice Changes the contract generation mode.
* @dev Can only be called by the owner.
* @param sequentialFlag Set to true for sequential generation mode, false for admin generation mode.
* @param nextSequentialPassportId The next sequential passport ID to be issued.
*/
function setGenerationMode(bool sequentialFlag, uint256 nextSequentialPassportId) public onlyOwner {
_sequencial = sequentialFlag;
_nextSequentialPassportId = nextSequentialPassportId;
emit PassportGenerationChanged(sequentialFlag, nextSequentialPassportId);
}
/**
* @dev Returns true if the contract is in sequencial mode, and false otherwise.
*/
function sequencial() public view virtual returns (bool) {
return _sequencial;
}
/**
* @dev Returns the next id to be generated.
*/
function nextId() public view virtual returns (uint256) {
return _nextSequentialPassportId;
}
// private
/**
* @dev Creates a new passport with the given ID for the specified wallet.
* @param wallet The address of the wallet to associate with the new passport.
* @param id The ID to assign to the new passport.
* @param source The source of the passport creation.
*/
function _create(address wallet, uint256 id, string memory source) private {
require(idPassport[id] == address(0), "Passport id already issued");
totalCreates++;
idPassport[id] = wallet;
passportId[wallet] = id;
walletActive[wallet] = true;
idActive[id] = true;
idSource[id] = source;
uint256 result = sourcePassports[source] + 1;
sourcePassports[source] = result;
emit Create(wallet, id, source);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"passportId","type":"uint256"}],"name":"Activate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"passportId","type":"uint256"},{"indexed":false,"internalType":"string","name":"source","type":"string"}],"name":"Create","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"passportId","type":"uint256"}],"name":"Deactivate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"sequencial","type":"bool"},{"indexed":false,"internalType":"uint256","name":"nextSequencialPassportId","type":"uint256"}],"name":"PassportGenerationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldPassportId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPassportId","type":"uint256"},{"indexed":true,"internalType":"address","name":"oldWallet","type":"address"},{"indexed":true,"internalType":"address","name":"newWallet","type":"address"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromWallet","type":"address"},{"indexed":true,"internalType":"address","name":"toWallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"passportId","type":"uint256"}],"name":"TransferAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromWallet","type":"address"},{"indexed":true,"internalType":"address","name":"toWallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"passportId","type":"uint256"}],"name":"TransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"passportId","type":"uint256"}],"name":"TransferRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"uint256","name":"_passportId","type":"uint256"}],"name":"acceptTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_passportId","type":"uint256"}],"name":"activate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"source","type":"string"},{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"adminCreate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"adminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"source","type":"string"}],"name":"create","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_passportId","type":"uint256"}],"name":"deactivate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"idActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"idPassport","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"idSource","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"passportId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_passportId","type":"uint256"}],"name":"revokeTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sequencial","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"sequentialFlag","type":"bool"},{"internalType":"uint256","name":"nextSequentialPassportId","type":"uint256"}],"name":"setGenerationMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"sourcePassports","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAdminsCreates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalCreates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPassportTransfers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSequencialCreates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newWallet","type":"address"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferRequests","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162001bef38038062001bef8339810160408190526200003491620000de565b806001600160a01b0381166200006457604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200006f816200008e565b50506000805460ff60a01b19169055600c805460ff1916905562000110565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000f157600080fd5b81516001600160a01b03811681146200010957600080fd5b9392505050565b611acf80620001206000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80637bdfddd2116100f9578063b260c42a11610097578063e34f95c511610071578063e34f95c5146103d0578063eaea2e17146103f3578063f17e48ec14610413578063f2fde38b1461042657600080fd5b8063b260c42a146103a1578063b6a46b3b146103b4578063cbd9ca03146103c757600080fd5b80638da5cb5b116100d35780638da5cb5b14610361578063916b9bef1461037257806395a7d9eb14610385578063a5a968d71461038e57600080fd5b80637bdfddd21461031d5780638456cb59146103465780638bed50791461034e57600080fd5b80633f4ba83a1161016657806361b8ce8c1161014057806361b8ce8c146102f157806365c6f69a146102f957806367d67bb11461030c578063715018a61461031557600080fd5b80633f4ba83a146102ac5780635c975abb146102b45780635ea054c0146102c657600080fd5b80631a695230116101a25780631a695230146102595780631ca8b8ab1461026e578063274fae7c1461028e5780633031738a146102a157600080fd5b806302fa5d23146101c957806303486c401461020157806316d060c414610242575b600080fd5b6101ec6101d7366004611694565b60046020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61022a61020f366004611694565b600d602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101f8565b61024b60095481565b6040519081526020016101f8565b61026c6102673660046116c9565b610439565b005b61024b61027c3660046116c9565b60016020526000908152604090205481565b61026c61029c366004611694565b6106f3565b600c5460ff166101ec565b61026c61092b565b600054600160a01b900460ff166101ec565b61024b6102d436600461178e565b805160208183018101805160068252928201919093012091525481565b600b5461024b565b61026c6103073660046117cb565b610945565b61024b60075481565b61026c6109a0565b61022a61032b366004611694565b6002602052600090815260409020546001600160a01b031681565b61026c6109b2565b61026c61035c366004611694565b6109ca565b6000546001600160a01b031661022a565b61026c610380366004611694565b610b1f565b61024b60085481565b61026c61039c3660046117fc565b610c67565b61026c6103af366004611694565b610d55565b61026c6103c236600461178e565b610e9e565b61024b600a5481565b6101ec6103de3660046116c9565b60036020526000908152604090205460ff1681565b610406610401366004611694565b610f92565b6040516101f891906118a3565b61026c6104213660046118b6565b61102c565b61026c6104343660046116c9565b6112ff565b610441611356565b33600081815260016020526040902054906001600160a01b038316036104ae5760405162461bcd60e51b815260206004820181905260248201527f596f752063616e206e6f74207472616e7366657220746f20796f757273656c6660448201526064015b60405180910390fd5b6001600160a01b0382166105295760405162461bcd60e51b8152602060048201526024808201527f596f752063616e206e6f74207472616e7366657220746f207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104a5565b806000036105795760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420646f6573206e6f7420657869737400000000000000000060448201526064016104a5565b6001600160a01b038216600090815260016020526040902054156106045760405162461bcd60e51b8152602060048201526024808201527f57616c6c65742070617373656420616c7265616479206861732061207061737360448201527f706f72740000000000000000000000000000000000000000000000000000000060648201526084016104a5565b6000818152600d60205260409020546001600160a01b03161561068f5760405162461bcd60e51b815260206004820152603460248201527f50656e64696e67207472616e7366657220616c7265616479206578697374732060448201527f666f7220746869732070617373706f727420494400000000000000000000000060648201526084016104a5565b6000818152600d602090815260409182902080546001600160a01b0319166001600160a01b038616908117909155915183815233917f68d8b242061749353081922c3f317f3f4eb148ef7afa77145efa32e9b3c7b936910160405180910390a35050565b6106fb611356565b6000818152600d60205260409020546001600160a01b03163381146107885760405162461bcd60e51b815260206004820152602e60248201527f596f7520617265206e6f7420617574686f72697a656420746f2061636365707460448201527f2074686973207472616e7366657200000000000000000000000000000000000060648201526084016104a5565b6000828152600260205260409020546001600160a01b0316806107ed5760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420646f6573206e6f7420657869737400000000000000000060448201526064016104a5565b6001600160a01b0380821660008181526001602081815260408084208490559487168084528584208990558884526002825285842080546001600160a01b0319168217905593835260039052838220805460ff1990811690915592825292812080549092169092179055600a805491610865836118e8565b90915550506000838152600d60205260409081902080546001600160a01b0319169055516001600160a01b0383811691908316907fd15d7ca9b79821e937415404109471ce2e5306685f89e4c6d1d9fde9c49ab5dc906108c89087815260200190565b60405180910390a3816001600160a01b0316816001600160a01b03167f9f65d9ea50ab662b40d515f674de3e49eae2144ce2877d5ff17a4a19905883b8858660405161091e929190918252602082015260400190565b60405180910390a3505050565b61093361139a565b61093b6113dd565b610943611423565b565b61094d6113dd565b600c805460ff1916831515908117909155600b82905560408051918252602082018390527f3beee7330277f27f323f6359d5d3bd82e9291ac54843740f23b52e9b9c77e0ba910160405180910390a15050565b6109a86113dd565b6109436000611478565b6109ba611356565b6109c26113dd565b6109436114c8565b6109d2611356565b6000818152600260205260409020546001600160a01b0316338114610a5f5760405162461bcd60e51b815260206004820152602660248201527f596f7520617265206e6f7420746865206f776e6572206f66207468697320706160448201527f7373706f7274000000000000000000000000000000000000000000000000000060648201526084016104a5565b6000828152600d60205260409020546001600160a01b0316610ac35760405162461bcd60e51b815260206004820152601d60248201527f4e6f2070656e64696e67207472616e7366657220746f207265766f6b6500000060448201526064016104a5565b6000828152600d60205260409081902080546001600160a01b03191690555133907fbe5b36fd55a06d4a10c43ce6f10ae1e30bbd575b3848630efd3dcd5b2718ae5990610b139085815260200190565b60405180910390a25050565b610b27611356565b610b2f6113dd565b6000818152600260205260409020546001600160a01b031680610b945760405162461bcd60e51b815260206004820152601360248201527f50617373706f7274206d7573742065786973740000000000000000000000000060448201526064016104a5565b6001600160a01b03811660009081526003602052604090205460ff161515600114610c015760405162461bcd60e51b815260206004820152601760248201527f50617373706f7274206d7573742062652061637469766500000000000000000060448201526064016104a5565b6001600160a01b0381166000818152600360209081526040808320805460ff199081169091558684526004835292819020805490931690925590518481527f13b865880a841dc469b629159fa1e730fee99568b0decc6737fd688b362463819101610b13565b610c6f6113dd565b610c77611356565b600c5460ff1615610cca5760405162461bcd60e51b815260206004820152601a60248201527f53657175656e6369616c2067656e65726174696f6e206d6f646500000000000060448201526064016104a5565b6001600160a01b03821660009081526001602052604090205415610d305760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420616c72656164792065786973747300000000000000000060448201526064016104a5565b60098054906000610d40836118e8565b9190505550610d5082828561150b565b505050565b610d5d611356565b610d656113dd565b6000818152600260205260409020546001600160a01b031680610dca5760405162461bcd60e51b815260206004820152601360248201527f50617373706f7274206d7573742065786973740000000000000000000000000060448201526064016104a5565b6001600160a01b03811660009081526003602052604090205460ff1615610e335760405162461bcd60e51b815260206004820152601960248201527f50617373706f7274206d75737420626520696e6163746976650000000000000060448201526064016104a5565b6001600160a01b03811660008181526003602090815260408083208054600160ff199182168117909255878552600484529382902080549094161790925590518481527ffbd0a3f6e9a0dd5f834515748047e83de8064477489a0a0d6b59c64bbecc992a9101610b13565b610ea6611356565b600c5460ff16610ef85760405162461bcd60e51b815260206004820152601560248201527f41646d696e2067656e65726174696f6e206d6f6465000000000000000000000060448201526064016104a5565b3360009081526001602052604090205415610f555760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420616c72656164792065786973747300000000000000000060448201526064016104a5565b60088054906000610f65836118e8565b9190505550610f7733600b548361150b565b6001600b6000828254610f8a9190611901565b909155505050565b60056020526000908152604090208054610fab9061191a565b80601f0160208091040260200160405190810160405280929190818152602001828054610fd79061191a565b80156110245780601f10610ff957610100808354040283529160200191611024565b820191906000526020600020905b81548152906001019060200180831161100757829003601f168201915b505050505081565b6110346113dd565b6001600160a01b038083166000908152600160209081526040808320548584526002909252822054909216908290036110d55760405162461bcd60e51b815260206004820152603060248201527f57616c6c657420646f6573206e6f74206861766520612070617373706f72742060448201527f746f207472616e736665722066726f6d0000000000000000000000000000000060648201526084016104a5565b6001600160a01b038116156111525760405162461bcd60e51b815260206004820152602360248201527f4e65772070617373706f727420696420616c7265616479206861732061206f7760448201527f6e6572000000000000000000000000000000000000000000000000000000000060648201526084016104a5565b6000828152600560205260408120805461116b9061191a565b80601f01602080910402602001604051908101604052809291908181526020018280546111979061191a565b80156111e45780601f106111b9576101008083540402835291602001916111e4565b820191906000526020600020905b8154815290600101906020018083116111c757829003601f168201915b50505060008781526005602052604090209293506112069150839050826119a4565b50604080516020808201835260008083528681526005909152919091209061122e90826119a4565b506001600160a01b03851660008181526001602081815260408084208990558784526002825280842080546001600160a01b031916905593835260038152838320805460ff1990811684179091558884526004909152838320805482169092179091558582529181208054909216909155600a8054916112ad836118e8565b909155505060408051848152602081018690526001600160a01b0387169182917f9f65d9ea50ab662b40d515f674de3e49eae2144ce2877d5ff17a4a19905883b8910160405180910390a35050505050565b6113076113dd565b6001600160a01b03811661134a576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016104a5565b61135381611478565b50565b600054600160a01b900460ff1615610943576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054600160a01b900460ff16610943576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546001600160a01b03163314610943576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016104a5565b61142b61139a565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6114d0611356565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861145b3390565b6000828152600260205260409020546001600160a01b0316156115705760405162461bcd60e51b815260206004820152601a60248201527f50617373706f727420696420616c72656164792069737375656400000000000060448201526064016104a5565b60078054906000611580836118e8565b9091555050600082815260026020908152604080832080546001600160a01b0319166001600160a01b0388169081179091558352600180835281842086905560038352818420805460ff1990811683179091558685526004845282852080549091169091179055600590915290206115f882826119a4565b50600060068260405161160b9190611a64565b90815260200160405180910390205460016116269190611901565b9050806006836040516116399190611a64565b908152602001604051809103902081905550836001600160a01b03167f06acdc615e0b6df2984444b78654ef89855fead2ca37b1d70464c0e7827590e28484604051611686929190611a80565b60405180910390a250505050565b6000602082840312156116a657600080fd5b5035919050565b80356001600160a01b03811681146116c457600080fd5b919050565b6000602082840312156116db57600080fd5b6116e4826116ad565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261171257600080fd5b813567ffffffffffffffff8082111561172d5761172d6116eb565b604051601f8301601f19908116603f01168101908282118183101715611755576117556116eb565b8160405283815286602085880101111561176e57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000602082840312156117a057600080fd5b813567ffffffffffffffff8111156117b757600080fd5b6117c384828501611701565b949350505050565b600080604083850312156117de57600080fd5b823580151581146117ee57600080fd5b946020939093013593505050565b60008060006060848603121561181157600080fd5b833567ffffffffffffffff81111561182857600080fd5b61183486828701611701565b935050611843602085016116ad565b9150604084013590509250925092565b60005b8381101561186e578181015183820152602001611856565b50506000910152565b6000815180845261188f816020860160208601611853565b601f01601f19169290920160200192915050565b6020815260006116e46020830184611877565b600080604083850312156118c957600080fd5b6117ee836116ad565b634e487b7160e01b600052601160045260246000fd5b6000600182016118fa576118fa6118d2565b5060010190565b80820180821115611914576119146118d2565b92915050565b600181811c9082168061192e57607f821691505b60208210810361194e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d50576000816000526020600020601f850160051c8101602086101561197d5750805b601f850160051c820191505b8181101561199c57828155600101611989565b505050505050565b815167ffffffffffffffff8111156119be576119be6116eb565b6119d2816119cc845461191a565b84611954565b602080601f831160018114611a0757600084156119ef5750858301515b600019600386901b1c1916600185901b17855561199c565b600085815260208120601f198616915b82811015611a3657888601518255948401946001909101908401611a17565b5085821015611a545787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251611a76818460208701611853565b9190910192915050565b8281526040602082015260006117c3604083018461187756fea26469706673582212201b7f022386d5dcf7bce6803a6665a8f9c501a3accf8dd6ab150acea043894f5764736f6c634300081800330000000000000000000000003c16c7092fe83d874bc4dd52c3b51510c69f1d7b
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637bdfddd2116100f9578063b260c42a11610097578063e34f95c511610071578063e34f95c5146103d0578063eaea2e17146103f3578063f17e48ec14610413578063f2fde38b1461042657600080fd5b8063b260c42a146103a1578063b6a46b3b146103b4578063cbd9ca03146103c757600080fd5b80638da5cb5b116100d35780638da5cb5b14610361578063916b9bef1461037257806395a7d9eb14610385578063a5a968d71461038e57600080fd5b80637bdfddd21461031d5780638456cb59146103465780638bed50791461034e57600080fd5b80633f4ba83a1161016657806361b8ce8c1161014057806361b8ce8c146102f157806365c6f69a146102f957806367d67bb11461030c578063715018a61461031557600080fd5b80633f4ba83a146102ac5780635c975abb146102b45780635ea054c0146102c657600080fd5b80631a695230116101a25780631a695230146102595780631ca8b8ab1461026e578063274fae7c1461028e5780633031738a146102a157600080fd5b806302fa5d23146101c957806303486c401461020157806316d060c414610242575b600080fd5b6101ec6101d7366004611694565b60046020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61022a61020f366004611694565b600d602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101f8565b61024b60095481565b6040519081526020016101f8565b61026c6102673660046116c9565b610439565b005b61024b61027c3660046116c9565b60016020526000908152604090205481565b61026c61029c366004611694565b6106f3565b600c5460ff166101ec565b61026c61092b565b600054600160a01b900460ff166101ec565b61024b6102d436600461178e565b805160208183018101805160068252928201919093012091525481565b600b5461024b565b61026c6103073660046117cb565b610945565b61024b60075481565b61026c6109a0565b61022a61032b366004611694565b6002602052600090815260409020546001600160a01b031681565b61026c6109b2565b61026c61035c366004611694565b6109ca565b6000546001600160a01b031661022a565b61026c610380366004611694565b610b1f565b61024b60085481565b61026c61039c3660046117fc565b610c67565b61026c6103af366004611694565b610d55565b61026c6103c236600461178e565b610e9e565b61024b600a5481565b6101ec6103de3660046116c9565b60036020526000908152604090205460ff1681565b610406610401366004611694565b610f92565b6040516101f891906118a3565b61026c6104213660046118b6565b61102c565b61026c6104343660046116c9565b6112ff565b610441611356565b33600081815260016020526040902054906001600160a01b038316036104ae5760405162461bcd60e51b815260206004820181905260248201527f596f752063616e206e6f74207472616e7366657220746f20796f757273656c6660448201526064015b60405180910390fd5b6001600160a01b0382166105295760405162461bcd60e51b8152602060048201526024808201527f596f752063616e206e6f74207472616e7366657220746f207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104a5565b806000036105795760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420646f6573206e6f7420657869737400000000000000000060448201526064016104a5565b6001600160a01b038216600090815260016020526040902054156106045760405162461bcd60e51b8152602060048201526024808201527f57616c6c65742070617373656420616c7265616479206861732061207061737360448201527f706f72740000000000000000000000000000000000000000000000000000000060648201526084016104a5565b6000818152600d60205260409020546001600160a01b03161561068f5760405162461bcd60e51b815260206004820152603460248201527f50656e64696e67207472616e7366657220616c7265616479206578697374732060448201527f666f7220746869732070617373706f727420494400000000000000000000000060648201526084016104a5565b6000818152600d602090815260409182902080546001600160a01b0319166001600160a01b038616908117909155915183815233917f68d8b242061749353081922c3f317f3f4eb148ef7afa77145efa32e9b3c7b936910160405180910390a35050565b6106fb611356565b6000818152600d60205260409020546001600160a01b03163381146107885760405162461bcd60e51b815260206004820152602e60248201527f596f7520617265206e6f7420617574686f72697a656420746f2061636365707460448201527f2074686973207472616e7366657200000000000000000000000000000000000060648201526084016104a5565b6000828152600260205260409020546001600160a01b0316806107ed5760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420646f6573206e6f7420657869737400000000000000000060448201526064016104a5565b6001600160a01b0380821660008181526001602081815260408084208490559487168084528584208990558884526002825285842080546001600160a01b0319168217905593835260039052838220805460ff1990811690915592825292812080549092169092179055600a805491610865836118e8565b90915550506000838152600d60205260409081902080546001600160a01b0319169055516001600160a01b0383811691908316907fd15d7ca9b79821e937415404109471ce2e5306685f89e4c6d1d9fde9c49ab5dc906108c89087815260200190565b60405180910390a3816001600160a01b0316816001600160a01b03167f9f65d9ea50ab662b40d515f674de3e49eae2144ce2877d5ff17a4a19905883b8858660405161091e929190918252602082015260400190565b60405180910390a3505050565b61093361139a565b61093b6113dd565b610943611423565b565b61094d6113dd565b600c805460ff1916831515908117909155600b82905560408051918252602082018390527f3beee7330277f27f323f6359d5d3bd82e9291ac54843740f23b52e9b9c77e0ba910160405180910390a15050565b6109a86113dd565b6109436000611478565b6109ba611356565b6109c26113dd565b6109436114c8565b6109d2611356565b6000818152600260205260409020546001600160a01b0316338114610a5f5760405162461bcd60e51b815260206004820152602660248201527f596f7520617265206e6f7420746865206f776e6572206f66207468697320706160448201527f7373706f7274000000000000000000000000000000000000000000000000000060648201526084016104a5565b6000828152600d60205260409020546001600160a01b0316610ac35760405162461bcd60e51b815260206004820152601d60248201527f4e6f2070656e64696e67207472616e7366657220746f207265766f6b6500000060448201526064016104a5565b6000828152600d60205260409081902080546001600160a01b03191690555133907fbe5b36fd55a06d4a10c43ce6f10ae1e30bbd575b3848630efd3dcd5b2718ae5990610b139085815260200190565b60405180910390a25050565b610b27611356565b610b2f6113dd565b6000818152600260205260409020546001600160a01b031680610b945760405162461bcd60e51b815260206004820152601360248201527f50617373706f7274206d7573742065786973740000000000000000000000000060448201526064016104a5565b6001600160a01b03811660009081526003602052604090205460ff161515600114610c015760405162461bcd60e51b815260206004820152601760248201527f50617373706f7274206d7573742062652061637469766500000000000000000060448201526064016104a5565b6001600160a01b0381166000818152600360209081526040808320805460ff199081169091558684526004835292819020805490931690925590518481527f13b865880a841dc469b629159fa1e730fee99568b0decc6737fd688b362463819101610b13565b610c6f6113dd565b610c77611356565b600c5460ff1615610cca5760405162461bcd60e51b815260206004820152601a60248201527f53657175656e6369616c2067656e65726174696f6e206d6f646500000000000060448201526064016104a5565b6001600160a01b03821660009081526001602052604090205415610d305760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420616c72656164792065786973747300000000000000000060448201526064016104a5565b60098054906000610d40836118e8565b9190505550610d5082828561150b565b505050565b610d5d611356565b610d656113dd565b6000818152600260205260409020546001600160a01b031680610dca5760405162461bcd60e51b815260206004820152601360248201527f50617373706f7274206d7573742065786973740000000000000000000000000060448201526064016104a5565b6001600160a01b03811660009081526003602052604090205460ff1615610e335760405162461bcd60e51b815260206004820152601960248201527f50617373706f7274206d75737420626520696e6163746976650000000000000060448201526064016104a5565b6001600160a01b03811660008181526003602090815260408083208054600160ff199182168117909255878552600484529382902080549094161790925590518481527ffbd0a3f6e9a0dd5f834515748047e83de8064477489a0a0d6b59c64bbecc992a9101610b13565b610ea6611356565b600c5460ff16610ef85760405162461bcd60e51b815260206004820152601560248201527f41646d696e2067656e65726174696f6e206d6f6465000000000000000000000060448201526064016104a5565b3360009081526001602052604090205415610f555760405162461bcd60e51b815260206004820152601760248201527f50617373706f727420616c72656164792065786973747300000000000000000060448201526064016104a5565b60088054906000610f65836118e8565b9190505550610f7733600b548361150b565b6001600b6000828254610f8a9190611901565b909155505050565b60056020526000908152604090208054610fab9061191a565b80601f0160208091040260200160405190810160405280929190818152602001828054610fd79061191a565b80156110245780601f10610ff957610100808354040283529160200191611024565b820191906000526020600020905b81548152906001019060200180831161100757829003601f168201915b505050505081565b6110346113dd565b6001600160a01b038083166000908152600160209081526040808320548584526002909252822054909216908290036110d55760405162461bcd60e51b815260206004820152603060248201527f57616c6c657420646f6573206e6f74206861766520612070617373706f72742060448201527f746f207472616e736665722066726f6d0000000000000000000000000000000060648201526084016104a5565b6001600160a01b038116156111525760405162461bcd60e51b815260206004820152602360248201527f4e65772070617373706f727420696420616c7265616479206861732061206f7760448201527f6e6572000000000000000000000000000000000000000000000000000000000060648201526084016104a5565b6000828152600560205260408120805461116b9061191a565b80601f01602080910402602001604051908101604052809291908181526020018280546111979061191a565b80156111e45780601f106111b9576101008083540402835291602001916111e4565b820191906000526020600020905b8154815290600101906020018083116111c757829003601f168201915b50505060008781526005602052604090209293506112069150839050826119a4565b50604080516020808201835260008083528681526005909152919091209061122e90826119a4565b506001600160a01b03851660008181526001602081815260408084208990558784526002825280842080546001600160a01b031916905593835260038152838320805460ff1990811684179091558884526004909152838320805482169092179091558582529181208054909216909155600a8054916112ad836118e8565b909155505060408051848152602081018690526001600160a01b0387169182917f9f65d9ea50ab662b40d515f674de3e49eae2144ce2877d5ff17a4a19905883b8910160405180910390a35050505050565b6113076113dd565b6001600160a01b03811661134a576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016104a5565b61135381611478565b50565b600054600160a01b900460ff1615610943576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054600160a01b900460ff16610943576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546001600160a01b03163314610943576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016104a5565b61142b61139a565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6114d0611356565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861145b3390565b6000828152600260205260409020546001600160a01b0316156115705760405162461bcd60e51b815260206004820152601a60248201527f50617373706f727420696420616c72656164792069737375656400000000000060448201526064016104a5565b60078054906000611580836118e8565b9091555050600082815260026020908152604080832080546001600160a01b0319166001600160a01b0388169081179091558352600180835281842086905560038352818420805460ff1990811683179091558685526004845282852080549091169091179055600590915290206115f882826119a4565b50600060068260405161160b9190611a64565b90815260200160405180910390205460016116269190611901565b9050806006836040516116399190611a64565b908152602001604051809103902081905550836001600160a01b03167f06acdc615e0b6df2984444b78654ef89855fead2ca37b1d70464c0e7827590e28484604051611686929190611a80565b60405180910390a250505050565b6000602082840312156116a657600080fd5b5035919050565b80356001600160a01b03811681146116c457600080fd5b919050565b6000602082840312156116db57600080fd5b6116e4826116ad565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261171257600080fd5b813567ffffffffffffffff8082111561172d5761172d6116eb565b604051601f8301601f19908116603f01168101908282118183101715611755576117556116eb565b8160405283815286602085880101111561176e57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000602082840312156117a057600080fd5b813567ffffffffffffffff8111156117b757600080fd5b6117c384828501611701565b949350505050565b600080604083850312156117de57600080fd5b823580151581146117ee57600080fd5b946020939093013593505050565b60008060006060848603121561181157600080fd5b833567ffffffffffffffff81111561182857600080fd5b61183486828701611701565b935050611843602085016116ad565b9150604084013590509250925092565b60005b8381101561186e578181015183820152602001611856565b50506000910152565b6000815180845261188f816020860160208601611853565b601f01601f19169290920160200192915050565b6020815260006116e46020830184611877565b600080604083850312156118c957600080fd5b6117ee836116ad565b634e487b7160e01b600052601160045260246000fd5b6000600182016118fa576118fa6118d2565b5060010190565b80820180821115611914576119146118d2565b92915050565b600181811c9082168061192e57607f821691505b60208210810361194e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610d50576000816000526020600020601f850160051c8101602086101561197d5750805b601f850160051c820191505b8181101561199c57828155600101611989565b505050505050565b815167ffffffffffffffff8111156119be576119be6116eb565b6119d2816119cc845461191a565b84611954565b602080601f831160018114611a0757600084156119ef5750858301515b600019600386901b1c1916600185901b17855561199c565b600085815260208120601f198616915b82811015611a3657888601518255948401946001909101908401611a17565b5085821015611a545787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251611a76818460208701611853565b9190910192915050565b8281526040602082015260006117c3604083018461187756fea26469706673582212201b7f022386d5dcf7bce6803a6665a8f9c501a3accf8dd6ab150acea043894f5764736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003c16c7092fe83d874bc4dd52c3b51510c69f1d7b
-----Decoded View---------------
Arg [0] : initialOwner (address): 0x3C16C7092FE83d874BC4dd52c3b51510C69F1D7b
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003c16c7092fe83d874bc4dd52c3b51510c69f1d7b
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.